jopt.csp.spi.search.localsearch
Class BrowseNeighborsAction
java.lang.Object
jopt.csp.spi.search.tree.AbstractSearchNodeAction
jopt.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)
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 |
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 restoredinitial
- Initial solution related to neighborneighbors
- List of neighboring solutions to initial, each to be
applied as an alternative choices
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