34#ifndef __GECODE_SEARCH_PAR_BAB_HH__
35#define __GECODE_SEARCH_PAR_BAB_HH__
39namespace Gecode {
namespace Search {
namespace Par {
42 template<
class Tracer>
89 virtual void run(
void);
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
No-goods recorded from restarts.
Parallel branch-and-bound search worker
void find(void)
Try to find some work.
Space * best
Best solution found so far.
int mark
Number of entries not yet constrained to be better.
void better(Space *b)
Accept better solution b.
BAB & engine(void) const
Provide access to engine.
virtual ~Worker(void)
Destructor.
virtual void run(void)
Start execution of worker.
Parallel branch-and-bound engine
Worker ** _worker
Array of worker references.
void solution(Space *s)
Report solution s.
Worker * worker(unsigned int i) const
Provide access to worker i.
virtual void constrain(const Space &b)
Constrain future solutions to be better than b.
virtual void reset(Space *s)
Reset engine to restart at space s.
virtual ~BAB(void)
Destructor.
Space * best
Best solution so far.
BAB(Space *s, const Options &o)
Initialize for space s with options o.
virtual Statistics statistics(void) const
Return statistics.
virtual NoGoods & nogoods(void)
Constrain Return no-goods.
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.
Parallel depth-first search engine
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.
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