| Modifier and Type | Field and Description |
|---|---|
protected ICounter |
counter
Restart counter
|
protected long |
frequency
For restart strategy
|
protected boolean |
freshRestart
Indicate a restart has been triggered
|
protected Move |
move
the strategy required to complete the generated fragment
|
protected INeighbor |
neighbor
Neighbor to used
|
protected long |
solutions
Number of solutions found so far
|
| Constructor and Description |
|---|
MoveLNS(Move move,
INeighbor neighbor,
ICounter restartCounter)
Create a move which defines a Large Neighborhood Search.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doRestart(Solver solver)
Extend the neighbor when conditions are met and do the restart
|
boolean |
extend(Solver solver)
Return false when:
the underlying search has no more decision to provide,
Return true when:
a new neighbor is provided,
or a new decision is provided by the underlying decision
or the fast restart criterion is met.
|
List<Move> |
getChildMoves()
Returns the child moves or null
Some Move only accepts one single move as child.
|
<V extends Variable> |
getStrategy()
Returns the search strategy in use.
|
boolean |
init()
Called before the search starts.
|
void |
loadFromSolution(Solution solution,
Solver solver)
Give an initial solution to begin with if called before executing the solving process
or erase the last recorded one otherwise.
|
boolean |
repair(Solver solver)
Return false when :
move.repair(searchLoop) returns false and neighbor is complete.
|
void |
setChildMoves(List<Move> someMoves)
Overrides this child moves (if possible and if any).
|
<V extends Variable> |
setStrategy(AbstractStrategy<V> aStrategy)
Defines a search strategy, that is, a service which computes and returns decisions.
|
void |
setTopDecisionPosition(int position)
Indicates the position of decision made just before selecting this move.
|
protected Move move
protected INeighbor neighbor
protected long solutions
protected boolean freshRestart
protected ICounter counter
protected long frequency
public boolean init()
Movepublic boolean extend(Solver solver)
Return true when:
Restart when:
public boolean repair(Solver solver)
Restart when:
public void loadFromSolution(Solution solution, Solver solver)
solution - a solution to recordsolver - that manages the LNSpublic void setTopDecisionPosition(int position)
MoveMove.extend(Solver) and is checked on Move.repair(Solver).setTopDecisionPosition in interface Moveposition - position of the last decision taken before applying this movepublic <V extends Variable> AbstractStrategy<V> getStrategy()
MovegetStrategy in interface MoveV - the type of variable managed by the strategypublic <V extends Variable> void setStrategy(AbstractStrategy<V> aStrategy)
MovesetStrategy in interface MoveV - the type of variable managed by the strategyaStrategy - a search strategyprotected void doRestart(Solver solver)
solver - SearchLooppublic List<Move> getChildMoves()
MovegetChildMoves in interface Movepublic void setChildMoves(List<Move> someMoves)
MovesetChildMoves in interface MovesomeMoves - a new child moveCopyright © 2017. All rights reserved.