All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.thepathfinder.simulatedannealing.LinearDecayScheduler Maven / Gradle / Ivy

There is a newer version: 0.0.3
Show newest version
package xyz.thepathfinder.simulatedannealing;

public class LinearDecayScheduler implements Scheduler {
    final double initialTemperature;
    final int totalSteps;

    public LinearDecayScheduler(double initialTemperature, int totalSteps) {
        this.initialTemperature = initialTemperature;
        this.totalSteps = totalSteps;
    }

    @Override
    public double getTemperature(int steps) {
        return (1 - ((double) steps) / totalSteps) * initialTemperature;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy