Gecode::Gist::SpaceNode Class Reference
A node of a search tree of Gecode spaces. More...
#include <spacenode.hh>
Public Member Functions | |
| SpaceNode (void) | |
| Construct node. | |
| SpaceNode (Space *root) | |
| Construct root node from Space root and branch-and-bound object better. | |
| ~SpaceNode (void) | |
| Destructor. | |
| Space * | getSpace (BestNode *curBest, int c_d, int a_d) |
| Return working space. Receiver must delete the space. | |
| const Space * | getWorkingSpace (void) const |
| Return working space (if present). | |
| void | purge (void) |
| Clear working space and copy (if present and this is not the root). | |
| bool | isCurrentBest (BestNode *curBest) |
| Return whether this node is the currently best solution. | |
| int | getNumberOfChildNodes (NodeAllocator &na, BestNode *curBest, Statistics &stats, int c_d, int a_d) |
| Compute and return the number of children. | |
| NodeStatus | getStatus (void) const |
| Return current status of the node. | |
| bool | isStepNode (void) |
| Return whether this node represents a propagation step. | |
| void | setSpecialDesc (const SpecialDesc *d) |
| Change the SpecialDesc to d. | |
| void | setStepDesc (StepDesc *d) |
| Change the StepDesc to d. | |
| StepDesc * | getStepDesc (void) |
| Return the StepDesc. | |
| bool | isOpen (void) |
| Return whether this node still has open children. | |
| bool | hasFailedChildren (void) |
| Return whether the subtree of this node has any failed children. | |
| bool | hasSolvedChildren (void) |
| Return whether the subtree of this node has any solved children. | |
| bool | hasOpenChildren (void) |
| Return whether the subtree of this node has any open children. | |
| int | getNoOfOpenChildren (void) |
| Return number of open children. | |
| void | setNoOfOpenChildren (int n) |
| Set number of open children to n. | |
| bool | hasCopy (void) |
| Return whether the node has a copy. | |
| bool | hasWorkingSpace (void) |
| Return whether the node has a working space. | |
| SpaceNode * | getParent (void) |
| Return the parent. | |
| SpaceNode * | getChild (int i) |
| Return child i. | |
| int | getAlternative (void) |
| Return alternative number of this node. | |
Protected Types | |
| enum | SpaceNodeFlags { HASOPENCHILDREN = FIRSTBIT, HASFAILEDCHILDREN, HASSOLVEDCHILDREN } |
| Flags for SpaceNodes. More... | |
Protected Member Functions | |
| void | acquireSpace (BestNode *curBest, int c_d, int a_d) |
| Acquire working space, either from parent or by recomputation. | |
Protected Attributes | |
| Space * | copy |
| A copy used for recomputation, or NULL. | |
| Space * | workingSpace |
| Working space used for computing the status. | |
| union { | |
| const BranchingDesc * branch | |
| Branching description. | |
| const SpecialDesc * special | |
| Special branching description. | |
| StepDesc * step | |
| Step description. | |
| } | desc |
| unsigned int | nstatus |
| Status of the node. | |
Static Protected Attributes | |
| static const int | LASTBIT = HASSOLVEDCHILDREN |
| Last bit used for SpaceNode flags. | |
Detailed Description
A node of a search tree of Gecode spaces.Definition at line 108 of file spacenode.hh.
Member Enumeration Documentation
enum Gecode::Gist::SpaceNode::SpaceNodeFlags [protected] |
Constructor & Destructor Documentation
| Gecode::Gist::SpaceNode::SpaceNode | ( | void | ) | [inline] |
| Gecode::Gist::SpaceNode::SpaceNode | ( | Space * | root | ) |
Construct root node from Space root and branch-and-bound object better.
Definition at line 320 of file spacenode.cpp.
| Gecode::Gist::SpaceNode::~SpaceNode | ( | void | ) |
Member Function Documentation
| void Gecode::Gist::SpaceNode::acquireSpace | ( | BestNode * | curBest, | |
| int | c_d, | |||
| int | a_d | |||
| ) | [protected] |
Acquire working space, either from parent or by recomputation.
Definition at line 205 of file spacenode.cpp.
| const Space * Gecode::Gist::SpaceNode::getWorkingSpace | ( | void | ) | const [inline] |
| void Gecode::Gist::SpaceNode::purge | ( | void | ) | [inline] |
Clear working space and copy (if present and this is not the root).
Definition at line 108 of file spacenode.hpp.
| bool Gecode::Gist::SpaceNode::isCurrentBest | ( | BestNode * | curBest | ) | [inline] |
Return whether this node is the currently best solution.
Definition at line 122 of file spacenode.hpp.
| int Gecode::Gist::SpaceNode::getNumberOfChildNodes | ( | NodeAllocator & | na, | |
| BestNode * | curBest, | |||
| Statistics & | stats, | |||
| int | c_d, | |||
| int | a_d | |||
| ) |
Compute and return the number of children.
On a node whose status is already determined, this function just returns the number of children. On an undetermined node, it first acquires a Space (possibly through recomputation), and then asks for its status. If the space is solved or failed, the node's status will be set accordingly, and 0 will be returned. Otherwise, the status is SS_BRANCH, and as many new children will be created as the branch has alternatives, and the number returned.
Definition at line 353 of file spacenode.cpp.
| NodeStatus Gecode::Gist::SpaceNode::getStatus | ( | void | ) | const [inline] |
| bool Gecode::Gist::SpaceNode::isStepNode | ( | void | ) | [inline] |
Return whether this node represents a propagation step.
Definition at line 137 of file spacenode.hpp.
| void Gecode::Gist::SpaceNode::setSpecialDesc | ( | const SpecialDesc * | d | ) | [inline] |
| void Gecode::Gist::SpaceNode::setStepDesc | ( | StepDesc * | d | ) | [inline] |
| StepDesc * Gecode::Gist::SpaceNode::getStepDesc | ( | void | ) | [inline] |
| bool Gecode::Gist::SpaceNode::isOpen | ( | void | ) | [inline] |
| bool Gecode::Gist::SpaceNode::hasFailedChildren | ( | void | ) | [inline] |
Return whether the subtree of this node has any failed children.
Definition at line 153 of file spacenode.hpp.
| bool Gecode::Gist::SpaceNode::hasSolvedChildren | ( | void | ) | [inline] |
Return whether the subtree of this node has any solved children.
Definition at line 158 of file spacenode.hpp.
| bool Gecode::Gist::SpaceNode::hasOpenChildren | ( | void | ) | [inline] |
Return whether the subtree of this node has any open children.
Definition at line 163 of file spacenode.hpp.
| int Gecode::Gist::SpaceNode::getNoOfOpenChildren | ( | void | ) |
| void Gecode::Gist::SpaceNode::setNoOfOpenChildren | ( | int | n | ) |
Set number of open children to n.
| bool Gecode::Gist::SpaceNode::hasCopy | ( | void | ) | [inline] |
| bool Gecode::Gist::SpaceNode::hasWorkingSpace | ( | void | ) | [inline] |
| SpaceNode * Gecode::Gist::SpaceNode::getParent | ( | void | ) | [inline] |
Return the parent.
Reimplemented from Gecode::Gist::Node.
Reimplemented in Gecode::Gist::VisualNode.
Definition at line 41 of file spacenode.hpp.
| SpaceNode * Gecode::Gist::SpaceNode::getChild | ( | int | i | ) | [inline] |
Return child i.
Reimplemented in Gecode::Gist::VisualNode.
Definition at line 46 of file spacenode.hpp.
| int Gecode::Gist::SpaceNode::getAlternative | ( | void | ) | [inline] |
Member Data Documentation
Space* Gecode::Gist::SpaceNode::copy [protected] |
Space* Gecode::Gist::SpaceNode::workingSpace [protected] |
union { ... } Gecode::Gist::SpaceNode::desc [protected] |
unsigned int Gecode::Gist::SpaceNode::nstatus [protected] |
const int Gecode::Gist::SpaceNode::LASTBIT = HASSOLVEDCHILDREN [static, protected] |
The documentation for this class was generated from the following files:
- gecode/gist/spacenode.hh (Revision: 8152)
- gecode/gist/spacenode.cpp (Revision: 9005)
- gecode/gist/spacenode.hpp (Revision: 8083)
