Go to the documentation of this file.
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;
177 for (
int i=
static_cast<int>(
p->getNumberOfChildren());
i--;)
178 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.
Space * clone(bool share_data=true, bool share_info=true, CloneStatistics &stat=unused_clone) const
Clone space.
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.
Gecode::IntArgs i(4, 1, 2, 3, 4)
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
bool isOpen(void)
Return whether this node still has open children.
int getAlternative(const NodeAllocator &na) const
Return alternative number of this node.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
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.
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
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.