Package org.opt4j.optimizer.sa
Class CoolingScheduleExponential
- java.lang.Object
-
- org.opt4j.optimizer.sa.CoolingScheduleExponential
-
- All Implemented Interfaces:
CoolingSchedule
public class CoolingScheduleExponential extends Object implements CoolingSchedule
The
CoolingScheduleExponential
is aCoolingSchedule
for theSimulatedAnnealing
.tn - final temperature
t0 - initial temperature
i - current iteration
n - maximal number of iterations
a - alpha value
The current temperature is calculated by
tn + t0 * a^i
.
-
-
Constructor Summary
Constructors Constructor Description CoolingScheduleExponential(double t0, double tn, double alpha)
Constructs a newCoolingScheduleExponential
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getTemperature(int i, int n)
Returns the temperature for the iterationi
of the maximal number of iterationsn
.
-
-
-
Constructor Detail
-
CoolingScheduleExponential
@Inject public CoolingScheduleExponential(double t0, double tn, double alpha)
Constructs a newCoolingScheduleExponential
.- Parameters:
t0
- the initial temperature (using namespaceCoolingSchedule
)tn
- the final temperature (using namespaceCoolingSchedule
) )alpha
- the alpha value
-
-
Method Detail
-
getTemperature
public double getTemperature(int i, int n)
Description copied from interface:CoolingSchedule
Returns the temperature for the iterationi
of the maximal number of iterationsn
.- Specified by:
getTemperature
in interfaceCoolingSchedule
- Parameters:
i
- the current iterationn
- the maximal number of iterations- Returns:
- the temperature for the current iteration
-
-