- java.lang.Object
-
- org.chocosolver.solver.search.loop.move.MoveBinaryDFS
-
- org.chocosolver.solver.search.loop.move.MoveBinaryLDS
-
- All Implemented Interfaces:
Move
- Direct Known Subclasses:
MoveBinaryDDS
public class MoveBinaryLDS extends MoveBinaryDFS
A move dedicated to run an Limited Discrepancy Search[1] (LDS) with binary decisions.[1]:W.D. Harvey and M.L.Ginsberg, Limited Discrepancy Search, IJCAI-95.
Created by cprudhom on 07/10/15. Project: choco.
- Since:
- 07/10/15
- Author:
- Charles Prud'homme
-
-
Field Summary
Fields Modifier and Type Field Description protected IStateInt
dis
current discrepancy, maintained incrementallyprotected int
DIS
max discrepancy allowed-
Fields inherited from class org.chocosolver.solver.search.loop.move.MoveBinaryDFS
strategy, topDecisionPosition
-
-
Constructor Summary
Constructors Constructor Description MoveBinaryLDS(AbstractStrategy strategy, int discrepancy, IEnvironment environment)
Create a DFS with binary decisions
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 boolean
rewind(Solver solver)
Go back in the search tree.-
Methods inherited from class org.chocosolver.solver.search.loop.move.MoveBinaryDFS
extend, getChildMoves, getStrategy, prevDecision, removeStrategy, setChildMoves, setStrategy, setTopDecisionPosition
-
-
-
-
Field Detail
-
dis
protected IStateInt dis
current discrepancy, maintained incrementally
-
DIS
protected int DIS
max discrepancy allowed
-
-
Constructor Detail
-
MoveBinaryLDS
public MoveBinaryLDS(AbstractStrategy strategy, int discrepancy, IEnvironment environment)
Create a DFS with binary decisions- Parameters:
strategy
- how (binary) decisions are selecteddiscrepancy
- maximum discrepancyenvironment
- backtracking environment
-
-
Method Detail
-
init
public boolean init()
Description copied from interface:Move
Called before the search starts. Also initializes the search strategy.- Specified by:
init
in interfaceMove
- Overrides:
init
in classMoveBinaryDFS
- Returns:
- false if something goes wrong, true otherwise
-
repair
public boolean repair(Solver solver)
Description copied from interface:Move
Performs a move when the CSP associated to the current node of the search space is proven to be not consistent.- Specified by:
repair
in interfaceMove
- Overrides:
repair
in classMoveBinaryDFS
- Parameters:
solver
- reference the solver- Returns:
true
if a reparation can be done,false
when no more reparation is possible.
-
rewind
protected boolean rewind(Solver solver)
Description copied from class:MoveBinaryDFS
Go back in the search tree. Either refute a decision, or backtrack.- Overrides:
rewind
in classMoveBinaryDFS
- Parameters:
solver
- reference to the solver- Returns:
true
if a reparation has been found
-
-