pub trait Problem {
type State;
// Required methods
fn initial_state(&self) -> Self::State;
fn energy(&self, state: &Self::State) -> f64;
fn new_state(&self, state: &Self::State) -> Self::State;
}Expand description
A problem represents something to be solved using simulated annealing, and provides methods to calculate the energy of a state and generate new states.
Required Associated Types§
Required Methods§
Sourcefn initial_state(&self) -> Self::State
fn initial_state(&self) -> Self::State
This function should generate an initial state for the problem.