Go to the documentation of this file.
34 #ifndef GECODE_GIST_SPACENODE_HH
35 #define GECODE_GIST_SPACENODE_HH
40 namespace Gecode {
namespace Gist {
53 static const unsigned int FIRSTBIT = 24;
54 static const unsigned int STATUSMASK = 7<<20;
55 static const unsigned int MAXDISTANCE = (1<<20)-1;
56 static const unsigned int DISTANCEMASK = (1<<20)-1;
115 void setFlag(
int flag,
bool value);
131 void setHasOpenChildren(
bool b);
133 void setHasFailedChildren(
bool b);
135 void setHasSolvedChildren(
bool b);
143 bool hadFailures,
bool hadSolutions);
@ UNDETERMINED
Node that has not been explored yet.
bool hasOpenChildren(void)
Return whether the subtree of this node has any open children.
int maxDepth
Maximum depth of the tree.
@ STOP
Node representing stop point.
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 dispose(void)
Free allocated memory.
void acquireSpace(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Acquire working space, either from parent or by recomputation.
int failures
Number of failures.
void purge(const NodeAllocator &na)
Clear working space and copy (if present and this is not the root).
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 getNoOfOpenChildren(const NodeAllocator &na)
Return number of 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.
void setNoOfOpenChildren(int n)
Set number of open children to n.
Statistics(void)
Constructor.
int getNumberOfChildNodes(NodeAllocator &na, BestNode *curBest, Statistics &stats, int c_d, int a_d)
Compute and return the number of children.
bool isCurrentBest(BestNode *curBest)
Return whether this node is the currently best solution.
int choices
Number of choice nodes.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Static reference to the currently best space.
int solutions
Number of solutions.
unsigned int nstatus
Status of the node.
@ BRANCH
Node representing a branch.
const Choice * getChoice(void)
Return choice of this node.
static const int LASTBIT
Last bit used for SpaceNode flags.
bool hasCopy(void)
Return whether the node has a copy.
A node of a search tree of Gecode spaces.
Statistics about the search tree
SpaceNodeFlags
Flags for SpaceNodes.
BestNode(SpaceNode *s0)
Constructor.
Statistics for execution of status
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.
@ UNSTOP
Node representing ignored stop point.
unsigned int getDistance(void) const
Return distance from copy.
int n
Number of negative literals for node type.
Choice for performing commit
@ FAILED
Node representing failure.
int p
Number of positive literals for node type.
int undetermined
Number of open, undetermined nodes.
void setFlag(int flag, bool value)
Set status flag.
@ SOLVED
Node representing a solution.