Skip to main content

OperatorTerminal

Struct OperatorTerminal 

Source
pub struct OperatorTerminal<S, O, W, Sc> { /* private fields */ }
Expand description

Scoring terminal over a concrete operator tree, independent of row arity. Weight closures borrow the complete row; retention stores signed scores, never entities or solution references.

Implementations§

Source§

impl<S, O, W, Sc> OperatorTerminal<S, O, W, Sc>

Source

pub fn new( constraint_ref: ConstraintRef, impact: ImpactType, operator: O, weight: W, hard: bool, ) -> Self

Trait Implementations§

Source§

impl<S, O, W, Sc> IncrementalConstraint<S, Sc> for OperatorTerminal<S, O, W, Sc>
where S: Send + Sync + 'static, O: Operator<S> + Send + Sync, W: for<'a> Fn(&S, &O::View<'a>) -> Sc + Send + Sync, Sc: Score, for<'a> O::View<'a>: ExplainRow,

Source§

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

Source§

fn match_count(&self, solution: &S) -> usize

Source§

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

Source§

fn on_retract(&mut self, solution: &S, index: usize, descriptor: usize) -> Sc

Source§

fn on_insert(&mut self, solution: &S, index: usize, descriptor: usize) -> Sc

Source§

fn reset(&mut self)

Source§

fn name(&self) -> &str

Source§

fn constraint_ref(&self) -> &ConstraintRef

Source§

fn is_hard(&self) -> bool

Source§

fn get_matches<'a>( &'a self, solution: &S, ) -> Vec<DetailedConstraintMatch<'a, Sc>>

Source§

fn weight(&self) -> Sc

Auto Trait Implementations§

§

impl<S, O, W, Sc> Freeze for OperatorTerminal<S, O, W, Sc>
where O: Freeze, W: Freeze, HandleMap<Sc>: Freeze, PhantomData<fn() -> S>: Freeze,

§

impl<S, O, W, Sc> RefUnwindSafe for OperatorTerminal<S, O, W, Sc>
where O: RefUnwindSafe, W: RefUnwindSafe, HandleMap<Sc>: RefUnwindSafe, PhantomData<fn() -> S>: RefUnwindSafe,

§

impl<S, O, W, Sc> Send for OperatorTerminal<S, O, W, Sc>
where O: Send, W: Send, HandleMap<Sc>: Send, PhantomData<fn() -> S>: Send,

§

impl<S, O, W, Sc> Sync for OperatorTerminal<S, O, W, Sc>
where O: Sync, W: Sync, HandleMap<Sc>: Sync, PhantomData<fn() -> S>: Sync,

§

impl<S, O, W, Sc> Unpin for OperatorTerminal<S, O, W, Sc>
where O: Unpin, W: Unpin, HandleMap<Sc>: Unpin, PhantomData<fn() -> S>: Unpin,

§

impl<S, O, W, Sc> UnsafeUnpin for OperatorTerminal<S, O, W, Sc>
where O: UnsafeUnpin, W: UnsafeUnpin, HandleMap<Sc>: UnsafeUnpin, PhantomData<fn() -> S>: UnsafeUnpin,

§

impl<S, O, W, Sc> UnwindSafe for OperatorTerminal<S, O, W, Sc>
where O: UnwindSafe, W: UnwindSafe, HandleMap<Sc>: UnwindSafe, PhantomData<fn() -> S>: 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<S, Sc, C> ConstraintSet<S, Sc> for C
where S: Send + Sync, Sc: Score, C: IncrementalConstraint<S, Sc>,

Source§

fn evaluate_all(&self, solution: &S) -> Sc

Source§

fn constraint_count(&self) -> usize

Source§

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

Source§

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

Source§

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

Source§

fn initialize_all(&mut self, solution: &S) -> Sc

Source§

fn on_insert_all( &mut self, solution: &S, entity_index: usize, descriptor_index: usize, ) -> Sc

Source§

fn on_retract_all( &mut self, solution: &S, entity_index: usize, descriptor_index: usize, ) -> Sc

Source§

fn reset_all(&mut self)

Source§

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

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.