Generated on Sat Feb 7 2015 02:01:50 for Gecode by doxygen 1.8.9.1
Gecode::Search::Parallel::DFS Class Reference

Parallel depth-first search engine More...

#include <dfs.hh>

Classes

class  Worker
 Parallel depth-first search worker More...
 

Public Member Functions

Workerworker (unsigned int i) const
 Provide access to worker i. More...
 
- Public Member Functions inherited from Gecode::Search::Parallel::Engine
const Optionsopt (void) const
 Provide access to search options. More...
 
unsigned int workers (void) const
 Return number of workers. More...
 
Cmd cmd (void) const
 Return current command. More...
 
void block (void)
 Block all workers. More...
 
void release (Cmd c)
 Release all workers. More...
 
void wait (void)
 Ensure that worker waits. More...
 
void ack_terminate (void)
 For worker to acknowledge termination command. More...
 
void terminated (void)
 For worker to register termination. More...
 
void wait_terminate (void)
 For worker to wait until termination is legal. More...
 
void terminate (void)
 For engine to peform thread termination. More...
 
void ack_reset_start (void)
 For worker to acknowledge start of reset cycle. More...
 
void ack_reset_stop (void)
 For worker to acknowledge stop of reset cycle. More...
 
void wait_reset (void)
 For worker to wait for all workers to reset. More...
 
void idle (void)
 Report that worker is idle. More...
 
void busy (void)
 Report that worker is busy. More...
 
void stop (void)
 Report that worker has been stopped. More...
 
 Engine (const Options &o)
 Initialize with options o. More...
 
virtual Spacenext (void)
 Return next solution (NULL, if none exists or search has been stopped) More...
 
virtual bool stopped (void) const
 Check whether engine has been stopped. More...
 
- Public Member Functions inherited from Gecode::Search::Engine
virtual ~Engine (void)
 Destructor. More...
 

Protected Attributes

Worker ** _worker
 Array of worker references. More...
 
- Protected Attributes inherited from Gecode::Search::Parallel::Engine
const Options _opt
 Search options. More...
 
volatile Cmd _cmd
 The current command. More...
 
Support::Mutex _m_wait
 Mutex for forcing workers to wait. More...
 
Support::Mutex _m_term
 Mutex for access to termination information. More...
 
volatile unsigned int _n_term_not_ack
 Number of workers that have not yet acknowledged termination. More...
 
Support::Event _e_term_ack
 Event for termination acknowledgment. More...
 
Support::Mutex _m_wait_terminate
 Mutex for waiting for termination. More...
 
volatile unsigned int _n_not_terminated
 Number of not yet terminated workers. More...
 
Support::Event _e_terminate
 Event for termination (all threads have terminated) More...
 
Support::Mutex _m_reset
 Mutex for access to reset information. More...
 
volatile unsigned int _n_reset_not_ack
 Number of workers that have not yet acknowledged reset. More...
 
Support::Event e_reset_ack_start
 Event for reset acknowledgment started. More...
 
Support::Event e_reset_ack_stop
 Event for reset acknowledgment stopped. More...
 
Support::Mutex m_wait_reset
 Mutex for waiting for reset. More...
 
Support::Mutex m_search
 Mutex for search. More...
 
Support::Event e_search
 Event for search (solution found, no more solutions, search stopped) More...
 
Support::DynamicQueue< Space *, Heapsolutions
 Queue of solutions. More...
 
volatile unsigned int n_busy
 Number of busy workers. More...
 
volatile bool has_stopped
 Whether a worker had been stopped. More...
 

Search control

void solution (Space *s)
 Report solution s. More...
 

Engine interface

 DFS (Space *s, const Options &o)
 Initialize for space s with options o. More...
 
virtual Statistics statistics (void) const
 Return statistics. More...
 
virtual void reset (Space *s)
 Reset engine to restart at space s. More...
 
virtual NoGoodsnogoods (void)
 Return no-goods. More...
 
virtual ~DFS (void)
 Destructor. More...
 

Additional Inherited Members

- Public Types inherited from Gecode::Search::Parallel::Engine
enum  Cmd { C_WORK, C_WAIT, C_RESET, C_TERMINATE }
 Commands from engine to workers. More...
 
- Protected Member Functions inherited from Gecode::Search::Parallel::Engine
bool signal (void) const
 Whether search state changed such that signal is needed. More...
 

Detailed Description

Parallel depth-first search engine

Definition at line 46 of file dfs.hh.

Constructor & Destructor Documentation

Gecode::Search::Parallel::DFS::DFS ( Space s,
const Options o 
)
inline

Initialize for space s with options o.

Definition at line 110 of file dfs.hh.

Gecode::Search::Parallel::DFS::~DFS ( void  )
virtual

Destructor.

Definition at line 230 of file dfs.cpp.

Member Function Documentation

DFS::Worker * Gecode::Search::Parallel::DFS::worker ( unsigned int  i) const
inline

Provide access to worker i.

Definition at line 98 of file dfs.hh.

void Gecode::Search::Parallel::DFS::solution ( Space s)
inline

Report solution s.

Definition at line 150 of file dfs.hh.

Statistics Gecode::Search::Parallel::DFS::statistics ( void  ) const
virtual

Return statistics.

Implements Gecode::Search::Engine.

Definition at line 50 of file dfs.cpp.

void Gecode::Search::Parallel::DFS::reset ( Space s)
virtual

Reset engine to restart at space s.

Implements Gecode::Search::Engine.

Definition at line 181 of file dfs.cpp.

NoGoods & Gecode::Search::Parallel::DFS::nogoods ( void  )
virtual

Return no-goods.

Implements Gecode::Search::Engine.

Definition at line 208 of file dfs.cpp.

Member Data Documentation

Worker** Gecode::Search::Parallel::DFS::_worker
protected

Array of worker references.

Definition at line 63 of file dfs.hh.


The documentation for this class was generated from the following files: