public class MoveBinaryDFS extends Object implements Move
Created by cprudhom on 02/09/15. Project: choco.
Modifier and Type | Field and Description |
---|---|
protected AbstractStrategy |
strategy
Search strategy to extend the search tree
|
protected int |
topDecisionPosition
Index, in the decision path, of the decision taken just before selecting this move.
|
Constructor and Description |
---|
MoveBinaryDFS()
Create this move without any search strategy
|
MoveBinaryDFS(AbstractStrategy strategy)
Create this move with a search strategy
|
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.
|
protected void |
prevDecision(Solver solver)
Backtrack in the search tree
|
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 boolean |
rewind(Solver solver)
Go back in the search tree.
|
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.
|
protected AbstractStrategy strategy
protected int topDecisionPosition
public MoveBinaryDFS()
public MoveBinaryDFS(AbstractStrategy strategy)
strategy
- a search strategypublic boolean init()
Move
public boolean extend(Solver solver)
Move
public boolean repair(Solver solver)
Move
public void setTopDecisionPosition(int position)
Move
Move.extend(Solver)
and is checked on Move.repair(Solver)
.setTopDecisionPosition
in interface Move
position
- position of the last decision taken before applying this movepublic <V extends Variable> AbstractStrategy<V> getStrategy()
Move
getStrategy
in interface Move
V
- the type of variable managed by the strategypublic <V extends Variable> void setStrategy(AbstractStrategy<V> aStrategy)
Move
setStrategy
in interface Move
V
- the type of variable managed by the strategyaStrategy
- a search strategyprotected boolean rewind(Solver solver)
solver
- reference to the solvertrue
if a reparation has been foundprotected void prevDecision(Solver solver)
solver
- reference to the solverpublic List<Move> getChildMoves()
Move
getChildMoves
in interface Move
public void setChildMoves(List<Move> someMoves)
Move
setChildMoves
in interface Move
someMoves
- a new child moveCopyright © 2018. All rights reserved.