Module org.chocosolver
Class SequenceNeighborhood
- java.lang.Object
-
- org.chocosolver.solver.search.loop.lns.neighbors.SequenceNeighborhood
-
- 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 void
fixSomeVariables()
Freezes some variables in order to have a fast computation.void
init()
Initialize this neighborboolean
isSearchComplete()
void
loadFromSolution(Solution solution)
Load a solution and record itprotected void
nextNeighbor()
void
recordSolution()
Record values of decision variables to freeze some ones during the next LNS runvoid
restrictLess()
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)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.chocosolver.solver.ICause
explain, forEachIntVar
-
-
-
-
Field Detail
-
count
protected int count
number of neighbors declared
-
neighbors
protected INeighbor[] neighbors
neighbors declared
-
-
Constructor Detail
-
SequenceNeighborhood
public SequenceNeighborhood(INeighbor... neighbors)
-
-
Method Detail
-
recordSolution
public void recordSolution()
Description copied from interface:INeighbor
Record values of decision variables to freeze some ones during the next LNS run- Specified by:
recordSolution
in interfaceINeighbor
-
loadFromSolution
public void loadFromSolution(Solution solution)
Description copied from interface:INeighbor
Load a solution and record it- Specified by:
loadFromSolution
in interfaceINeighbor
- Parameters:
solution
- a solution to record
-
fixSomeVariables
public void fixSomeVariables() throws ContradictionException
Description copied from interface:INeighbor
Freezes some variables in order to have a fast computation. The fixed variables are declared as decisions in the decision path.- Specified by:
fixSomeVariables
in interfaceINeighbor
- Throws:
ContradictionException
-
restrictLess
public void restrictLess()
Description copied from interface:INeighbor
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)- Specified by:
restrictLess
in interfaceINeighbor
-
isSearchComplete
public boolean isSearchComplete()
- Specified by:
isSearchComplete
in interfaceINeighbor
- Returns:
- true iff the search is in a complete mode (no fixed variable)
-
init
public void init()
Description copied from interface:INeighbor
Initialize this neighbor
-
nextNeighbor
protected void nextNeighbor()
-
-