Struct Score Copy item path Source #[repr(transparent)]
pub struct Score {
pub values: Arc <[f32 ]>,
}Expand description A score is a value that can be used to compare the fitness of two individuals and represents
the ‘fitness’ of an individual within the genetic algorithm.
The score can be a single value or multiple values, depending on the problem being solved.
For ease of use the Score struct provides methods
to convert the score to a single value, an integer, a string, or a vector of f32 values.
Note: The reason it is a Vec is for multi-objective optimization problems. This allows for multiple
fitness values to be returned from the fitness function.
The resulting type after applying the + operator.
The resulting type after applying the + operator.
Converts this type into a shared reference of the (usually inferred) input type.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Returns the “default value” for a type.
Read more The resulting type after applying the / operator.
The resulting type after applying the / operator.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
The resulting type after applying the * operator.
The resulting type after applying the * operator.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
This method returns an ordering between
self and
other values if one exists.
Read more Tests less than (for
self and
other) and is used by the
< operator.
Read more Tests less than or equal to (for
self and
other) and is used by the
<= operator.
Read more Tests greater than (for
self and
other) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self and
other) and is used by
the
>= operator.
Read more The resulting type after applying the - operator.
The resulting type after applying the - operator.
Takes an iterator and generates Self from the elements by “summing up”
the items.
Takes an iterator and generates Self from the elements by “summing up”
the items.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.