|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jopt.csp.spi.search.tree.RecalculatingStateManager
State manager that recalculates state of search tree as it is traversed so that no unnecessary information or nodes are maintained.
Design Notes
This method was created one night as Nick bolted straight up from a sound
sleep and pronounced, "Eureka! I have the answer".
Ok, so it wasn't quite that dramatic, but it was a sudden answer that came after much debate about how the state of a search tree could utilize an optimal amount of memory. It is based on the assumption that any given search node will produce the same children in the same way no matter how many times the parent node is activated / recalculated.
This state manager takes advantage of this situation by creating references to any node based on the path followed to reach the child from the root of the tree. To reach a previously closed node, this manager simply reactivates each child node as it is made current in the tree so that the same child nodes will be produced as before.
This state manager can only be used with the CrawlingSearchTree
and
is the default state manager used by the CspSolver
.
ProblemStateManager
,
DeltaStateManager
,
CrawlingSearchTree
Constructor Summary | |
RecalculatingStateManager(ConstraintStore store)
Basic constructor |
Method Summary | |
void |
ascendedToClosedNode(TreeNode previous,
TreeNode current)
Called by search tree when the current node is changed to a parent node of existing current node Node must have previously been activated. |
void |
descendedToClosedNode(TreeNode previous,
TreeNode current)
Called by search tree when the current node is changed to a child node of existing current node. |
void |
descendedToOpenNode(TreeNode previous,
TreeNode current)
Called by search tree when the node that is being moved to is a node that has not yet been activated |
void |
jumpedToClosedNode(TreeNode previous,
TreeNode current)
Called by search tree when the current node in the tree has changed from one node to another and no direct relationship between the two nodes may exist Node must have previously been activated. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RecalculatingStateManager(ConstraintStore store)
store
- the ConstraintStore
associated with this problemMethod Detail |
public void descendedToClosedNode(TreeNode previous, TreeNode current)
TreeStateManager
descendedToClosedNode
in interface TreeStateManager
previous
- Node that was current in treecurrent
- Node that is now current in treepublic void ascendedToClosedNode(TreeNode previous, TreeNode current)
TreeStateManager
ascendedToClosedNode
in interface TreeStateManager
previous
- Node that was current in treecurrent
- Node that is now current in treepublic void descendedToOpenNode(TreeNode previous, TreeNode current)
TreeStateManager
descendedToOpenNode
in interface TreeStateManager
previous
- Node that was current in treecurrent
- Node that is now current in treepublic void jumpedToClosedNode(TreeNode previous, TreeNode current)
TreeStateManager
jumpedToClosedNode
in interface TreeStateManager
previous
- Node that was current in treecurrent
- Node that is now current in tree
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |