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,
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
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
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)
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
fn constraint_count(&self) -> usize
Number of named terminals in the set.
Source§fn metadata(&self) -> Vec<ConstraintMetadata<'_>>
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>>
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>>
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 weight_refs<'a>(&'a self, refs: &mut Vec<&'a ConstraintRef>)
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
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
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)
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>>
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>>
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> 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