Gecode::Search::Par::PBS< Collect > Class Template Reference
Parallel portfolio engine implementation. More...
#include <pbs.hh>
List of all members.
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
| 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:
- n_busy is always zero outside the next() function.
- that entails, that locking is only needed insided next().
- the slaves 0..n_active-1 still might not have exausted their search space.
- the slaves n_active..n_slaves-1 have exhausted their search space.
Definition at line 155 of file pbs.hpp.
| Gecode::Search::Par::PBS< Collect >::~PBS | ( | void | ) | [inline, virtual] |
Destructor.
Definition at line 284 of file pbs.hpp.
Member Function Documentation
| bool Gecode::Search::Par::PBS< Collect >::report | ( | Slave< Collect > * | slave, | |
| Space * | s | |||
| ) | [inline, protected] |
Process report from slave, return false if solution was ignored.
Definition at line 170 of file pbs.hpp.
| 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 >.
Definition at line 210 of file pbs.hpp.
| Statistics Gecode::Search::Par::PBS< Collect >::statistics | ( | void | ) | const [inline, virtual] |
| bool Gecode::Search::Par::PBS< Collect >::stopped | ( | void | ) | const [inline, virtual] |
Check whether engine has been stopped.
Reimplemented from Gecode::Search::Par::Engine< Tracer >.
Definition at line 256 of file pbs.hpp.
| 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.
Definition at line 272 of file pbs.hpp.
Member Data Documentation
Statistics Gecode::Search::Par::PBS< Collect >::stat [protected] |
Master statistics.
Definition at line 142 of file pbs.hh.
Slave<Collect>** Gecode::Search::Par::PBS< Collect >::slaves [protected] |
Slave engines.
Definition at line 144 of file pbs.hh.
unsigned int Gecode::Search::Par::PBS< Collect >::n_slaves [protected] |
Number of slave engines.
Definition at line 146 of file pbs.hh.
unsigned int Gecode::Search::Par::PBS< Collect >::n_active [protected] |
Number of active slave engines.
Definition at line 148 of file pbs.hh.
bool Gecode::Search::Par::PBS< Collect >::slave_stop [protected] |
Whether a slave has been stopped.
Definition at line 150 of file pbs.hh.
volatile bool Gecode::Search::Par::PBS< Collect >::tostop [protected] |
Shared stop flag.
Definition at line 152 of file pbs.hh.
Collect Gecode::Search::Par::PBS< Collect >::solutions [protected] |
Collect solutions in this.
Reimplemented from Gecode::Search::Par::Engine< Tracer >.
Definition at line 154 of file pbs.hh.
Support::Mutex Gecode::Search::Par::PBS< Collect >::m [protected] |
Mutex for synchronization.
Definition at line 156 of file pbs.hh.
unsigned int Gecode::Search::Par::PBS< Collect >::n_busy [protected] |
Number of busy slaves.
Reimplemented from Gecode::Search::Par::Engine< Tracer >.
Definition at line 158 of file pbs.hh.
Support::Event Gecode::Search::Par::PBS< Collect >::idle [protected] |
Signal that number of busy slaves becomes zero.
Definition at line 160 of file pbs.hh.
The documentation for this class was generated from the following files:
- gecode/search/par/pbs.hh
- gecode/search/par/pbs.hpp
