42 #ifndef __GECODE_SEARCH_SEQUENTIAL_BAB_HH__ 43 #define __GECODE_SEARCH_SEQUENTIAL_BAB_HH__ 50 namespace Gecode {
namespace Search {
namespace Sequential {
86 : opt(o), path(opt.
nogoods_limit), d(0), mark(0), best(NULL) {
120 while (cur == NULL) {
129 switch (cur->
status(*
this)) {
144 return best->
clone();
148 if ((d == 0) || (d >= opt.
c_d)) {
unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
Space must be branched (at least one brancher left)
unsigned int c_d
Create a clone after every c_d commits (commit distance)
const Choice * push(Worker &stat, Space *s, Space *c)
Push space c (a clone of s or NULL)
Depth-first path (stack of edges) supporting recomputation.
unsigned long int fail
Number of failed nodes in search tree.
bool empty(void) const
Test whether path is empty.
Space * clone(bool share_data=true, bool share_info=true, CloneStatistics &stat=unused_clone) const
Clone space.
BAB(Space *s, const Options &o)
Initialize with space s and search options o.
Implementation of depth-first branch-and-bound search engine.
NoGoods & nogoods(void)
Return no-goods.
void start(void)
Reset stop information.
Gecode::FloatVal c(-8, 8)
Space * next(void)
Search for next better solution
Space * recompute(unsigned int &d, unsigned int a_d, Worker &s)
Recompute space according to path.
void commit(const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
Commit choice c for alternative a.
virtual void constrain(const Space &best)
Constrain function for best solution search.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
bool clone
Whether engines create a clone when being initialized.
void constrain(const Space &b)
Constrain future solutions to be better than b.
void reset(void)
Reset stack.
Choice for performing commit
No-goods recorded from restarts.
void next(void)
Generate path for next node.
int entries(void) const
Return number of entries on stack.
SpaceStatus status(StatusStatistics &stat=unused_status)
Query space status.
Space * snapshot(Space *s, const Options &o, bool share=true)
Clone space s dependening on options o.
Gecode toplevel namespace
unsigned long int node
Number of nodes expanded.
const unsigned int nogoods_limit
Depth limit for no-good generation during search.
const Choice * choice(void)
Create new choice for current brancher.
Statistics statistics(void) const
Return statistics.
#define GECODE_NEVER
Assert that this command is never executed.
bool stop(const Options &o)
Check whether engine must be stopped.
Space is solved (no brancher left)