Package org.moeaframework.algorithm.sa
Class TemperatureBasedTerminationCondition
java.lang.Object
org.moeaframework.algorithm.sa.TemperatureBasedTerminationCondition
- All Implemented Interfaces:
Configurable,Named,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
ConstructorsConstructorDescriptionConstructs 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 TypeMethodDescriptiondoublegetPercentComplete(Algorithm algorithm) Returns the percentage that this condition is complete, as a value between0.0and100.0.doubleReturns the stopping, or minimum, temperature at which point the algorithm stops.voidinitialize(Algorithm algorithm) Invoked when the algorithm is created to collect any initial conditions.voidsetStoppingTemperature(double stoppingTemperature) Sets the stopping, or minimum, temperature at which point the algorithm stops.booleanshouldTerminate(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, waitMethods inherited from interface org.moeaframework.core.configuration.Configurable
applyConfiguration, getConfigurationMethods inherited from interface org.moeaframework.core.termination.TerminationCondition
getName
-
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:TerminationConditionInvoked when the algorithm is created to collect any initial conditions. Note that the algorithm may not have been initialized at this point.- Specified by:
initializein interfaceTerminationCondition- Parameters:
algorithm- the algorithm
-
shouldTerminate
Description copied from interface:TerminationConditionInvoked after every step to check if the algorithm should terminate.- Specified by:
shouldTerminatein interfaceTerminationCondition- Parameters:
algorithm- the algorithm- Returns:
trueif the algorithm should terminate;falseotherwise
-
getPercentComplete
Description copied from interface:TerminationConditionReturns the percentage that this condition is complete, as a value between0.0and100.0. If the percentage can not be determined, returns 0d/0d.- Specified by:
getPercentCompletein interfaceTerminationCondition- Parameters:
algorithm- the algorithm- Returns:
- the percentage completion
-