42 template<
class Tracer>
46 template<
class Tracer>
50 : _space(s), _choice(c), _alt(a), _nid(
nid) {}
52 template<
class Tracer>
58 template<
class Tracer>
64 template<
class Tracer>
70 template<
class Tracer>
76 template<
class Tracer>
90 template<
class Tracer>
98 template<
class Tracer>
103 tracer.ei()->invalidate();
106 template<
class Tracer>
112 delete ds.pop().space();
115 tracer.ei()->invalidate();
119 template<
class Tracer>
125 template<
class Tracer>
131 template<
class Tracer>
137 delete ds.pop().space();
140 template<
class Tracer>
151 unsigned int a =
ds.top().alt();
152 const Choice* ch =
ds.top().choice();
153 unsigned int nid =
ds.top().nid();
155 cur =
ds.pop().space();
162 cur =
ds.top().space()->clone();
182 unsigned int nid =
tracer.nid();
184 tracer.wid(), nid, *s, ch);
215 switch (
cur->status(*
this)) {
237 unsigned int nid =
tracer.nid();
246 unsigned int d_a = (
d >= alt-1) ? alt-1 :
d;
248 Node sn(cc,ch,d_a-1,nid);
253 cur->commit(*ch,d_a);
262 goto check_discrepancy;
270 template<
class Tracer>
279 Space* c = snapshot(s,opt);
287 template<
class Tracer>
294 if (((s == NULL) &&
e.stopped()) || (++
d >
opt.d_l) ||
e.done())
300 }
else if (
root != NULL) {
307 template<
class Tracer>
313 template<
class Tracer>
316 return e.statistics();
320 template<
class Tracer>
337 template<
class Tracer>
344 template<
class Tracer>
Choice for performing commit
unsigned int alternatives(void) const
Return number of alternatives.
@ LDS
Engine is a LDS engine.
virtual bool stopped(void) const
Check whether engine has been stopped.
virtual T * next(void)
Return next solution (NULL, if none exists or search has been stopped)
virtual Statistics statistics(void) const
Return statistics.
Options opt
Search options.
void reset(Space *s)
Reset engine to restart at space s.
unsigned int d
Current discrepancy.
void constrain(const Space &b)
Constrain future solutions to be better than b (should never be called)
Space * root
Root node for problem.
Probe< Tracer > e
The probe engine.
virtual ~LDS(void)
Destructor.
LDS(Space *s, const Options &o)
Initialize for space s with options o.
Node in the search tree for LDS
Node(void)
Default constructor.
unsigned int nid(void) const
Return node identifier.
void next(void)
Set next alternative
const Choice * choice(void) const
Return choice.
unsigned int alt(void) const
Return next alternative.
Space * space(void) const
Return space.
Tracer tracer
Search tracer.
void init(Space *s)
Initialize with space s.
bool done(void) const
Test whether probing is done.
Support::DynamicStack< Node, Heap > ds
Stack storing current path in search tree
Probe(const Options &opt)
Initialize.
Space * next(const Options &o)
Search for next solution
Statistics statistics(void) const
Return statistics.
unsigned long int fail
Number of failed nodes in search tree.
unsigned 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 stack_depth(unsigned long int d)
Record stack depth d.
void reset(void)
Reset information.
Heap heap
The single global heap.
bool failed(void) const
Check whether space is failed.
const Choice * choice(void)
Create new choice for current brancher.
void commit(const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
Commit choice c for alternative a.
SpaceStatus status(StatusStatistics &stat=unused_status)
Query space status.
Space * clone(CloneStatistics &stat=unused_clone) const
Clone space.
@ 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.