34#ifndef __GECODE_SEARCH_PAR_DFS_HH__
35#define __GECODE_SEARCH_PAR_DFS_HH__
42 template<
class Tracer>
84 virtual void run(
void);
No-goods recorded from restarts.
Parallel depth-first search worker
Worker(Space *s, DFS &e)
Initialize for space s with engine e.
void find(void)
Try to find some work.
DFS & engine(void) const
Provide access to engine.
virtual void run(void)
Start execution of worker.
virtual Statistics statistics(void) const
Return statistics.
void solution(Space *s)
Report solution s.
virtual void reset(Space *s)
Reset engine to restart at space s.
DFS(Space *s, const Options &o)
Initialize for space s with options o.
Worker * worker(unsigned int i) const
Provide access to worker i.
Worker ** _worker
Array of worker references.
virtual NoGoods & nogoods(void)
Return no-goods.
virtual ~DFS(void)
Destructor.
Support::Mutex m
Mutex for access to worker.
Engine & _engine
Reference to engine.
Space * cur
Current space being explored.
Tracer tracer
Search tracer.
unsigned int d
Distance until next clone.
bool idle
Whether the worker is idle.
Path< Tracer > path
Current path ins search tree.
void idle(void)
Report that worker is idle.
const Options & opt(void) const
Provide access to search options.
Support::Event e_reset_ack_stop
Event for reset acknowledgment stopped.
Support::Event e_search
Event for search (solution found, no more solutions, search stopped)
Support::DynamicQueue< Space *, Heap > solutions
Queue of solutions.
void stop(void)
Report that worker has been stopped.
void block(void)
Block all workers.
Support::Mutex m_wait_reset
Mutex for waiting for reset.
Support::Mutex m_search
Mutex for search.
Support::Event e_reset_ack_start
Event for reset acknowledgment started.
Engine(const Options &o)
Initialize with options o.
void busy(void)
Report that worker is busy.
void release(Cmd c)
Release all workers.
bool signal(void) const
Whether search state changed such that signal is needed.
void terminate(void)
For engine to peform thread termination.
volatile unsigned int n_busy
Number of busy workers.
unsigned int workers(void) const
Return number of workers.
@ C_RESET
Perform reset operation.
@ C_WAIT
Run into wait lock.
unsigned long int fail
Number of failed nodes in search tree.
unsigned long int node
Number of nodes expanded.
void start(void)
Reset stop information.
bool stop(const Options &o)
Check whether engine must be stopped.
Gecode toplevel namespace