38 namespace Gecode {
namespace Gist {
50 return (
nstatus & (1<<(flag-1))) != 0;
54 SpaceNode::setHasOpenChildren(
bool b) {
59 SpaceNode::setHasFailedChildren(
bool b) {
64 SpaceNode::setHasSolvedChildren(
bool b) {
94 :
Node(p), copy(NULL), nstatus(0) {
97 setHasSolvedChildren(
false);
98 setHasFailedChildren(
false);
117 assert(
copy != NULL);
138 return curBest != NULL && curBest->
s ==
this;
bool hasWorkingSpace(void)
Return whether the node has a working space.
bool marked(void *p)
Check whether p is marked.
SpaceNode * s
The currently best node found, or NULL.
Static reference to the currently best space.
Space * clone(bool share=true, CloneStatistics &stat=unused_clone) const
Clone space.
unsigned int nstatus
Status of the node.
Space * getSpace(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Return working space. Receiver must delete the space.
NodeStatus
Status of nodes in the search tree.
bool isCurrentBest(BestNode *curBest)
Return whether this node is the currently best solution.
Base class for nodes of the search tree.
unsigned int getNumberOfChildren(void) const
Return the number of children.
bool hasFailedChildren(void)
Return whether the subtree of this node has any failed children.
const Space * getWorkingSpace(void) const
Return working space (if present).
void setStatus(NodeStatus s)
Set status to s.
Node that has not been explored yet.
int getAlternative(const NodeAllocator &na) const
Return alternative number of this node.
void setDistance(unsigned int d)
Set distance from copy.
void acquireSpace(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Acquire working space, either from parent or by recomputation.
const Choice * getChoice(void)
Return choice of this node.
int getParent(void) const
Return the parent.
NodeStatus getStatus(void) const
Return current status of the node.
int p
Number of positive literals for node type.
bool isRoot(void) const
Check if this node is the root of a tree.
bool bab(void) const
Return branch-and-bound flag.
Gecode::IntArgs i(4, 1, 2, 3, 4)
const unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
Node representing a solution.
unsigned int getDistance(void) const
Return distance from copy.
void * unmark(void *p)
Return unmarked pointer for a marked pointer p.
bool hasOpenChildren(void)
Return whether the subtree of this node has any open children.
void setFlag(int flag, bool value)
Set status flag.
Choice for performing commit
const unsigned int c_d
Create a clone after every c_d commits (commit distance)
A node of a search tree of Gecode spaces.
Space * copy
A copy used for recomputation, or NULL.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
bool hasCopy(void)
Return whether the node has a copy.
Gecode toplevel namespace
bool getFlag(int flag) const
Return status flag.
int getChild(int n) const
Return index of child no n.
bool isOpen(void)
Return whether this node still has open children.
SpaceNode(int p)
Construct node with parent p.
#define GECODE_NEVER
Assert that this command is never executed.
bool hasSolvedChildren(void)
Return whether the subtree of this node has any solved children.
void purge(const NodeAllocator &na)
Clear working space and copy (if present and this is not the root).