Meta engine using a portfolio of search engines. More...
#include <gecode/search.hh>
Public Member Functions | |
| PBS (T *s, const Search::Options &o=Search::Options::def) | |
| Initialize with engines running copies of s with options o. | |
| PBS (T *s, SEBs &sebs, const Search::Options &o=Search::Options::def) | |
| void | constrain (const T &b) |
| Constrain future portfolio solutions to be better than b. | |
| Public Member Functions inherited from Gecode::Search::Base< T > | |
| virtual T * | next (void) |
| Return next solution (nullptr, 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 | ~Base (void) |
| Destructor. | |
Static Public Attributes | |
| static const bool | best = E<T>::best |
| Whether engine does best solution search. | |
Protected Member Functions | |
| void | build (T *s, SEBs &sebs, const Search::Options &o) |
| The actual build function. | |
| Protected Member Functions inherited from Gecode::Search::Base< T > | |
| Base (Engine *e=nullptr) | |
| Constructor. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from Gecode::HeapAllocated | |
| static void * | operator new (size_t s) |
| Memory management. | |
| static void | operator delete (void *p) |
| Free memory allocated from heap. | |
| Protected Attributes inherited from Gecode::Search::Base< T > | |
| Engine * | e |
| The actual search engine. | |
Detailed Description
class Gecode::PBS< T, E >
Meta engine using a portfolio of search engines.
The engine will run a portfolio with a number of assets as defined by the options o. The engine supports parallel execution of assets by using the number of threads as defined by the options. An external worker control in o is supported only for a single homogeneous asset. Multiple controlled assets require explicit engine builders, each with its own control and immutable worker capacity. PBS does not allocate workers or adjust those controls.
When the assets are restart-based engines, the portfolio takes ownership of the cutoff in o and the assets share its sequence: each restart of an asset takes the next value of the sequence.
The class T can implement member functions
and
When the assets are created, these functions are executed. For more details, consult "Modeling and Programming with Gecode".
Constructor & Destructor Documentation
◆ PBS() [1/2]
| Gecode::PBS< T, E >::PBS | ( | T * | s, |
| const Search::Options & | o = Search::Options::def ) |
◆ PBS() [2/2]
|
inline |
Initialize with engine builders sebs
The stop object of o is checked for each builder's engine with the statistics of that engine, as is the stop object of the builder.
The outer options must not contain a worker control. Each builder can instead supply a distinct control for its underlying engine. In parallel PBS, the outer thread count limits how many builders run, in array order; each builder's options set its own engine's thread count.
With experimental search, AStar and CABS builders can be used together with BAB builders.
Member Function Documentation
◆ build()
|
protected |
◆ constrain()
|
inline |
Member Data Documentation
◆ best
|
static |
The documentation for this class was generated from the following files:
