pub struct GreedySelector;Expand description
Budget-constrained greedy packer.
Filters by SelectorWeights.min_score, applies category_weights multipliers
to adjust scores, then greedily packs until the budget is exhausted. When
diversity_bias > 0, uses a pick-best-remaining loop instead of a single
sort pass. Tie-breaking is deterministic: effective score descending, size
ascending, then id ascending. See
crates/khive-fold/docs/design.md#adr-024-bayesian-extensions-selector-budget-packing-and-precision-weighted-scoring
for the diversity-penalty formula.
Trait Implementations§
Source§impl Clone for GreedySelector
impl Clone for GreedySelector
Source§fn clone(&self) -> GreedySelector
fn clone(&self) -> GreedySelector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for GreedySelector
Source§impl Debug for GreedySelector
impl Debug for GreedySelector
Source§impl Default for GreedySelector
impl Default for GreedySelector
Source§fn default() -> GreedySelector
fn default() -> GreedySelector
Returns the “default value” for a type. Read more
Source§impl<T: Clone> Selector<T> for GreedySelector
impl<T: Clone> Selector<T> for GreedySelector
Source§fn select(
&self,
inputs: Vec<SelectorInput<T>>,
budget: usize,
weights: &SelectorWeights,
) -> Result<SelectorOutput<T>, FoldError>
fn select( &self, inputs: Vec<SelectorInput<T>>, budget: usize, weights: &SelectorWeights, ) -> Result<SelectorOutput<T>, FoldError>
Select a budget-constrained subset from
inputs.Auto Trait Implementations§
impl Freeze for GreedySelector
impl RefUnwindSafe for GreedySelector
impl Send for GreedySelector
impl Sync for GreedySelector
impl Unpin for GreedySelector
impl UnsafeUnpin for GreedySelector
impl UnwindSafe for GreedySelector
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