40 : _startNode(theNode), _node(theNode),
41 _alternative(theNode->getAlternative(na0)),
67 return _node != _startNode && !_node->isRoot();
73 _node =
static_cast<Node*
>(_node->getParent(
na));
74 if (_node->isRoot()) {
97 _node = _node->getChild(
na,0);
103 return (!_node->isRoot()) && (_node != _startNode) &&
104 (_alternative < _node->getParent(
na)->getNumberOfChildren() - 1);
111 static_cast<Node*
>(_node->getParent(
na)->getChild(
na,++_alternative));
117 return (!onlyDirty || n->
isDirty()) &&
178 NextSolCursor::notOnSol(
void) {
184 return notOnSol() && !
node()->isRoot();
190 &&
node()->hasSolvedChildren()
208 return notOnSol() && !
node()->isRoot() &&
210 node()->getParent(
na)->getNumberOfChildren() - 1);
257 int c_d,
int a_d,
bool clear,
260 _c_d(c_d), _a_d(a_d), _clear(clear) {}
266 if (!
na.hasLabel(n)) {
272 _na.setLabel(n,QString(l.c_str()));
Static reference to the currently best space.
BranchLabelCursor(VisualNode *theNode, BestNode *curBest, int c_d, int a_d, bool clear, VisualNode::NodeAllocator &na)
Constructor.
void processCurrentNode(void)
void processCurrentNode(void)
Dispose node.
DisposeCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na)
Constructor.
void processCurrentNode(void)
Process node.
HideFailedCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na, bool onlyDirtyNodes)
Constructor.
bool mayMoveDownwards(void)
Test if the cursor may move to the first child node.
void processCurrentNode(void)
Do nothing.
bool mayMoveUpwards(void)
Test if the cursor may move to the parent node.
NextSolCursor(VisualNode *theNode, bool backwards, 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.
bool mayMoveSidewards(void)
Test if cursor may move to the first sibling.
void moveDownwards(void)
Move cursor to the first child node.
const Node::NodeAllocator & na
The node allocator.
void moveDownwards(void)
Move cursor to the first child node.
bool mayMoveUpwards(void)
Test if the cursor may move to the parent node.
NodeCursor(Node *theNode, const typename Node::NodeAllocator &na)
Construct cursor, initially set to theNode.
Node * node(void)
Return current node.
unsigned int alternative(void)
Return current alternative.
Node * startNode(void)
Return start node.
void moveSidewards(void)
Move cursor to the first sibling.
bool mayMoveSidewards(void)
Test if cursor may move to the first sibling.
void moveUpwards(void)
Move cursor to the parent node.
bool mayMoveDownwards(void)
Test if cursor may move to the first child node.
Base class for nodes of the search tree.
NodeAllocatorBase< VisualNode > NodeAllocator
unsigned int getNumberOfChildren(void) const
Return the number of children.
int getParent(void) const
Return the parent.
int getChild(int n) const
Return index of child no n.
const Choice * getChoice(void)
Return choice of this node.
bool hasSolvedChildren(void)
Return whether the subtree of this node has any solved children.
NodeStatus getStatus(void) const
Return current status of the node.
void purge(const NodeAllocator &na)
Clear working space and copy (if present and this is not the root).
int getNoOfOpenChildren(const NodeAllocator &na)
Return number of open children.
int choice
Number of choice nodes.
void moveDownwards(void)
Move cursor to the first child node.
int failed
Number of failed nodes.
StatCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na)
Constructor.
int depth
Depth of the search tree.
void processCurrentNode(void)
Collect statistics.
int open
Number of open nodes.
int solved
Number of solved nodes.
void moveUpwards(void)
Move cursor to the parent node.
UnhideAllCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na)
Constructor.
void processCurrentNode(void)
Process node.
void processCurrentNode(void)
Process node.
UnstopAllCursor(VisualNode *theNode, const VisualNode::NodeAllocator &na)
Constructor.
Node class that supports visual layout
bool isHidden(void)
Return if node is hidden.
void setHidden(bool h)
Set hidden state to h.
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.
void dirtyUp(const NodeAllocator &na)
Mark all nodes up the path to the parent as dirty.
bool isDirty(void)
Return whether node is marked as dirty.
void setChildrenLayoutDone(bool d)
Mark node whether the layout of the node's children has been completed.
void setStop(bool h)
Set stop state to h.
The Gecode Interactive Search Tool.
@ UNDETERMINED
Node that has not been explored yet.
@ FAILED
Node representing failure.
@ STOP
Node representing stop point.
@ SOLVED
Node representing a solution.
@ BRANCH
Node representing a branch.
Gecode toplevel namespace