42 template<
class Tracer>
45 : tracer(o.tracer), opt(o), path(opt.nogoods_limit), d(0), mark(0),
57 cur = snapshot(s,opt);
61 template<
class Tracer>
85 while (cur ==
nullptr) {
88 cur = path.recompute(d,opt.a_d,*
this,best,mark,tracer);
95 if (tracer && (path.entries() > 0)) {
99 unsigned int nid = tracer.
nid();
100 switch (cur->status(*
this)) {
104 tracer.wid(), nid, *cur);
116 tracer.wid(), nid, *cur);
120 (void) cur->choice();
125 mark = path.entries();
127 return best->clone();
131 if ((d == 0) || (d >= opt.c_d)) {
138 const Choice* ch = path.push(*
this,cur,c,nid);
141 tracer.wid(), nid, *cur, ch);
155 template<
class Tracer>
161 template<
class Tracer>
164 if (best !=
nullptr) {
175 mark = path.entries();
178 template<
class Tracer>
197 template<
class Tracer>
203 template<
class Tracer>
Choice for performing commit
No-goods recorded from restarts.
void init(unsigned int wid, unsigned int nid, unsigned int a)
Initialize.
unsigned int nid(void) const
Return parent node id.
@ BAB
Engine is a BAB engine.
BAB(Space *s, const Options &o)
Initialize with space s and search options o.
NoGoods & nogoods(void)
Return no-goods.
Space * next(void)
Search for next better solution
void constrain(const Space &b)
Constrain future solutions to be better than b.
Statistics statistics(void) const
Return statistics.
Search tree edge for recomputation
unsigned int truealt(void) const
Return true number for alternatives (excluding lao optimization).
unsigned int nid(void) const
Return node identifier.
const Choice * choice(void) const
Return choice.
unsigned long long int fail
Number of failed nodes in search tree.
unsigned long long int node
Number of nodes expanded.
void start(void)
Reset stop information.
bool stop(const Options &o)
Check whether engine must be stopped.
void reset(void)
Reset information.
virtual void constrain(const Space &best)
Constrain function for best solution search.
Space * clone(void) const
Clone space.
SpaceStatus status(StatusStatistics &stat)
Query space status.
@ SS_BRANCH
Space must be branched (at least one brancher left)
@ SS_SOLVED
Space is solved (no brancher left)
@ SS_FAILED
Space is failed
Gecode toplevel namespace
#define GECODE_NEVER
Assert that this command is never executed.