Package edu.cnu.mdi.sim.simanneal
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 TypeMethodDescriptiondoubleCompute the energy of a solution.randomMove(Random rng, S current) Produce a random move for the current solution.randomSolution(Random rng) Produce a random solution (used for init temperature heuristic too).
-
Method Details
-
energy
Compute the energy of a solution.- Parameters:
sol- the solution to evaluate
-
randomSolution
Produce a random solution (used for init temperature heuristic too).- Parameters:
rng- the random number generator to use- Returns:
- a new random solution
-
randomMove
Produce a random move for the current solution.- Parameters:
rng- the random number generator to usecurrent- the current solution- Returns:
- a new random move
-