Simulator constructor
Simulator(})
Simulator constructor.
field
: An object of typeEnergyField
encapsulating the energy function (cost function) and search space.
Optional parameters:
- gammaStart: Expectation value of the solution acceptance at the
- gammaEnd: Expectation value of the solution acceptance at the
- outerIterations: Number of iterations when cooling.
- innerIterationsStart: Number of iterations at constant temperature at the start of the annealing process.
- innerIterationsEnd: Number of iterations at constant temperature at the end of the annealing process.
- sampleSize: Size of sample used to estimate the start temperature and the final temperature of the annealing process.
Implementation
// initial temperature of the annealing process.
/// * gammaEnd: Expectation value of the solution acceptance at the
// final temperatures of the annealing process.
/// * outerIterations: Number of iterations when cooling.
/// * innerIterationsStart: Number of iterations at constant temperature
/// at the start of the annealing process.
/// * innerIterationsEnd: Number of iterations at constant temperature
/// at the end of the annealing process.
/// * sampleSize: Size of sample used to estimate the start temperature
/// and the final temperature of the annealing process.
Simulator(
this.field, {
this.gammaStart = 0.7,
this.gammaEnd = 0.2,
this.outerIterations = 750,
this.innerIterationsStart = 5,
this.innerIterationsEnd = 20,
this.sampleSize = 500,
}) {
/// Initial values:
_currentMinEnergy = field.value;
_currentMinPosition = field.position;
_acceptanceProbability = 1.0;
_startPosition = field.position;
}