pub struct SimpleDecider<S: PlanningSolution, V: Clone + Send + Sync + 'static, B = ()> { /* private fields */ }Expand description
A simple value-based decider that works with any value type.
Uses typed setter for zero-erasure variable assignment.
§Type Parameters
S- The planning solution typeV- The value type to assignB- The bounder type (useOption<B>for optional bounding)
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 and no bounder.
§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)
Source§impl<S: PlanningSolution, V: Clone + Send + Sync + 'static, B> SimpleDecider<S, V, B>
impl<S: PlanningSolution, V: Clone + Send + Sync + 'static, B> SimpleDecider<S, V, B>
Sourcepub fn with_bounder<B2>(self, bounder: B2) -> SimpleDecider<S, V, B2>
pub fn with_bounder<B2>(self, bounder: B2) -> SimpleDecider<S, V, B2>
Sets the bounder for optimistic bound calculation.
Trait Implementations§
Source§impl<S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static, B: Debug> Debug for SimpleDecider<S, V, B>
impl<S: PlanningSolution, V: Clone + Send + Sync + Debug + 'static, B: Debug> Debug for SimpleDecider<S, V, B>
Source§impl<S, V, B> ExhaustiveSearchDecider<S> for SimpleDecider<S, V, B>
impl<S, V, B> ExhaustiveSearchDecider<S> for SimpleDecider<S, V, B>
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, B> Freeze for SimpleDecider<S, V, B>where
B: Freeze,
impl<S, V, B> RefUnwindSafe for SimpleDecider<S, V, B>where
B: RefUnwindSafe,
V: RefUnwindSafe,
impl<S, V, B> Send for SimpleDecider<S, V, B>where
B: Send,
impl<S, V, B> Sync for SimpleDecider<S, V, B>where
B: Sync,
impl<S, V, B> Unpin for SimpleDecider<S, V, B>
impl<S, V, B> UnwindSafe for SimpleDecider<S, V, B>where
B: UnwindSafe,
V: 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more