Interface Move

 All Known Implementing Classes:
MoveBinaryDDS
,MoveBinaryDFS
,MoveBinaryHBFS
,MoveBinaryLDS
,MoveLNS
,MoveRestart
,MoveSeq
public interface Move
The "Move" component (Inspired from "Unifying search algorithms for CSP" N. Jussien and O. Lhomme, Technical report 023INFO, EMN).The aim of the component, unlike other ones, is not to prune the search space but rather to to explore it.
Created by cprudhom on 01/09/15. Project: choco.
 Since:
 3.3.1
 Author:
 Charles Prud'homme


Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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>
AbstractStrategy<V>getStrategy()
Returns the search strategy in use.boolean
init()
Called before the search starts.void
removeStrategy()
Erases the defined search strategy.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.void
setChildMoves(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.void
setTopDecisionPosition(int position)
Indicates the position of decision made just before selecting this move.



Method Detail

init
boolean init()
Called before the search starts. Also initializes the search strategy. Returns:
 false if something goes wrong, true otherwise

extend
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. Parameters:
solver
 reference the solver Returns:
true
if an extension can be done,false
when no more extension is possible.

repair
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. Parameters:
solver
 reference the solver Returns:
true
if a reparation can be done,false
when no more reparation is possible.

getStrategy
<V extends Variable> AbstractStrategy<V> getStrategy()
Returns the search strategy in use. Type Parameters:
V
 the type of variable managed by the strategy Returns:
 the current search strategy

setStrategy
<V extends Variable> void setStrategy(AbstractStrategy<V> aStrategy)
Defines a search strategy, that is, a service which computes and returns decisions. Type Parameters:
V
 the type of variable managed by the strategy Parameters:
aStrategy
 a search strategy

removeStrategy
void removeStrategy()
Erases the defined search strategy.

getChildMoves
List<Move> getChildMoves()
Returns the child moves or null Some Move only accepts one single move as child. Returns:
 the child moves

setChildMoves
void setChildMoves(List<Move> someMoves)
Overrides this child moves (if possible and if any). Some Move only accepts one single move as child. Parameters:
someMoves
 a new child move Throws:
UnsupportedOperationException
 when the size of Move expected is not respected.

setTopDecisionPosition
void setTopDecisionPosition(int position)
Indicates 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 toextend(Solver)
and is checked onrepair(Solver)
. Parameters:
position
 position of the last decision taken before applying this move

