jopt.csp.spi.search.localsearch
Class BrowseNeighborsAction

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

public class BrowseNeighborsAction
extends AbstractSearchNodeAction

This action will browse a list of neighboring solutions to an solution. The neighbor can define solutions to variables that should not be updated from the original solution as well as values to assign to variables not in the scope of the original solution. Each neighbor will be applied as an alternative solution to produce a set of choices. If you want to want to restore a neighboring solution to a problem so the exact solution stored, you may want to refer to the CspSolver class's CspSolver.reset() and CspSolver.restoreNeighboringSolution(SolverSolution, SolverSolution) This action is not a replacement of the restore neighboring solution method in the CspSolver class. It is just a convenient way of calling the restore during a search.

Version:
$Revision: 1.7 $
Author:
Nick Coleman
See Also:
RestoreSolutionAction, CspSolver.reset(), CspSolver.restoreNeighboringSolution(SolverSolution, SolverSolution)

Constructor Summary
BrowseNeighborsAction(ConstraintStore store, jopt.csp.solution.SolverSolution initial, java.util.List neighbors)
          Creates new scan neighbors action
 
Method Summary
 jopt.csp.search.SearchAction performAction()
          Called by search tree to execute this action.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowseNeighborsAction

public BrowseNeighborsAction(ConstraintStore store,
                             jopt.csp.solution.SolverSolution initial,
                             java.util.List neighbors)
Creates new scan neighbors action

Parameters:
store - Constraint store containing problem where solution will be restored
initial - Initial solution related to neighbor
neighbors - List of neighboring solutions to initial, each to be applied as an alternative choices
Method Detail

performAction

public jopt.csp.search.SearchAction performAction()
                                           throws jopt.csp.variable.PropagationFailureException
Called by search tree to execute this action.

Returns:
Next action to execute in search
Throws:
jopt.csp.variable.PropagationFailureException