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>
111 while (!
ds.empty()) {
118 tracer.ei()->invalidate();
122 template<
class Tracer>
128 template<
class Tracer>
134 template<
class Tracer>
139 while (!
ds.empty()) {
146 template<
class Tracer>
151 if (
cur ==
nullptr) {
157 unsigned int a =
ds.top().alt();
158 const Choice* ch =
ds.top().choice();
159 unsigned int nid =
ds.top().nid();
161 cur =
ds.pop().space();
168 cur =
ds.top().space()->clone();
188 unsigned int nid =
tracer.nid();
190 tracer.wid(), nid, *s, ch);
221 switch (
cur->status(*
this)) {
243 unsigned int nid =
tracer.nid();
252 unsigned int d_a = (
d >= alt-1) ? alt-1 :
d;
254 Node sn(cc,ch,d_a-1,nid);
259 cur->commit(*ch,d_a);
268 goto check_discrepancy;
276 template<
class Tracer>
285 Space* c = snapshot(s,opt);
293 template<
class Tracer>
300 if (((s ==
nullptr) &&
e.stopped()) || (++
d >
opt.d_l) ||
e.done())
306 }
else if (
root !=
nullptr) {
313 template<
class Tracer>
319 template<
class Tracer>
322 return e.statistics();
326 template<
class Tracer>
346 template<
class Tracer>
353 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 (nullptr, 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 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 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.
Space * clone(void) const
Clone space.
const Choice * choice(void)
Create new choice for current brancher.
SpaceStatus status(StatusStatistics &stat)
Query space status.
void commit(const Choice &c, unsigned int a)
Commit choice c for alternative a.
@ 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.