69#ifdef GECODE_HAS_EXPERIMENTAL
97 for (
unsigned int i=0U; i<n; i++) {
107 unsigned int n_exhausted = 0;
113 for (
unsigned int i=0U; i<
cur; i++)
122 cur++; n_exhausted++;
161 for (
unsigned int i=0U; i<
n_slaves; i++)
170 throw NoBest(
"PBS::constrain");
171 for (
unsigned int i=0U; i<
n_slaves; i++)
177 for (
unsigned int i=0U; i<
n_slaves; i++)
void rfree(void *p)
Free memory block starting at p.
Search engine implementation interface
Engine(void)
Construct a meta engine without worker control.
virtual void constrain(const Space &b)
Constrain future solutions to be better than b (raises exception).
virtual bool limited(void) const
Whether the engine stopped at a local limit (such as a CABS width limit) and cannot continue.
virtual Statistics statistics(void) const =0
Return statistics.
virtual Space * next(void)=0
Return next solution (nullptr, if none exists or search has been stopped).
virtual bool stopped(void) const =0
Check whether engine has been stopped.
NoBest(const char *l)
Initialize with location l.
bool incomplete
Whether a slave stopped at a local limit.
SharedStopInfo ssi
Shared slave information.
virtual ~PBS(void)
Destructor.
unsigned int n_slaves
Number of slave engines.
bool slave_stop
Whether a slave has been stopped.
unsigned int slice
Size of a slice.
virtual Space * next(void)
Return next solution (nullptr, if none exists or search has been stopped).
Statistics stat
Master statistics.
virtual bool stopped(void) const
Check whether engine has been stopped.
virtual Statistics statistics(void) const
Return statistics.
unsigned int cur
Current slave to run.
virtual void constrain(const Space &b)
Constrain future solutions to be better than b.
PBS(Engine **slaves, Stop **stops, unsigned int n, const Statistics &stat, const Search::Options &opt)
Initialize.
Stop object used for controlling slaves in a portfolio.
void share(SharedStopInfo *ssi)
Initialize shared stop information.
PortfolioStop(Stop *so, Stop *po=nullptr)
Initialize with slave stop so and portfolio stop po.
unsigned long long int l
The current failure limit, incremented for each slice.
bool done
Whether search stopped because the slice is done.
Runnable slave of a portfolio master.
bool stopped(void) const
Check whether slave has been stopped.
Space * next(void)
Return next solution.
Engine * slave
The slave engine.
Slave(void)
Default constructor.
void constrain(const Space &b)
Constrain with better solution b.
bool limited(void) const
Check whether slave stopped at a local limit.
void init(Engine *s, Stop *so)
Initialize with slave s and its stop object so.
Statistics statistics(void) const
Return statistics of slave.
~Slave(void)
Delete slave.
Base-class for Stop-object.
Stop(void)
Default constructor.
Heap heap
The single global heap.
Gecode toplevel namespace