Interface AnnealingProblem<S extends AnnealingSolution<S>>

Type Parameters:
S - the type of annealing solution
All Known Implementing Classes:
TspAnnealingProblem

public interface AnnealingProblem<S extends AnnealingSolution<S>>
An annealing problem defines the energy function and move generation for simulated annealing.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    energy(S sol)
    Compute the energy of a solution.
    randomMove(Random rng, S current)
    Produce a random move for the current solution.
    Produce a random solution (used for init temperature heuristic too).
  • Method Details

    • energy

      double energy(S sol)
      Compute the energy of a solution.
      Parameters:
      sol - the solution to evaluate
    • randomSolution

      S randomSolution(Random rng)
      Produce a random solution (used for init temperature heuristic too).
      Parameters:
      rng - the random number generator to use
      Returns:
      a new random solution
    • randomMove

      AnnealingMove<S> randomMove(Random rng, S current)
      Produce a random move for the current solution.
      Parameters:
      rng - the random number generator to use
      current - the current solution
      Returns:
      a new random move