34namespace 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);
99 BestNode* curBest,
int c_d,
int a_d) {
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)
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int p
Number of positive literals for node type.
Choice for performing commit
Static reference to the currently best space.
SpaceNode * s
The currently best node found, or NULL.
bool bab(void) const
Return branch-and-bound flag.
Base class for nodes of the search tree.
int getParent(void) const
Return the parent.
bool isRoot(void) const
Check if this node is the root of a 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.
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.
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 acquireSpace(NodeAllocator &na, BestNode *curBest, int c_d, int a_d)
Acquire working space, either from parent or by recomputation.
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.
Space * clone(CloneStatistics &stat=unused_clone) const
Clone space.
NodeStatus
Status of nodes in the search tree.
@ UNDETERMINED
Node that has not been explored yet.
@ SOLVED
Node representing a solution.
void * unmark(void *p)
Return unmarked pointer for a marked pointer p.
bool marked(void *p)
Check whether p is marked.
Gecode toplevel namespace
#define GECODE_NEVER
Assert that this command is never executed.