Gecode::Search::Par::PBS< Collect > Class Template Reference
Parallel portfolio engine implementation. More...
#include <pbs.hh>
Public Member Functions | |
PBS (Engine **s, Stop **so, unsigned int n, const Statistics &stat) | |
Initialize. | |
virtual Space * | next (void) |
Return next solution (NULL, if none exists or search has been stopped). | |
virtual Statistics | statistics (void) const |
Return statistics. | |
virtual bool | stopped (void) const |
Check whether engine has been stopped. | |
virtual void | constrain (const Space &b) |
Constrain future solutions to be better than b. | |
virtual | ~PBS (void) |
Destructor. | |
Protected Member Functions | |
bool | report (Slave< Collect > *slave, Space *s) |
Process report from slave, return false if solution was ignored. | |
Protected Attributes | |
Statistics | stat |
Master statistics. | |
Slave< Collect > ** | slaves |
Slave engines. | |
unsigned int | n_slaves |
Number of slave engines. | |
unsigned int | n_active |
Number of active slave engines. | |
bool | slave_stop |
Whether a slave has been stopped. | |
volatile bool | tostop |
Shared stop flag. | |
Collect | solutions |
Collect solutions in this. | |
Support::Mutex | m |
Mutex for synchronization. | |
unsigned int | n_busy |
Number of busy slaves. | |
Support::Event | idle |
Signal that number of busy slaves becomes zero. |
Detailed Description
template<class Collect>
class Gecode::Search::Par::PBS< Collect >
Parallel portfolio engine implementation.
Definition at line 138 of file pbs.hh.
Constructor & Destructor Documentation
template<class Collect >
Gecode::Search::Par::PBS< Collect >::PBS | ( | Engine ** | s, | |
Stop ** | so, | |||
unsigned int | n, | |||
const Statistics & | stat | |||
) | [inline] |
Initialize.
The key invariant of the engine is as follows:
template<class Collect >
Gecode::Search::Par::PBS< Collect >::~PBS | ( | void | ) | [inline, virtual] |
Member Function Documentation
template<class Collect>
bool Gecode::Search::Par::PBS< Collect >::report | ( | Slave< Collect > * | slave, | |
Space * | s | |||
) | [inline, protected] |
template<class Collect >
Space * Gecode::Search::Par::PBS< Collect >::next | ( | void | ) | [inline, virtual] |
Return next solution (NULL, if none exists or search has been stopped).
Reimplemented from Gecode::Search::Par::Engine< Tracer >.
template<class Collect >
Statistics Gecode::Search::Par::PBS< Collect >::statistics | ( | void | ) | const [inline, virtual] |
template<class Collect >
bool Gecode::Search::Par::PBS< Collect >::stopped | ( | void | ) | const [inline, virtual] |
Check whether engine has been stopped.
Reimplemented from Gecode::Search::Par::Engine< Tracer >.
template<class Collect >
void Gecode::Search::Par::PBS< Collect >::constrain | ( | const Space & | b | ) | [inline, virtual] |
Constrain future solutions to be better than b.
Reimplemented from Gecode::Search::Engine.
Member Data Documentation
template<class Collect>
Statistics Gecode::Search::Par::PBS< Collect >::stat [protected] |
template<class Collect>
Slave<Collect>** Gecode::Search::Par::PBS< Collect >::slaves [protected] |
template<class Collect>
unsigned int Gecode::Search::Par::PBS< Collect >::n_slaves [protected] |
template<class Collect>
unsigned int Gecode::Search::Par::PBS< Collect >::n_active [protected] |
template<class Collect>
bool Gecode::Search::Par::PBS< Collect >::slave_stop [protected] |
template<class Collect>
volatile bool Gecode::Search::Par::PBS< Collect >::tostop [protected] |
template<class Collect>
Collect Gecode::Search::Par::PBS< Collect >::solutions [protected] |
Collect solutions in this.
Reimplemented from Gecode::Search::Par::Engine< Tracer >.
template<class Collect>
Support::Mutex Gecode::Search::Par::PBS< Collect >::m [protected] |
template<class Collect>
unsigned int Gecode::Search::Par::PBS< Collect >::n_busy [protected] |
Number of busy slaves.
Reimplemented from Gecode::Search::Par::Engine< Tracer >.
template<class Collect>
Support::Event Gecode::Search::Par::PBS< Collect >::idle [protected] |
The documentation for this class was generated from the following files: