public abstract class SimulatedAnnealingOptimizer
extends java.lang.Object
Constructor and Description |
---|
SimulatedAnnealingOptimizer(double coolRate,
int iterationsPerT,
long iterationsBeforeQuit,
java.lang.String saveState,
java.util.Random r) |
Modifier and Type | Method and Description |
---|---|
double |
calibratedTemp(double acceptanceRate)
Calibrates the temperature by moving to the nearest local minimum and calculating the mean
increase in energy of attempted state changes.
|
abstract java.lang.String |
lowestEnergyState()
Gets a String representation of the lowest energy state of the system.
|
void |
minimize()
Runs the minimization.
|
void |
setTemperature(double t) |
abstract java.lang.String |
state()
Gets a String representation of the current state of the system.
|
public SimulatedAnnealingOptimizer(double coolRate, int iterationsPerT, long iterationsBeforeQuit, java.lang.String saveState, java.util.Random r)
coolRate
- a constant. Unless the method cool(double) is overridden, the temperature is lowered
by a factor of (1 - coolRate) after iterationsPerT
iterations.iterationsPerT
- attempt this many changes to the state of the system before lowering the temperature.iterationsBeforeQuit
- Optimization will end if the energy is not lowered after this many iterations.
state before quitting.saveStateRoot
- Root of file to save the state of the system during optimization.r
- a random number generator.public void setTemperature(double t)
public final void minimize()
public abstract java.lang.String state()
public abstract java.lang.String lowestEnergyState()
public double calibratedTemp(double acceptanceRate)
This method assumes that the system will quickly reach a local minimum if no positive energy changes are allowed (if this is not the case, perhaps simulated annealing is not the most suitable optimization algorithm), and hence that the mean energy change over a large number of configuration change will be positive.