Package org.opt4j.optimizer.sa
Class CoolingScheduleLinear
- java.lang.Object
-
- org.opt4j.optimizer.sa.CoolingScheduleLinear
-
- All Implemented Interfaces:
CoolingSchedule
- Direct Known Subclasses:
CoolingScheduleDefault
public class CoolingScheduleLinear extends Object implements CoolingSchedule
The
CoolingScheduleLinear
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
t0 - (t0 - tn)*(i/n)
.
-
-
Constructor Summary
Constructors Constructor Description CoolingScheduleLinear(double t0, double tn)
Constructs a newCoolingScheduleLinear
.
-
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
-
CoolingScheduleLinear
@Inject public CoolingScheduleLinear(double t0, double tn)
Constructs a newCoolingScheduleLinear
.- Parameters:
t0
- the initial temperature (using namespaceCoolingSchedule
)tn
- the final temperature (using namespaceCoolingSchedule
)
-
-
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
-
-