pub struct CompetitiveSelectionRanked {
pub scores: Vec<u64>,
pub selected: Vec<bool>,
pub k: usize,
pub max_score: u64,
}Expand description
Ranked competitive selection: pick the top-K candidates by score.
Fields§
§scores: Vec<u64>Candidate scores by candidate index.
selected: Vec<bool>Current selected membership by candidate index.
k: usizeMaximum selected cardinality.
max_score: u64MaxScore for this refinement profile.
Implementations§
Source§impl CompetitiveSelectionRanked
impl CompetitiveSelectionRanked
Sourcepub fn new(
scores: Vec<u64>,
k: usize,
max_score: u64,
) -> CompetitiveSelectionRanked
pub fn new( scores: Vec<u64>, k: usize, max_score: u64, ) -> CompetitiveSelectionRanked
Construct from scores; nothing selected yet (TLA+ Init).
Sourcepub fn select(&mut self)
pub fn select(&mut self)
Select the top-K (TLA+ Select): mark up to K highest-scoring candidates, re-establishing BoundedMultiplicity and ThresholdOptimality.
Sourcepub fn update_scores(&mut self, new_scores: Vec<u64>)
pub fn update_scores(&mut self, new_scores: Vec<u64>)
Replace the scores and clear the selection (TLA+ UpdateScores).
Auto Trait Implementations§
impl Freeze for CompetitiveSelectionRanked
impl RefUnwindSafe for CompetitiveSelectionRanked
impl Send for CompetitiveSelectionRanked
impl Sync for CompetitiveSelectionRanked
impl Unpin for CompetitiveSelectionRanked
impl UnsafeUnpin for CompetitiveSelectionRanked
impl UnwindSafe for CompetitiveSelectionRanked
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more