38 #ifndef GECODE_GIST_SPACENODE_HH
39 #define GECODE_GIST_SPACENODE_HH
44 namespace Gecode {
namespace Gist {
57 static const unsigned int FIRSTBIT = 24;
58 static const unsigned int STATUSMASK = 7<<20;
59 static const unsigned int MAXDISTANCE = (1<<20)-1;
60 static const unsigned int DISTANCEMASK = (1<<20)-1;
78 : solutions(0), failures(0), choices(0), undetermined(1), maxDepth(0) {}
119 void setFlag(
int flag,
bool value);
135 void setHasOpenChildren(
bool b);
137 void setHasFailedChildren(
bool b);
139 void setHasSolvedChildren(
bool b);
147 bool hadFailures,
bool hadSolutions);
Node representing stop point.
bool hasWorkingSpace(void)
Return whether the node has a working space.
int solutions
Number of solutions.
SpaceNode * s
The currently best node found, or NULL.
Static reference to the currently best space.
Node representing a branch.
BestNode(SpaceNode *s0)
Constructor.
unsigned int nstatus
Status of the node.
int choices
Number of choice nodes.
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.
Node representing failure.
Base class for nodes of the search tree.
SpaceNodeFlags
Flags for SpaceNodes.
static const int LASTBIT
Last bit used for SpaceNode flags.
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.
Statistics for execution of status
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.
NodeStatus getStatus(void) const
Return current status of the node.
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
const unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
Node representing a solution.
int undetermined
Number of open, undetermined nodes.
unsigned int getDistance(void) const
Return distance from copy.
bool hasOpenChildren(void)
Return whether the subtree of this node has any open children.
void setFlag(int flag, bool value)
Set status flag.
int getNoOfOpenChildren(const NodeAllocator &na)
Return number of open children.
Choice for performing commit
int maxDepth
Maximum depth of the tree.
void dispose(void)
Free allocated memory.
const unsigned int c_d
Create a clone after every c_d commits (commit distance)
int getNumberOfChildNodes(NodeAllocator &na, BestNode *curBest, Statistics &stats, int c_d, int a_d)
Compute and return the number of children.
A node of a search tree of Gecode spaces.
Space * copy
A copy used for recomputation, or NULL.
void setNoOfOpenChildren(int n)
Set number of open children to n.
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.
bool isOpen(void)
Return whether this node still has open children.
SpaceNode(int p)
Construct node with parent p.
int failures
Number of failures.
Statistics about the search tree
bool hasSolvedChildren(void)
Return whether the subtree of this node has any solved children.
Statistics(void)
Constructor.
void purge(const NodeAllocator &na)
Clear working space and copy (if present and this is not the root).
Node representing ignored stop point.