Class AnnealingAdvancementChooser
java.lang.Object
repast.simphony.parameter.optimizer.HillClimber
repast.simphony.parameter.optimizer.AnnealingAdvancementChooser
- All Implemented Interfaces:
AdvancementChooser
-
Field Summary
Modifier and TypeFieldDescriptionprotected CoolingSchedule
static final double
protected boolean
protected double
protected AdvanceType
protected double
Fields inherited from class repast.simphony.parameter.optimizer.HillClimber
centerValue, checkingLocal, forwardValid, forwardValue, lastSetter, lastValue
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionchooseAdvancement
(ParameterSetter init, AdvanceType lastType, double runResult) This performs the hill climbing algorithm.protected boolean
protected double
boolean
shouldRevert
(double runResult) Returns true when the previous run's value was greater than runResult or when we're exploring the local space to figure out which direction to go.
-
Field Details
-
DEFAULT_INITIAL_TEMP
public static final double DEFAULT_INITIAL_TEMP- See Also:
-
coolingSchedule
-
maxTemp
protected double maxTemp -
jumped
protected boolean jumped -
preJumpAdvance
-
preJumpRunResult
protected double preJumpRunResult
-
-
Constructor Details
-
AnnealingAdvancementChooser
public AnnealingAdvancementChooser() -
AnnealingAdvancementChooser
-
-
Method Details
-
chooseAdvancement
Description copied from class:HillClimber
This performs the hill climbing algorithm. In the best case it will traverse the space by (assuming we've just chosen a new parameter):- Explore the local space to find which direction to follow. It first will explore to the right (FORWARD) of the current position, then to the left (BACKWARD).
- Next it will move whichever direction is best of left, right, and the neither (if we're
at a peak). If we're on a peak it will return
AdvanceType.SWITCH
.
- Specified by:
chooseAdvancement
in interfaceAdvancementChooser
- Overrides:
chooseAdvancement
in classHillClimber
- Parameters:
init
- the current setterlastType
- the last executed parameter commandrunResult
- the last run's value- Returns:
- the action to perform
-
shouldRevert
public boolean shouldRevert(double runResult) Description copied from class:HillClimber
Returns true when the previous run's value was greater than runResult or when we're exploring the local space to figure out which direction to go.- Specified by:
shouldRevert
in interfaceAdvancementChooser
- Overrides:
shouldRevert
in classHillClimber
- Parameters:
runResult
- the result of the previous run- Returns:
- if we should revert to the previous space
-
chooseRandom
protected boolean chooseRandom() -
getRandom
protected double getRandom()
-