jopt.csp.spi.search.tree
Class DeltaStateManager

java.lang.Object
  extended byjopt.csp.spi.search.tree.DeltaStateManager
All Implemented Interfaces:
TreeStateManager

public class DeltaStateManager
extends java.lang.Object
implements TreeStateManager

State manager that records state of search tree using deltas within choicepoint stack.

Design Notes
The original implementation of this search was based upon a class named SearchNodeLight which only stored the delta of the changes from the parent node that was contained in the choicepoint stack. Upon returning to this child, the delta could be pushed back onto the stack. This was considered to be a better solution than storing the entire state of the problem, but still had the disadvantage of using a lot of memory when the problem was quit large. Because of this limitation, much thought was put into creating the RecalculatingStateManager which uses a minimal amount of memory, but has extra overhead required to perform the same work as done before if we wanted to move to another node.

This type of state management requires that a search tree be crawled from parent to child and child to parent; it does not allow for a jump directly from one node to another. This state manager can only be used with the CrawlingSearchTree.

Version:
$Revision: 1.8 $
Author:
Chris Johnson, Jim Boerkoel, Nick Coleman
See Also:
ProblemStateManager, RecalculatingStateManager, CrawlingSearchTree

Constructor Summary
DeltaStateManager(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

DeltaStateManager

public DeltaStateManager(ConstraintStore store)
Basic constructor

Parameters:
store - the ConstraintStore associated with this problem
Method Detail

descendedToClosedNode

public void descendedToClosedNode(TreeNode previous,
                                  TreeNode current)
Description copied from interface: TreeStateManager
Called by search tree when the current node is changed to a child node of existing current node. Node must have previously been activated.

Specified by:
descendedToClosedNode in interface TreeStateManager
Parameters:
previous - Node that was current in tree
current - Node that is now current in tree

ascendedToClosedNode

public void ascendedToClosedNode(TreeNode previous,
                                 TreeNode current)
Description copied from interface: TreeStateManager
Called by search tree when the current node is changed to a parent node of existing current node Node must have previously been activated.

Specified by:
ascendedToClosedNode in interface TreeStateManager
Parameters:
previous - Node that was current in tree
current - Node that is now current in tree

descendedToOpenNode

public void descendedToOpenNode(TreeNode previous,
                                TreeNode current)
Description copied from interface: TreeStateManager
Called by search tree when the node that is being moved to is a node that has not yet been activated

Specified by:
descendedToOpenNode in interface TreeStateManager
Parameters:
previous - Node that was current in tree
current - Node that is now current in tree

jumpedToClosedNode

public void jumpedToClosedNode(TreeNode previous,
                               TreeNode current)
Description copied from interface: TreeStateManager
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.

Specified by:
jumpedToClosedNode in interface TreeStateManager
Parameters:
previous - Node that was current in tree
current - Node that is now current in tree