public class SequenceNeighborhood extends Object implements INeighbor
Modifier and Type | Field and Description |
---|---|
protected int |
count
number of neighbors declared
|
protected int[] |
counters
Number of time each neighbor succeed in finding a solution
|
protected INeighbor[] |
neighbors
neighbors declared
|
protected int |
who
neighbor currently selected
|
Constructor and Description |
---|
SequenceNeighborhood(INeighbor... neighbors) |
Modifier and Type | Method and Description |
---|---|
void |
fixSomeVariables(DecisionPath decisionPath)
Freezes some variables in order to have a fast computation.
|
void |
init()
Initialize this neighbor
|
boolean |
isSearchComplete() |
void |
loadFromSolution(Solution solution)
Load a solution and record it
|
protected void |
nextNeighbor() |
void |
recordSolution()
Record values of decision variables to freeze some ones during the next LNS run
|
void |
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)
|
protected int who
protected int count
protected INeighbor[] neighbors
protected int[] counters
public SequenceNeighborhood(INeighbor... neighbors)
public void recordSolution()
INeighbor
recordSolution
in interface INeighbor
public void loadFromSolution(Solution solution)
INeighbor
loadFromSolution
in interface INeighbor
solution
- a solution to recordpublic void fixSomeVariables(DecisionPath decisionPath)
INeighbor
fixSomeVariables
in interface INeighbor
decisionPath
- the decision path in which declaring variable to freezepublic void restrictLess()
INeighbor
restrictLess
in interface INeighbor
public boolean isSearchComplete()
isSearchComplete
in interface INeighbor
public void init()
INeighbor
protected void nextNeighbor()
Copyright © 2018. All rights reserved.