R/simulated_annealing_temperatures.R

Defines functions logisticTemperature quadraticTemperature linearTemperature

linearTemperature <- function(currentStep, maxSteps) {
  currentTemp <- (maxSteps - (currentStep)) / maxSteps
}

quadraticTemperature <- function(currentStep, maxSteps) {
  currentTemp <- ((maxSteps - (currentStep)) / maxSteps)^2
}

logisticTemperature <- function(currentStep, maxSteps) {
  x <- 1:maxSteps
  x.new <- scale(x, center = T, scale = maxSteps / 12)
  currentTemp <- 1 / (1 + exp((x.new[(currentStep + 1)])))
}

Try the ShortForm package in your browser

Any scripts or data that you put into this service are public.

ShortForm documentation built on June 22, 2024, 9:41 a.m.