template<Individual I, Fitness F>
struct ultra::scored_individual< I, F >
Associates an individual with its fitness value.
- Template Parameters
-
| I | type modelling an individual |
| F | type modelling a fitness value |
scored_individual is a lightweight value type used to represent the result of evaluating an individual. It is primarily intended for ranking, selection, and replacement operations in evolutionary algorithms.
The class supports ordering by fitness (via operator<=>) but deliberately does not define equality. Fitness values are typically floating-point and exact equality comparisons would be semantically misleading.
- Note
- Since equality is not defined, scored_individual does not model a totally ordered type and cannot be used with default std::ranges::less. Algorithms that require ordering should provide an explicit comparator or projection (e.g. comparing the fit member).