Skip to main content

ScorerChain

Struct ScorerChain 

Source
pub struct ScorerChain<T>(/* private fields */);
Expand description

Two scorer sets over one operator, scored left then right: the chain a shared terminal grows by one OperatorScorer per named terminal.

Trait Implementations§

Source§

impl<S, O, Left, Right, Sc> OperatorScorerSet<S, O, Sc> for ScorerChain<(Left, Right)>
where S: Send + Sync + 'static, O: Operator<S> + Send + Sync, Left: OperatorScorerSet<S, O, Sc>, Right: OperatorScorerSet<S, O, Sc>, Sc: Score,

Source§

fn evaluate(&self, operator: &O, solution: &S) -> Sc

Sums every terminal over the operator’s current rows, without retained state.
Source§

fn initialize(&mut self, operator: &O, solution: &S) -> Sc

Scores every current row, retains each row’s score, and returns the sum.
Source§

fn apply_changes( &mut self, operator: &O, solution: &S, removed: &[RowHandle], inserted: &[RowHandle], ) -> (Sc, bool)

Retracts the retained scores of removed, scores inserted, and returns the summed delta with an overflow flag.
Source§

fn constraint_count(&self) -> usize

Number of named terminals in the set.
Source§

fn metadata(&self) -> Vec<ConstraintMetadata<'_>>

One metadata entry per terminal, in authored order.
Source§

fn evaluate_each<'a>( &'a self, operator: &O, solution: &S, ) -> Vec<ConstraintResult<'a, Sc>>

Each terminal’s total, in authored order.
Source§

fn evaluate_detailed<'a>( &'a self, operator: &O, solution: &S, ) -> Vec<ConstraintAnalysis<'a, Sc>>

Each terminal’s total with its matches, in authored order: one match per row whose coded weight is not zero, justified by the entities the row was built from, so a terminal’s match scores sum to its total.
Source§

fn reset(&mut self)

Drops every retained row score.
Source§

fn weight_refs<'a>(&'a self, refs: &mut Vec<&'a ConstraintRef>)

Appends each terminal’s constraint reference, one weight slot each.
Source§

fn evaluate_weighted( &self, operator: &O, solution: &S, multipliers: &[u32], ) -> Sc

evaluate with each terminal scaled by its multiplier.
Source§

fn initialize_weighted( &mut self, operator: &O, solution: &S, multipliers: &[u32], ) -> Sc

initialize with each terminal scaled by its multiplier.
Source§

fn apply_changes_weighted( &mut self, operator: &O, solution: &S, removed: &[RowHandle], inserted: &[RowHandle], multipliers: &[u32], ) -> (Sc, bool)

apply_changes with each terminal scaled by its multiplier.
Source§

fn evaluate_each_weighted<'a>( &'a self, operator: &O, solution: &S, multipliers: &[u32], ) -> Vec<ConstraintResult<'a, Sc>>

evaluate_each with each terminal scaled by its multiplier.
Source§

fn evaluate_detailed_weighted<'a>( &'a self, operator: &O, solution: &S, multipliers: &[u32], ) -> Vec<ConstraintAnalysis<'a, Sc>>

evaluate_detailed with each terminal scaled by its multiplier.

Auto Trait Implementations§

§

impl<T> Forget for ScorerChain<T>

§

impl<T> Freeze for ScorerChain<T>
where T: Freeze,

§

impl<T> Move for ScorerChain<T>

§

impl<T> RefUnwindSafe for ScorerChain<T>
where T: RefUnwindSafe,

§

impl<T> Send for ScorerChain<T>
where T: Send,

§

impl<T> Sync for ScorerChain<T>
where T: Sync,

§

impl<T> Unpin for ScorerChain<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for ScorerChain<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for ScorerChain<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.