pub trait FitnessValue:
PartialOrd
+ Clone
+ Send
+ Sync
+ Debug
+ Serialize
+ DeserializeOwned
+ 'static {
// Required methods
fn to_f64(&self) -> f64;
fn is_better_than(&self, other: &Self) -> bool;
// Provided method
fn is_worse_than(&self, other: &Self) -> bool { ... }
}Expand description
Trait bound for fitness values
Fitness values must be comparable and convertible to f64 for probabilistic selection operations. They must also be serializable for checkpointing.
Required Methods§
Sourcefn is_better_than(&self, other: &Self) -> bool
fn is_better_than(&self, other: &Self) -> bool
Check if this fitness is better than another
Provided Methods§
Sourcefn is_worse_than(&self, other: &Self) -> bool
fn is_worse_than(&self, other: &Self) -> bool
Check if this fitness is worse than another
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.