SimulatedAnnealing

constructor(evaluator: EvaluatorIfc, initialTemperature: Double = defaultInitialTemperature, coolingSchedule: CoolingScheduleIfc = ExponentialCoolingSchedule(initialTemperature), stoppingTemperature: Double = defaultStoppingTemperature, maxIterations: Int = defaultMaxNumberIterations, replicationsPerEvaluation: Int = defaultReplicationsPerEvaluation, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Secondary constructor for the SimulatedAnnealing class. This constructor provides a simplified way to initialize the Simulated Annealing algorithm with configurable parameters, while delegating certain default parameters to their respective values or functional objects.

Parameters

evaluator

An implementation of the EvaluatorIfc interface, used to evaluate candidate solutions.

initialTemperature

The starting temperature for the simulated annealing process. Must be a positive value.

coolingSchedule

Defines the cooling mechanism to reduce the temperature during the iteration process. Defaults to an ExponentialCoolingSchedule with the specified initialTemperature.

stoppingTemperature

The temperature at which the simulated annealing process stops. Defaults to 0.001.

maxIterations

The maximum number of iterations for the simulated annealing process. Defaults to a predefined constant.

replicationsPerEvaluation

The number of replications to be performed for each evaluation of the objective function. Ensures robustness in the evaluation process.

streamNum

The stream number used for managing random number generation streams. Defaults to 0.

streamProvider

Provides the random number generator streams. Defaults to the KSLRandom.DefaultRNStreamProvider.

name

An optional name for the simulated annealing process, useful for identification or debugging. Defaults to null.


constructor(evaluator: EvaluatorIfc, initialTemperature: Double = defaultInitialTemperature, coolingSchedule: CoolingScheduleIfc = ExponentialCoolingSchedule(initialTemperature), stoppingTemperature: Double = defaultStoppingTemperature, maxIterations: Int = defaultMaxNumberIterations, replicationsPerEvaluation: ReplicationPerEvaluationIfc, streamNum: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Constructs a SimulatedAnnealing solver with the specified parameters.

Parameters

evaluator

The evaluator responsible for calculating the objective function value of a solution. It must implement the EvaluatorIfc interface.

initialTemperature

The starting temperature for the simulated annealing algorithm. Must be greater than 0.0.

coolingSchedule

the cooling schedule for the annealing process

stoppingTemperature

the temperature used to stop the annealing process. If the current temperature goes below this temperature, the search process stops.

maxIterations

the maximum number of iterations permitted for the search process

replicationsPerEvaluation

An instance of ReplicationPerEvaluationIfc defining the strategy for determining the number of replications per evaluation.

rnStream

An optional random number stream used for stochastic behavior. Defaults to KSLRandom.defaultRNStream().

name

An optional name for this solver instance.