public class RandomNeighborhood extends ANeighbor
Modifier and Type | Field and Description |
---|---|
protected int[] |
bestSolution |
protected BitSet |
fragment |
protected int |
n |
protected IntVar[] |
vars |
Constructor and Description |
---|
RandomNeighborhood(Solver aSolver,
IntVar[] vars,
int level,
long seed) |
Modifier and Type | Method and Description |
---|---|
void |
fixSomeVariables(ICause cause)
Freezes some variables in order to have a fast computation
|
protected void |
impose(int id,
ICause cause) |
boolean |
isSearchComplete() |
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 |
selectVariable() |
activeFastRestart, fastRestart
protected final int n
protected final IntVar[] vars
protected final int[] bestSolution
protected BitSet fragment
public boolean isSearchComplete()
public void recordSolution()
INeighbor
public void fixSomeVariables(ICause cause) throws ContradictionException
INeighbor
cause
- the LNSContradictionException
- if variables have been fixed to inconsistent values
this can happen if fixed variables cannot yield to a better solution than the last one
a contradiction is raised because a cut has been posted on the objective function
Notice that it could be used to generate a no-goodprotected void impose(int id, ICause cause) throws ContradictionException
ContradictionException
protected int selectVariable()
public void restrictLess()
INeighbor
Copyright © 2015. All rights reserved.