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