public class StepCountingHillClimber<V extends Variable<V,T>,T extends Value<V,T>> extends HillClimber<V,T>
Modifier and Type | Class and Description |
---|---|
static class |
StepCountingHillClimber.Mode |
Modifier and Type | Field and Description |
---|---|
protected Double |
iBound |
protected int |
iCounter |
protected int |
iCounterLimit |
protected StepCountingHillClimber.Mode |
iCounterMode |
iBestValue, iLastImprovingIter, iMaxIdleIters, iSetHCMode
Constructor and Description |
---|
StepCountingHillClimber(DataProperties properties,
String name)
Constructor
HillClimber.CounterLimit ... number of moves after which the bound is reset (defaults to 1000)
HillClimber.CounterMode ... counter mode (all: count all moves, accepted: count accepted moves, improving: count improving moves)
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
accept(Model<V,T> model,
Neighbour<V,T> neighbour,
double value,
boolean lazy)
Accept any move that does not worsen the solution (value <= 0) or that is below the bound.
|
void |
activate(Solution<V,T> solution)
Reset the bound and the steps counter.
|
protected boolean |
canContinue(Solution<V,T> solution)
Stop the search when the number of idle iterations is reached and the bound is no longer decreasing
|
void |
incIteration(Solution<V,T> solution)
Increase iteration number, also update bound when the given number of steps is reached.
|
bestSaved, getParameterBaseName, init, setPhase
accept, accept, addNeighbourSelection, bestCleared, bestRestored, deactivate, generateMove, getInfo, getInfo, getNeighbours, getTimeMillis, logNeibourStatus, nextNeighbourSelection, selectNeighbour, setHCMode, solutionUpdated
protected int iCounter
protected int iCounterLimit
protected StepCountingHillClimber.Mode iCounterMode
public StepCountingHillClimber(DataProperties properties, String name)
public void incIteration(Solution<V,T> solution)
incIteration
in class HillClimber<V extends Variable<V,T>,T extends Value<V,T>>
protected boolean accept(Model<V,T> model, Neighbour<V,T> neighbour, double value, boolean lazy)
protected boolean canContinue(Solution<V,T> solution)
canContinue
in class HillClimber<V extends Variable<V,T>,T extends Value<V,T>>