pub struct SchemeActionScorer<K, S> { /* private fields */ }Expand description
An [ActionScorer] that boosts scores for scheme-backed actions.
Wraps an inner scorer and, for each scored affordance, looks up argument
positions from ArgumentKnowledge. If any position maps to a registered
scheme, the affordance score is increased by:
max_boost * strength_multiplier * preference_weightThe highest boost across all positions wins. The returned list is sorted descending by final score.
Implementations§
Source§impl<K: ArgumentKnowledge, S> SchemeActionScorer<K, S>
impl<K: ArgumentKnowledge, S> SchemeActionScorer<K, S>
Sourcepub fn new(
knowledge: K,
registry: CatalogRegistry,
inner: S,
max_boost: f64,
) -> Self
pub fn new( knowledge: K, registry: CatalogRegistry, inner: S, max_boost: f64, ) -> Self
Create a new SchemeActionScorer.
§Parameters
knowledge– provides per-character argument positions.registry– the scheme catalog used to resolve scheme strengths.inner– the base scorer whose results are boosted.max_boost– the maximum additive score increase for a Strong scheme withpreference_weight = 1.0.
Trait Implementations§
Source§impl<K, S, P> ActionScorer<P> for SchemeActionScorer<K, S>where
K: ArgumentKnowledge,
S: ActionScorer<P>,
P: Clone,
impl<K, S, P> ActionScorer<P> for SchemeActionScorer<K, S>where
K: ArgumentKnowledge,
S: ActionScorer<P>,
P: Clone,
Source§fn score_actions(
&self,
actor: &str,
available: &[CatalogEntry<P>],
participants: &[String],
) -> Vec<ScoredAffordance<P>>
fn score_actions( &self, actor: &str, available: &[CatalogEntry<P>], participants: &[String], ) -> Vec<ScoredAffordance<P>>
Score available actions, boosting those with scheme backing.
Delegates to the inner scorer, then for each result looks up argument positions from the knowledge base and applies the best scheme boost. Returns results sorted descending by final score.
Auto Trait Implementations§
impl<K, S> Freeze for SchemeActionScorer<K, S>
impl<K, S> RefUnwindSafe for SchemeActionScorer<K, S>where
K: RefUnwindSafe,
S: RefUnwindSafe,
impl<K, S> Send for SchemeActionScorer<K, S>
impl<K, S> Sync for SchemeActionScorer<K, S>
impl<K, S> Unpin for SchemeActionScorer<K, S>
impl<K, S> UnsafeUnpin for SchemeActionScorer<K, S>where
K: UnsafeUnpin,
S: UnsafeUnpin,
impl<K, S> UnwindSafe for SchemeActionScorer<K, S>where
K: UnwindSafe,
S: 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