34#ifndef __GECODE_SEARCH_PAR_PBS_HH__
35#define __GECODE_SEARCH_PAR_PBS_HH__
39namespace Gecode {
namespace Search {
namespace Par {
47 volatile bool* tostop;
52 void share(
volatile bool* ts);
62 template<
class Collect>
66 template<
class Collect>
81 bool stopped(
void)
const;
83 void constrain(
const Space&
b);
85 virtual void run(
void);
97 static const bool best =
false;
105 bool empty(
void)
const;
129 bool empty(
void)
const;
137 template<
class Collect>
139 friend class Slave<Collect>;
175 virtual Space* next(
void);
179 virtual bool stopped(
void)
const;
181 virtual void constrain(
const Space&
b);
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
Space * get(Slave< CollectAll > *&r)
Return solution reported by r.
bool empty(void) const
Check whether there is any solution left.
Support::DynamicQueue< Space *, Heap > solutions
Queue of solutions.
bool add(Space *s, Slave< CollectAll > *r)
Add a solution a reported by r and always return true.
CollectAll(void)
Initialize.
~CollectAll(void)
Destructor.
static const bool best
Whether it collects best solutions.
bool constrain(const Space &b)
Dummy function.
CollectBest(void)
Initialize.
static const bool best
Whether it collects best solutions.
bool constrain(const Space &b)
Check whether b better and update accordingly.
bool empty(void) const
Check whether there is any solution left.
bool add(Space *s, Slave< CollectBest > *r)
Add a solution s by r and return whether is was better.
Space * get(Slave< CollectBest > *&r)
Return solution reported by r (only if a better one was found)
Slave< CollectBest > * reporter
Who has reported the best solution (NULL if solution has already been reported)
~CollectBest(void)
Destructor.
Space * b
Currently best solution.
Parallel depth-first search engine
Parallel portfolio engine implementation.
bool slave_stop
Whether a slave has been stopped.
Support::Event idle
Signal that number of busy slaves becomes zero.
Collect solutions
Collect solutions in this.
Support::Mutex m
Mutex for synchronization.
Slave< Collect > ** slaves
Slave engines.
unsigned int n_active
Number of active slave engines.
volatile bool tostop
Shared stop flag.
unsigned int n_slaves
Number of slave engines.
Statistics stat
Master statistics.
unsigned int n_busy
Number of busy slaves.
Stop object used for controling slaves in a portfolio.
void stop(bool s)
Signal whether search must be stopped.
bool stop(void) const
Whether search must be stopped.
Runnable slave of a portfolio master.
Engine * slave
The slave engine.
PBS< Collect > * master
The master engine.
Base-class for Stop-object.
Queue with arbitrary number of elements.
An event for synchronization.
A mutex for mutual exclausion among several threads.
An interface for objects that can be run by a thread.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
#define GECODE_SEARCH_EXPORT