public abstract class Neighbor extends Object implements ICause
Modifier and Type | Field and Description |
---|---|
protected int[] |
values |
protected IntVar[] |
variables |
Modifier | Constructor and Description |
---|---|
protected |
Neighbor(IntVar[] variables) |
Modifier and Type | Method and Description |
---|---|
abstract void |
fixSomeVariables()
Freezes some variables in order to have a fast computation.
|
void |
forEachIntVar(Consumer<IntVar> action)
Apply an action on each variable declared on the scope of this cause, if any.
|
void |
freeze(int i)
Freeze variable at position 'i' to its value in that recorded solution.
|
void |
init()
Initialize this neighbor
|
boolean |
isSearchComplete() |
void |
loadFromSolution(Solution solution)
Load a solution and record it
|
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 final IntVar[] variables
protected final int[] values
protected Neighbor(IntVar[] variables)
public void init()
public void recordSolution()
public abstract void fixSomeVariables() throws ContradictionException
ContradictionException
public void freeze(int i) throws ContradictionException
i
- position of the variable to instantiateContradictionException
- if a contradiction occurspublic void restrictLess()
public boolean isSearchComplete()
public void loadFromSolution(Solution solution)
solution
- a solution to recordpublic void forEachIntVar(Consumer<IntVar> action)
ICause
forEachIntVar
in interface ICause
action
- action to perform on each variable declared in this cause.Copyright © 2018. All rights reserved.