Class MoveLearnBinaryTDR
- java.lang.Object
-
- org.chocosolver.solver.search.loop.learn.LearnExplained
-
- org.chocosolver.solver.search.loop.move.MoveLearnBinaryTDR
-
public class MoveLearnBinaryTDR extends LearnExplained implements Move
A combination of Move and Learn which results in tabu Decision-repair[1] (TDR) with binary decisions.[1]: N. Jussien, O. Lhomme, Local search with constraint propagation and conflict-based heuristics, AI-139 (2002).
Created by cprudhom on 04/11/2015. Project: choco.
-
-
Field Summary
-
Fields inherited from class org.chocosolver.solver.search.loop.learn.LearnExplained
lastExplanation, mExplainer, mModel
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanextend(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>
AbstractStrategy<V>getStrategy()Returns the search strategy in use.booleaninit()Called before the search starts.voidonFailure(Solver solver)Actions to do when a failure is met.booleanrepair(Solver solver)Performs a move when the CSP associated to the current node of the search space is proven to be not consistent.voidsetChildMoves(List<Move> someMoves)Overrides this child moves (if possible and if any).<V extends Variable>
voidsetStrategy(AbstractStrategy<V> aStrategy)Defines a search strategy, that is, a service which computes and returns decisions.voidsetTopDecisionPosition(int position)Indicates the position of decision made just before selecting this move.-
Methods inherited from class org.chocosolver.solver.search.loop.learn.LearnExplained
forget, getLastExplanation, onSolution, record
-
-
-
-
Method Detail
-
extend
public boolean extend(Solver solver)
Description copied from interface:MovePerforms a move when the CSP associated to the current node of the search space is not proven to be not consistent.
-
repair
public boolean repair(Solver solver)
Description copied from interface:MovePerforms a move when the CSP associated to the current node of the search space is proven to be not consistent.
-
onFailure
public void onFailure(Solver solver)
Actions to do when a failure is met. main reason we implement this Learn.- Overrides:
onFailurein classLearnExplained
-
init
public boolean init()
Description copied from interface:MoveCalled before the search starts. Also initializes the search strategy.
-
getStrategy
public <V extends Variable> AbstractStrategy<V> getStrategy()
Description copied from interface:MoveReturns the search strategy in use.- Specified by:
getStrategyin interfaceMove- Type Parameters:
V- the type of variable managed by the strategy- Returns:
- the current search strategy
-
setStrategy
public <V extends Variable> void setStrategy(AbstractStrategy<V> aStrategy)
Description copied from interface:MoveDefines a search strategy, that is, a service which computes and returns decisions.- Specified by:
setStrategyin interfaceMove- Type Parameters:
V- the type of variable managed by the strategy- Parameters:
aStrategy- a search strategy
-
getChildMoves
public List<Move> getChildMoves()
Description copied from interface:MoveReturns the child moves or null Some Move only accepts one single move as child.- Specified by:
getChildMovesin interfaceMove- Returns:
- the child moves
-
setChildMoves
public void setChildMoves(List<Move> someMoves)
Description copied from interface:MoveOverrides this child moves (if possible and if any). Some Move only accepts one single move as child.- Specified by:
setChildMovesin interfaceMove- Parameters:
someMoves- a new child move
-
setTopDecisionPosition
public void setTopDecisionPosition(int position)
Description copied from interface:MoveIndicates the position of decision made just before selecting this move. When only one "terminal" move is declared, the top decision decision is -1. When dealing with a sequence of Move, the position is the one of the last decision of the previous move. In consequence, when backtracking, the right move can be applied or stopped when needed. This has to be declared on the first call toMove.extend(Solver)and is checked onMove.repair(Solver).- Specified by:
setTopDecisionPositionin interfaceMove- Parameters:
position- position of the last decision taken before applying this move
-
-