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: at each step the
item with the highest effective score (after diversity penalty) is selected.
The penalty is score * (1 - bias * n / (n + 1)) where n is the number of
already-selected items in the same category. At bias=0 this collapses to a
single-pass sort (backward-compatible).
Tie-breaking is deterministic: size ascending, then id ascending.
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 moreSource§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
fn select( &self, inputs: Vec<SelectorInput<T>>, budget: usize, weights: &SelectorWeights, ) -> Result<SelectorOutput<T>, FoldError>
impl Copy for GreedySelector
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