pub struct ConstraintSetChain<Left, Right> { /* private fields */ }Expand description
Two constraint sets scored as one, left first then right.
Results, metadata entries and weight slots list every Left constraint
before every Right one. #[solverforge_constraints] builds these to join
member sets without erasing their concrete types.
Implementations§
Source§impl<Left, Right> ConstraintSetChain<Left, Right>
impl<Left, Right> ConstraintSetChain<Left, Right>
Trait Implementations§
Source§impl<S, Sc, Left, Right> ConstraintSet<S, Sc> for ConstraintSetChain<Left, Right>
impl<S, Sc, Left, Right> ConstraintSet<S, Sc> for ConstraintSetChain<Left, Right>
Source§fn evaluate_all(&self, solution: &S) -> Sc
fn evaluate_all(&self, solution: &S) -> Sc
Evaluates all constraints and returns the total score.
Source§fn constraint_count(&self) -> usize
fn constraint_count(&self) -> usize
Returns the number of constraints in this set.
Source§fn evaluate_each<'a>(&'a self, solution: &S) -> Vec<ConstraintResult<'a, Sc>>
fn evaluate_each<'a>(&'a self, solution: &S) -> Vec<ConstraintResult<'a, Sc>>
Evaluates each constraint individually and returns per-constraint results. Read more
Source§fn evaluate_detailed<'a>(
&'a self,
solution: &S,
) -> Vec<ConstraintAnalysis<'a, Sc>>
fn evaluate_detailed<'a>( &'a self, solution: &S, ) -> Vec<ConstraintAnalysis<'a, Sc>>
Evaluates each constraint with detailed match information. Read more
Source§fn initialize_all(&mut self, solution: &S) -> Sc
fn initialize_all(&mut self, solution: &S) -> Sc
Initializes all constraints by inserting all entities. Read more
Source§fn on_insert_all(
&mut self,
solution: &S,
entity_index: usize,
descriptor_index: usize,
) -> Sc
fn on_insert_all( &mut self, solution: &S, entity_index: usize, descriptor_index: usize, ) -> Sc
Called when an entity is inserted. Read more
Source§fn on_retract_all(
&mut self,
solution: &S,
entity_index: usize,
descriptor_index: usize,
) -> Sc
fn on_retract_all( &mut self, solution: &S, entity_index: usize, descriptor_index: usize, ) -> Sc
Called when an entity is retracted. Read more
Source§fn constraint_weight_refs<'a>(&'a self, refs: &mut Vec<&'a ConstraintRef>)
fn constraint_weight_refs<'a>(&'a self, refs: &mut Vec<&'a ConstraintRef>)
Runtime constraint weights. Read more
Source§fn evaluate_all_weighted(&self, solution: &S, multipliers: &[u32]) -> Sc
fn evaluate_all_weighted(&self, solution: &S, multipliers: &[u32]) -> Sc
Weighted
evaluate_all: multipliers holds one
multiplier per weight slot.Source§fn initialize_all_weighted(&mut self, solution: &S, multipliers: &[u32]) -> Sc
fn initialize_all_weighted(&mut self, solution: &S, multipliers: &[u32]) -> Sc
Weighted
initialize_all.Source§fn on_insert_all_weighted(
&mut self,
solution: &S,
entity_index: usize,
descriptor_index: usize,
multipliers: &[u32],
) -> Sc
fn on_insert_all_weighted( &mut self, solution: &S, entity_index: usize, descriptor_index: usize, multipliers: &[u32], ) -> Sc
Weighted
on_insert_all.Source§fn on_retract_all_weighted(
&mut self,
solution: &S,
entity_index: usize,
descriptor_index: usize,
multipliers: &[u32],
) -> Sc
fn on_retract_all_weighted( &mut self, solution: &S, entity_index: usize, descriptor_index: usize, multipliers: &[u32], ) -> Sc
Weighted
on_retract_all.Source§fn evaluate_each_weighted<'a>(
&'a self,
solution: &S,
multipliers: &[u32],
) -> Vec<ConstraintResult<'a, Sc>>
fn evaluate_each_weighted<'a>( &'a self, solution: &S, multipliers: &[u32], ) -> Vec<ConstraintResult<'a, Sc>>
Weighted
evaluate_each: weighted scores, with each
result’s weight_multiplier set from its slot.Source§fn evaluate_detailed_weighted<'a>(
&'a self,
solution: &S,
multipliers: &[u32],
) -> Vec<ConstraintAnalysis<'a, Sc>>
fn evaluate_detailed_weighted<'a>( &'a self, solution: &S, multipliers: &[u32], ) -> Vec<ConstraintAnalysis<'a, Sc>>
Weighted
evaluate_detailed: weighted totals and
match scores, with each analysis’s weight_multiplier set from its slot.Source§fn constraint_metadata(&self) -> Vec<ConstraintMetadata<'_>>
fn constraint_metadata(&self) -> Vec<ConstraintMetadata<'_>>
Returns deduplicated immutable metadata for constraints in this set.
Auto Trait Implementations§
impl<Left, Right> Freeze for ConstraintSetChain<Left, Right>
impl<Left, Right> RefUnwindSafe for ConstraintSetChain<Left, Right>where
Left: RefUnwindSafe,
Right: RefUnwindSafe,
impl<Left, Right> Send for ConstraintSetChain<Left, Right>
impl<Left, Right> Sync for ConstraintSetChain<Left, Right>
impl<Left, Right> Unpin for ConstraintSetChain<Left, Right>
impl<Left, Right> UnsafeUnpin for ConstraintSetChain<Left, Right>where
Left: UnsafeUnpin,
Right: UnsafeUnpin,
impl<Left, Right> UnwindSafe for ConstraintSetChain<Left, Right>where
Left: UnwindSafe,
Right: 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