jopt.csp.spi.search.tree
Class CombinedAction

java.lang.Object
  extended byjopt.csp.spi.search.tree.CombinedAction
All Implemented Interfaces:
jopt.csp.search.SearchAction

public final class CombinedAction
extends java.lang.Object
implements jopt.csp.search.SearchAction

Special action that represents a combination of actions that should all be performed within the same search node

Author:
Nick Coleman

Constructor Summary
CombinedAction(java.util.List actions)
          Creates a new combined action
CombinedAction(jopt.csp.search.SearchAction action1, jopt.csp.search.SearchAction action2)
          Creates a new combined action
CombinedAction(jopt.csp.search.SearchAction action1, jopt.csp.search.SearchAction action2, jopt.csp.search.SearchAction action3)
          Creates a new combined action
 
Method Summary
 jopt.csp.search.SearchAction performAction()
          Iteratively executed the actions stored in this CombinedAction.
 jopt.csp.search.SearchAction processChoicePoint(java.util.LinkedList workingStack, jopt.csp.search.SearchAction searchAction)
          This method handles creating combined choice point if additional actions exist that have not yet executed in the stack
 jopt.csp.search.SearchAction processSearchChange(java.util.LinkedList workingStack, jopt.csp.search.SearchAction searchAction)
          This method handles a search technique change encountered when there exist actions in the stack that have not yet executed.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CombinedAction

public CombinedAction(jopt.csp.search.SearchAction action1,
                      jopt.csp.search.SearchAction action2)
Creates a new combined action

Parameters:
action1 - First action to perform
action2 - Second action to perform

CombinedAction

public CombinedAction(jopt.csp.search.SearchAction action1,
                      jopt.csp.search.SearchAction action2,
                      jopt.csp.search.SearchAction action3)
Creates a new combined action

Parameters:
action1 - First action to perform
action2 - Second action to perform
action3 - Third action to perform

CombinedAction

public CombinedAction(java.util.List actions)
Creates a new combined action

Parameters:
actions - List of actions that should make up this combined action. Actions will be performed in the order they exist in the list.
Method Detail

performAction

public jopt.csp.search.SearchAction performAction()
                                           throws jopt.csp.variable.PropagationFailureException
Iteratively executed the actions stored in this CombinedAction. Handles choice points and search technique changes appropriately so that all actions in the combined action will eventually be executed.

Specified by:
performAction in interface jopt.csp.search.SearchAction
Throws:
jopt.csp.variable.PropagationFailureException

processSearchChange

public jopt.csp.search.SearchAction processSearchChange(java.util.LinkedList workingStack,
                                                        jopt.csp.search.SearchAction searchAction)
                                                 throws jopt.csp.variable.PropagationFailureException
This method handles a search technique change encountered when there exist actions in the stack that have not yet executed. It ensures that the rest of the stack is executed after the technique change is done.

Throws:
jopt.csp.variable.PropagationFailureException

processChoicePoint

public jopt.csp.search.SearchAction processChoicePoint(java.util.LinkedList workingStack,
                                                       jopt.csp.search.SearchAction searchAction)
                                                throws jopt.csp.variable.PropagationFailureException
This method handles creating combined choice point if additional actions exist that have not yet executed in the stack

Throws:
jopt.csp.variable.PropagationFailureException

toString

public java.lang.String toString()