Class SequenceNeighborhood
- java.lang.Object
-
- org.chocosolver.solver.search.loop.lns.neighbors.Neighbor
-
- org.chocosolver.solver.search.loop.lns.neighbors.SequenceNeighborhood
-
- All Implemented Interfaces:
ICause
- Direct Known Subclasses:
AdaptiveNeighborhood
public class SequenceNeighborhood extends Neighbor
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(Neighbor... 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 org.chocosolver.solver.search.loop.lns.neighbors.Neighbor
forEachIntVar, freeze
-
-
-
-
Field Detail
-
count
protected int count
number of neighbors declared
-
neighbors
protected Neighbor[] neighbors
neighbors declared
-
-
Constructor Detail
-
SequenceNeighborhood
public SequenceNeighborhood(Neighbor... neighbors)
-
-
Method Detail
-
recordSolution
public void recordSolution()
Description copied from class:Neighbor
Record values of decision variables to freeze some ones during the next LNS run- Overrides:
recordSolution
in classNeighbor
-
loadFromSolution
public void loadFromSolution(Solution solution)
Description copied from class:Neighbor
Load a solution and record it- Overrides:
loadFromSolution
in classNeighbor
- Parameters:
solution
- a solution to record
-
fixSomeVariables
public void fixSomeVariables() throws ContradictionException
Description copied from class:Neighbor
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 classNeighbor
- Throws:
ContradictionException
-
restrictLess
public void restrictLess()
Description copied from class:Neighbor
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)- Overrides:
restrictLess
in classNeighbor
-
isSearchComplete
public boolean isSearchComplete()
- Overrides:
isSearchComplete
in classNeighbor
- Returns:
- true iff the search is in a complete mode (no fixed variable)
-
init
public void init()
Description copied from class:Neighbor
Initialize this neighbor
-
nextNeighbor
protected void nextNeighbor()
-
-