pub trait OptModel<'a>: Sync + Send {
type SolutionType: Clone + Sync + Send;
// Required methods
fn generate_trial_solution<R: Rng>(
&self,
current_solution: Self::SolutionType,
rng: &mut R,
) -> Self::SolutionType;
fn evaluate<R: Rng>(
&self,
solution: &Self::SolutionType,
rng: &mut R,
) -> NotNan<f64>;
}Expand description
OptModel is a trait that defines requirements to be used with optimization algorithm
Required Associated Types§
Sourcetype SolutionType: Clone + Sync + Send
type SolutionType: Clone + Sync + Send
Type of the Solution
Required Methods§
Sourcefn generate_trial_solution<R: Rng>(
&self,
current_solution: Self::SolutionType,
rng: &mut R,
) -> Self::SolutionType
fn generate_trial_solution<R: Rng>( &self, current_solution: Self::SolutionType, rng: &mut R, ) -> Self::SolutionType
Generate a new trial solution from current solution
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.