38 namespace Gecode {
namespace Gist {
44 : _startNode(theNode), _node(theNode),
45 _alternative(theNode->getAlternative(na0)),
71 return _node != _startNode && !_node->isRoot();
77 _node =
static_cast<Node*
>(_node->getParent(na));
78 if (_node->isRoot()) {
81 Node*
p =
static_cast<Node*
>(_node->getParent(na));
94 return _node->getNumberOfChildren() > 0;
101 _node = _node->getChild(na,0);
107 return (!_node->isRoot()) && (_node != _startNode) &&
108 (_alternative < _node->getParent(na)->getNumberOfChildren() - 1);
115 static_cast<Node*
>(_node->getParent(na)->getChild(na,++_alternative));
121 return (!onlyDirty || n->
isDirty()) &&
182 NextSolCursor::notOnSol(
void) {
232 curDepth(0), depth(0), failed(0), solved(0), choice(0), open(0) {}
261 int c_d,
int a_d,
bool clear,
264 _c_d(c_d), _a_d(a_d), _clear(clear) {}
276 _na.setLabel(n,QString(l.c_str()));
Node representing stop point.
bool mayMoveDownwards(void)
Test if cursor may move to the first child node.
bool mayMoveDownwards(void)
Test if the cursor may move to the first child node.
BranchLabelCursor(VisualNode *theNode, BestNode *curBest, int c_d, int a_d, bool clear, VisualNode::NodeAllocator &na)
Constructor.
void dispose(void)
Free allocated memory.
Static reference to the currently best space.
const FloatNum max
Largest allowed float value.
Node representing a branch.
bool isDirty(void)
Return whether node is marked as dirty.
void moveUpwards(void)
Move cursor to the parent node.
bool isHidden(void)
Return if node is hidden.
NodeAllocatorBase< VisualNode > NodeAllocator
void setChildrenLayoutDone(bool d)
Mark node whether the layout of the node's children has been completed.
void moveDownwards(void)
Move cursor to the first child node.
int depth
Depth of the search tree.
void setStop(bool h)
Set stop state to h.
bool mayMoveSidewards(void)
Test if cursor may move to the first sibling.
Node representing failure.
void moveSidewards(void)
Move cursor to the first sibling.
Base class for nodes of the search tree.
unsigned int getNumberOfChildren(void) const
Return the number of children.
DisposeCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na)
Constructor.
void setHidden(bool h)
Set hidden state to h.
void processCurrentNode(void)
Process node.
void processCurrentNode(void)
Process node.
Node that has not been explored yet.
std::string getBranchLabel(NodeAllocator &na, VisualNode *p, const Choice *c, BestNode *curBest, int c_d, int a_d, int alt)
Return string that describes the branch.
const Choice * getChoice(void)
Return choice of this node.
int getParent(void) const
Return the parent.
NodeStatus getStatus(void) const
Return current status of the node.
int p
Number of positive literals for node type.
bool isRoot(void) const
Check if this node is the root of a tree.
Gecode::IntArgs i(4, 1, 2, 3, 4)
bool mayMoveUpwards(void)
Test if the cursor may move to the parent node.
int n
Number of negative literals for node type.
HideFailedCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na, bool onlyDirtyNodes)
Constructor.
void moveDownwards(void)
Move cursor to the first child node.
const VisualNode::NodeAllocator & na
The node allocator.
void moveUpwards(void)
Move cursor to the parent node.
const unsigned int a_d
Create a clone during recomputation if distance is greater than a_d (adaptive distance) ...
Node representing a solution.
void processCurrentNode(void)
Process node.
void moveDownwards(void)
Move cursor to the first child node.
void processCurrentNode(void)
Dispose node.
Node * startNode(void)
Return start node.
StatCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na)
Constructor.
UnhideAllCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na)
Constructor.
void moveSidewards(void)
Move cursor to the first sibling.
bool mayMoveDownwards(void)
Test if cursor may move to the first child node.
int getNoOfOpenChildren(const NodeAllocator &na)
Return number of open children.
int open
Number of open nodes.
A cursor that can be run over a tree.
void dirtyUp(const NodeAllocator &na)
Mark all nodes up the path to the parent as dirty.
Node class that supports visual layout
int choice
Number of choice nodes.
const unsigned int c_d
Create a clone after every c_d commits (commit distance)
int failed
Number of failed nodes.
bool mayMoveSidewards(void)
Test if cursor may move to the first sibling.
void processCurrentNode(void)
Do nothing.
Node * node(void)
Return current node.
UnstopAllCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na)
Constructor.
NodeCursor(Node *theNode, const typename Node::NodeAllocator &na)
Construct cursor, initially set to theNode.
Gecode toplevel namespace
int getChild(int n) const
Return index of child no n.
unsigned int alternative(void)
Return current alternative.
void processCurrentNode(void)
Collect statistics.
bool hasLabel(T *n) const
Return whether node n has a label.
bool mayMoveUpwards(void)
Test if the cursor may move to the parent node.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
void processCurrentNode(void)
int solved
Number of solved nodes.
bool hasSolvedChildren(void)
Return whether the subtree of this node has any solved children.
NextSolCursor(VisualNode *theNode, bool backwards, const VisualNode::NodeAllocator &na)
Constructor.
void purge(const NodeAllocator &na)
Clear working space and copy (if present and this is not the root).