Package org.moeaframework.algorithm.sa
Class TemperatureBasedTerminationCondition
java.lang.Object
org.moeaframework.algorithm.sa.TemperatureBasedTerminationCondition
- All Implemented Interfaces:
Configurable
,TerminationCondition
public class TemperatureBasedTerminationCondition
extends Object
implements TerminationCondition, Configurable
Terminates a simulated annealing algorithm when the temperature drops below a stopping, or minimum, temperature.
-
Constructor Summary
ConstructorDescriptionConstructs a new termination condition based on the simulated annealing temperature.TemperatureBasedTerminationCondition
(double stoppingTemperature) Constructs a new termination condition based on the simulated annealing temperature. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the stopping, or minimum, temperature at which point the algorithm stops.void
initialize
(Algorithm algorithm) Invoked when the algorithm is created to collect any initial conditions.void
setStoppingTemperature
(double stoppingTemperature) Sets the stopping, or minimum, temperature at which point the algorithm stops.boolean
shouldTerminate
(Algorithm algorithm) Invoked after every step to check if the algorithm should terminate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.moeaframework.core.configuration.Configurable
applyConfiguration, getConfiguration
-
Constructor Details
-
TemperatureBasedTerminationCondition
public TemperatureBasedTerminationCondition()Constructs a new termination condition based on the simulated annealing temperature. -
TemperatureBasedTerminationCondition
public TemperatureBasedTerminationCondition(double stoppingTemperature) Constructs a new termination condition based on the simulated annealing temperature.- Parameters:
stoppingTemperature
- the stopping temperature
-
-
Method Details
-
getStoppingTemperature
public double getStoppingTemperature()Returns the stopping, or minimum, temperature at which point the algorithm stops.- Returns:
- the stopping temperature
-
setStoppingTemperature
public void setStoppingTemperature(double stoppingTemperature) Sets the stopping, or minimum, temperature at which point the algorithm stops.- Parameters:
stoppingTemperature
- the stopping temperature
-
initialize
Description copied from interface:TerminationCondition
Invoked when the algorithm is created to collect any initial conditions. Note that the algorithm may not have been initialized at this point.- Specified by:
initialize
in interfaceTerminationCondition
- Parameters:
algorithm
- the algorithm
-
shouldTerminate
Description copied from interface:TerminationCondition
Invoked after every step to check if the algorithm should terminate.- Specified by:
shouldTerminate
in interfaceTerminationCondition
- Parameters:
algorithm
- the algorithm- Returns:
true
if the algorithm should terminate;false
otherwise
-