34#ifndef GECODE_GIST_SPACENODE_HH
35#define GECODE_GIST_SPACENODE_HH
40namespace 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);
139 BestNode* curBest,
int c_d,
int a_d);
143 bool hadFailures,
bool hadSolutions);
149 BestNode* curBest,
int c_d,
int a_d);
158 BestNode* curBest,
int c_d,
int a_d);
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Choice for performing commit
Static reference to the currently best space.
BestNode(SpaceNode *s0)
Constructor.
SpaceNode * s
The currently best node found, or NULL.
Base class for nodes of the search tree.
A node of a search tree of Gecode spaces.
Space * copy
A copy used for recomputation, or NULL.
bool hasCopy(void)
Return whether the node has a copy.
bool hasWorkingSpace(void)
Return whether the node has a working space.
const Choice * getChoice(void)
Return choice of this node.
SpaceNodeFlags
Flags for SpaceNodes.
const Space * getWorkingSpace(void) const
Return working space (if present).
bool isCurrentBest(BestNode *curBest)
Return whether this node is the currently best solution.
unsigned int getDistance(void) const
Return distance from copy.
void setNoOfOpenChildren(int n)
Set number of open children to n.
static const int LASTBIT
Last bit used for SpaceNode flags.
unsigned int nstatus
Status of the node.
void setStatus(NodeStatus s)
Set status to s.
bool hasFailedChildren(void)
Return whether the subtree of this node has any failed children.
void setFlag(int flag, bool value)
Set status flag.
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 getNumberOfChildNodes(NodeAllocator &na, BestNode *curBest, Statistics &stats, int c_d, int a_d)
Compute and return the number of children.
bool hasSolvedChildren(void)
Return whether the subtree of this node has any solved children.
int getAlternative(const NodeAllocator &na) const
Return alternative number of this node.
bool isOpen(void)
Return whether this node still has open children.
NodeStatus getStatus(void) const
Return current status of the node.
Space * getSpace(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Return working space. Receiver must delete the space.
SpaceNode(int p)
Construct node with parent p.
void purge(const NodeAllocator &na)
Clear working space and copy (if present and this is not the root).
bool getFlag(int flag) const
Return status flag.
void setDistance(unsigned int d)
Set distance from copy.
bool hasOpenChildren(void)
Return whether the subtree of this node has any open children.
int getNoOfOpenChildren(const NodeAllocator &na)
Return number of open children.
Statistics about the search tree
int choices
Number of choice nodes.
int failures
Number of failures.
int solutions
Number of solutions.
int undetermined
Number of open, undetermined nodes.
Statistics(void)
Constructor.
int maxDepth
Maximum depth of the tree.
Statistics for execution of status
NodeStatus
Status of nodes in the search tree.
@ UNDETERMINED
Node that has not been explored yet.
@ UNSTOP
Node representing ignored stop point.
@ FAILED
Node representing failure.
@ STOP
Node representing stop point.
@ SOLVED
Node representing a solution.
@ BRANCH
Node representing a branch.
Gecode toplevel namespace