public class MoveRestart extends Object implements Move
Move implementation enables restarting a search on certain conditions
(most of the time based on a counter). It is not self-content
and needs a underlying Move to delegate common movements when no restart is needed.
Created by cprudhom on 03/09/15. Project: choco.
| Constructor and Description |
|---|
MoveRestart(Move move,
org.chocosolver.cutoffseq.ICutoffStrategy restartStrategy,
LongCriterion criterion,
int restartLimit) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
extend(Solver solver)
Performs a move when the CSP associated to the current node of the search space is not proven to be not consistent.
|
List<Move> |
getChildMoves()
Returns the child moves or null
Some Move only accepts one single move as child.
|
<V extends Variable> |
getStrategy()
Returns the search strategy in use.
|
boolean |
init()
Called before the search starts.
|
boolean |
repair(Solver solver)
Performs a move when the CSP associated to the current node of the search space is proven to be not consistent.
|
protected void |
restart(Solver solver)
Execute the restart and update measures
|
void |
setChildMoves(List<Move> someMoves)
Overrides this child moves (if possible and if any).
|
<V extends Variable> |
setStrategy(AbstractStrategy<V> aStrategy)
Defines a search strategy, that is, a service which computes and returns decisions.
|
void |
setTopDecisionPosition(int position)
Indicates the position of decision made just before selecting this move.
|
public MoveRestart(Move move, org.chocosolver.cutoffseq.ICutoffStrategy restartStrategy, LongCriterion criterion, int restartLimit)
move - the default Move to execute when no restart has to be donerestartStrategy - defines when restarts happencriterion - defines how to trigger a restartrestartLimit - restrict the total number of restartpublic boolean init()
Movepublic boolean extend(Solver solver)
Movepublic boolean repair(Solver solver)
Movepublic void setTopDecisionPosition(int position)
MoveMove.extend(Solver) and is checked on Move.repair(Solver).setTopDecisionPosition in interface Moveposition - position of the last decision taken before applying this movepublic <V extends Variable> AbstractStrategy<V> getStrategy()
MovegetStrategy in interface MoveV - the type of variable managed by the strategypublic <V extends Variable> void setStrategy(AbstractStrategy<V> aStrategy)
MovesetStrategy in interface MoveV - the type of variable managed by the strategyaStrategy - a search strategyprotected void restart(Solver solver)
solver - reference to the solverpublic List<Move> getChildMoves()
MovegetChildMoves in interface Movepublic void setChildMoves(List<Move> someMoves)
MovesetChildMoves in interface MovesomeMoves - a new child moveCopyright © 2018. All rights reserved.