pub trait DeterministicObjective<T>: Objective<T>where
T: HasId,{
// Required methods
fn select_deterministic<'a>(
&self,
candidates: &'a [T],
context: &ObjectiveContext,
) -> ObjectiveResult<Selection<&'a T>>;
fn select_top_deterministic<'a>(
&self,
candidates: &'a [T],
n: usize,
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>;
}Expand description
Extension trait for deterministic selection with UUID tie-breaking.
Provides reproducible ordering when multiple candidates have equal scores.
Requires candidates to implement HasId for UUID-based tie-breaking.
Ordering is determined by:
- Score (descending) using canonical IEEE-754 total-order ranks
- UUID (ascending) for tie-breaking
Required Methods§
Sourcefn select_deterministic<'a>(
&self,
candidates: &'a [T],
context: &ObjectiveContext,
) -> ObjectiveResult<Selection<&'a T>>
fn select_deterministic<'a>( &self, candidates: &'a [T], context: &ObjectiveContext, ) -> ObjectiveResult<Selection<&'a T>>
Select the best candidate with deterministic tie-breaking.
Sourcefn select_top_deterministic<'a>(
&self,
candidates: &'a [T],
n: usize,
context: &ObjectiveContext,
) -> Vec<Selection<&'a T>>
fn select_top_deterministic<'a>( &self, candidates: &'a [T], n: usize, context: &ObjectiveContext, ) -> Vec<Selection<&'a T>>
Select the top N candidates with deterministic ordering.
Implementors§
impl<O, T> DeterministicObjective<T> for O
Blanket implementation of DeterministicObjective for any Objective