public class HillClimber.HillClimberContext extends NeighbourSearch.NeighbourSearchContext
Modifier and Type | Field and Description |
---|---|
protected int |
iLastImprovingIter |
iIter, iT0
Constructor and Description |
---|
HillClimberContext() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(Assignment<V,T> assignment,
Model<V,T> model,
Neighbour<V,T> neighbour,
double value,
boolean lazy)
Accept any move that does not worsen the solution (value <= 0)
|
protected void |
activate(Solution<V,T> solution)
Reset the idle iterations counter
|
protected boolean |
canContinue(Solution<V,T> solution)
Stop the search after a given number of idle (not improving) iterations
|
protected void |
incIteration(Solution<V,T> solution)
Increase iteration counter
|
bestCleared, bestRestored, bestSaved, deactivate, getInfo, getInfo, getTimeMillis, solutionUpdated
protected int iLastImprovingIter
public HillClimberContext()
protected void incIteration(Solution<V,T> solution)
incIteration
in class NeighbourSearch.NeighbourSearchContext
solution
- current solutionprotected boolean canContinue(Solution<V,T> solution)
canContinue
in class NeighbourSearch.NeighbourSearchContext
solution
- current solutionprotected void activate(Solution<V,T> solution)
activate
in class NeighbourSearch.NeighbourSearchContext
solution
- current solutionprotected boolean accept(Assignment<V,T> assignment, Model<V,T> model, Neighbour<V,T> neighbour, double value, boolean lazy)
accept
in class NeighbourSearch.NeighbourSearchContext
assignment
- current assignmentmodel
- problem modelneighbour
- a generated movevalue
- value of the generated move (i.e., its impact on the solution value)lazy
- true if lazy move