pub struct SimpleDecider<S: PlanningSolution, V: Clone + Send + Sync + 'static> { /* private fields */ }Expand description
A simple value-based decider that works with any value type.
Uses typed setter for zero-erasure variable assignment.
Implementations§
Source§impl<S: PlanningSolution, V: Clone + Send + Sync + 'static> SimpleDecider<S, V>
impl<S: PlanningSolution, V: Clone + Send + Sync + 'static> SimpleDecider<S, V>
Sourcepub fn new(
descriptor_index: usize,
variable_name: impl Into<String>,
values: Vec<V>,
setter: fn(&mut S, usize, Option<V>),
) -> Self
pub fn new( descriptor_index: usize, variable_name: impl Into<String>, values: Vec<V>, setter: fn(&mut S, usize, Option<V>), ) -> Self
Creates a new simple decider with typed setter.
§Arguments
descriptor_index- Index of the entity descriptorvariable_name- Name of the variable being assignedvalues- Possible values to trysetter- Typed setter functionfn(&mut S, entity_index, value)
Sourcepub fn with_bounder(self, bounder: Box<dyn ScoreBounder<S>>) -> Self
pub fn with_bounder(self, bounder: Box<dyn ScoreBounder<S>>) -> Self
Sets the bounder for optimistic bound calculation.
Trait Implementations§
Source§impl<S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static> Debug for SimpleDecider<S, V>
impl<S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static> Debug for SimpleDecider<S, V>
Source§impl<S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static> ExhaustiveSearchDecider<S> for SimpleDecider<S, V>
impl<S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static> ExhaustiveSearchDecider<S> for SimpleDecider<S, V>
Source§fn expand(
&self,
parent_index: usize,
parent: &ExhaustiveSearchNode<S>,
score_director: &mut dyn ScoreDirector<S>,
) -> Vec<ExhaustiveSearchNode<S>>
fn expand( &self, parent_index: usize, parent: &ExhaustiveSearchNode<S>, score_director: &mut dyn ScoreDirector<S>, ) -> Vec<ExhaustiveSearchNode<S>>
Expands a node by generating all child nodes. Read more
Source§fn total_entities(&self, score_director: &dyn ScoreDirector<S>) -> usize
fn total_entities(&self, score_director: &dyn ScoreDirector<S>) -> usize
Returns the total number of entities to assign.
Auto Trait Implementations§
impl<S, V> Freeze for SimpleDecider<S, V>
impl<S, V> !RefUnwindSafe for SimpleDecider<S, V>
impl<S, V> Send for SimpleDecider<S, V>
impl<S, V> !Sync for SimpleDecider<S, V>
impl<S, V> Unpin for SimpleDecider<S, V>where
V: Unpin,
impl<S, V> !UnwindSafe for SimpleDecider<S, V>
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