Class SequenceNeighborhood
- java.lang.Object
-
- org.chocosolver.solver.search.loop.lns.neighbors.SequenceNeighborhood
-
- All Implemented Interfaces:
INeighbor
- Direct Known Subclasses:
AdaptiveNeighborhood
public class SequenceNeighborhood extends Object implements INeighbor
A neighbor which is based on mutliple neighbors. They are called sequentially.- Since:
- 18/06/13
- Author:
- Charles Prud'homme
-
-
Constructor Summary
Constructors Constructor Description SequenceNeighborhood(INeighbor... neighbors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfixSomeVariables(DecisionPath decisionPath)Freezes some variables in order to have a fast computation.voidinit()Initialize this neighborbooleanisSearchComplete()voidloadFromSolution(Solution solution)Load a solution and record itprotected voidnextNeighbor()voidrecordSolution()Record values of decision variables to freeze some ones during the next LNS runvoidrestrictLess()Use less restriction at the beginning of a LNS run in order to get better solutions Called when no solution was found during a LNS run (trapped into a local optimum)
-
-
-
Field Detail
-
who
protected int who
neighbor currently selected
-
count
protected int count
number of neighbors declared
-
neighbors
protected INeighbor[] neighbors
neighbors declared
-
counters
protected int[] counters
Number of time each neighbor succeed in finding a solution
-
-
Constructor Detail
-
SequenceNeighborhood
public SequenceNeighborhood(INeighbor... neighbors)
-
-
Method Detail
-
recordSolution
public void recordSolution()
Description copied from interface:INeighborRecord values of decision variables to freeze some ones during the next LNS run- Specified by:
recordSolutionin interfaceINeighbor
-
loadFromSolution
public void loadFromSolution(Solution solution)
Description copied from interface:INeighborLoad a solution and record it- Specified by:
loadFromSolutionin interfaceINeighbor- Parameters:
solution- a solution to record
-
fixSomeVariables
public void fixSomeVariables(DecisionPath decisionPath)
Description copied from interface:INeighborFreezes some variables in order to have a fast computation. The fixed variables are declared as decisions in the decision path.- Specified by:
fixSomeVariablesin interfaceINeighbor- Parameters:
decisionPath- the decision path in which declaring variable to freeze
-
restrictLess
public void restrictLess()
Description copied from interface:INeighborUse less restriction at the beginning of a LNS run in order to get better solutions Called when no solution was found during a LNS run (trapped into a local optimum)- Specified by:
restrictLessin interfaceINeighbor
-
isSearchComplete
public boolean isSearchComplete()
- Specified by:
isSearchCompletein interfaceINeighbor- Returns:
- true iff the search is in a complete mode (no fixed variable)
-
init
public void init()
Description copied from interface:INeighborInitialize this neighbor
-
nextNeighbor
protected void nextNeighbor()
-
-