36 namespace Gecode {
namespace Search {
namespace Seq {
58 return slave->statistics();
62 return slave->stopped();
81 slaves(
heap.alloc<
Slave>(n)), n_slaves(n), cur(0),
86 for (
unsigned int i=n;
i--; ) {
96 unsigned int n_exhausted = 0;
101 for (
unsigned int i=0;
i<
cur;
i++)
110 cur++; n_exhausted++;
154 throw NoBest(
"PBS::constrain");
virtual void constrain(const Space &b)
Constrain future solutions to be better than b.
PortfolioStop(Stop *so)
Initialize.
Search engine implementation interface
void rfree(void *p)
Free memory block starting at p.
~Slave(void)
Delete slave.
unsigned int n_slaves
Number of slave engines.
unsigned int slice
Size of a slice in a portfolio (in number of failures)
PBS(Engine **slaves, Stop **stops, unsigned int n, const Statistics &stat, const Search::Options &opt)
Initialize.
virtual bool stopped(void) const
Check whether engine has been stopped.
Stop object used for controling slaves in a portfolio.
unsigned int slice
Size of a slice.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
virtual Statistics statistics(void) const
Return statistics.
Runnable slave of a portfolio master.
virtual bool stop(const Statistics &s, const Options &o)
Return true if portfolio engine must be stopped.
void constrain(const Space &b)
Constrain with better solution b.
Statistics statistics(void) const
Return statistics of slave.
Space * next(void)
Return next solution.
SharedStopInfo ssi
Shared slave information.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
bool slave_stop
Whether a slave has been stopped.
virtual ~PBS(void)
Destructor.
void share(SharedStopInfo *ssi)
Intialize shared stop information.
Heap heap
The single global heap.
bool done
Whether search stopped because the slice is done.
void init(Engine *s, Stop *so)
Initialize with slave s and its stop object so.
Statistics stat
Master statistics.
Exception: Best solution search is not supported
Gecode toplevel namespace
unsigned int cur
Current slave to run.
Base-class for Stop-object.
unsigned long int l
The current failure limit, incremented for each slice.
virtual Space * next(void)
Return next solution (NULL, if none exists or search has been stopped)
bool stopped(void) const
Check whether slave has been stopped.
const unsigned int slice
Size of a slice in a portfolio and scale factor for restarts(in number of failures) ...