pub struct ScalarVariableContext<S> {Show 16 fields
pub descriptor_index: usize,
pub variable_index: usize,
pub entity_type_name: &'static str,
pub entity_count: fn(&S) -> usize,
pub variable_name: &'static str,
pub getter: ScalarGetter<S>,
pub setter: ScalarSetter<S>,
pub value_source: ValueSource<S>,
pub allows_unassigned: bool,
pub candidate_values: Option<ScalarCandidateValues<S>>,
pub nearby_value_candidates: Option<ScalarCandidateValues<S>>,
pub nearby_entity_candidates: Option<ScalarCandidateValues<S>>,
pub nearby_value_distance_meter: Option<NearbyValueDistanceMeter<S>>,
pub nearby_entity_distance_meter: Option<NearbyEntityDistanceMeter<S>>,
pub construction_entity_order_key: Option<ConstructionEntityOrderKey<S>>,
pub construction_value_order_key: Option<ConstructionValueOrderKey<S>>,
}Fields§
§descriptor_index: usize§variable_index: usize§entity_type_name: &'static str§entity_count: fn(&S) -> usize§variable_name: &'static str§getter: ScalarGetter<S>§setter: ScalarSetter<S>§value_source: ValueSource<S>§allows_unassigned: bool§candidate_values: Option<ScalarCandidateValues<S>>§nearby_value_candidates: Option<ScalarCandidateValues<S>>§nearby_entity_candidates: Option<ScalarCandidateValues<S>>§nearby_value_distance_meter: Option<NearbyValueDistanceMeter<S>>§nearby_entity_distance_meter: Option<NearbyEntityDistanceMeter<S>>§construction_entity_order_key: Option<ConstructionEntityOrderKey<S>>§construction_value_order_key: Option<ConstructionValueOrderKey<S>>Implementations§
Source§impl<S> ScalarVariableContext<S>
impl<S> ScalarVariableContext<S>
pub fn new( descriptor_index: usize, variable_index: usize, entity_type_name: &'static str, entity_count: fn(&S) -> usize, variable_name: &'static str, getter: ScalarGetter<S>, setter: ScalarSetter<S>, value_source: ValueSource<S>, allows_unassigned: bool, ) -> Self
pub fn with_nearby_value_distance_meter( self, meter: NearbyValueDistanceMeter<S>, ) -> Self
pub fn with_candidate_values(self, provider: ScalarCandidateValues<S>) -> Self
pub fn with_nearby_value_candidates( self, provider: ScalarCandidateValues<S>, ) -> Self
pub fn with_nearby_entity_candidates( self, provider: ScalarCandidateValues<S>, ) -> Self
pub fn with_nearby_entity_distance_meter( self, meter: NearbyEntityDistanceMeter<S>, ) -> Self
pub fn with_construction_entity_order_key( self, order_key: ConstructionEntityOrderKey<S>, ) -> Self
pub fn with_construction_value_order_key( self, order_key: ConstructionValueOrderKey<S>, ) -> Self
pub fn matches_target( &self, entity_class: Option<&str>, variable_name: Option<&str>, ) -> bool
pub fn current_value(&self, solution: &S, entity_index: usize) -> Option<usize>
pub fn set_value( &self, solution: &mut S, entity_index: usize, value: Option<usize>, )
pub fn values_for_entity(&self, solution: &S, entity_index: usize) -> Vec<usize>
pub fn candidate_values_for_entity( &self, solution: &S, entity_index: usize, value_candidate_limit: Option<usize>, ) -> Vec<usize>
pub fn has_values_for_entity(&self, solution: &S, entity_index: usize) -> bool
pub fn value_is_legal( &self, solution: &S, entity_index: usize, candidate: Option<usize>, ) -> bool
pub fn nearby_value_distance( &self, solution: &S, entity_index: usize, value: usize, ) -> Option<f64>
pub fn nearby_entity_distance( &self, solution: &S, left_entity_index: usize, right_entity_index: usize, ) -> Option<f64>
pub fn construction_entity_order_key( &self, solution: &S, entity_index: usize, ) -> Option<i64>
pub fn construction_value_order_key( &self, solution: &S, entity_index: usize, value: usize, ) -> Option<i64>
Trait Implementations§
Source§impl<S> Clone for ScalarVariableContext<S>
impl<S> Clone for ScalarVariableContext<S>
Source§impl<S> Debug for ScalarVariableContext<S>
impl<S> Debug for ScalarVariableContext<S>
impl<S> Copy for ScalarVariableContext<S>
Auto Trait Implementations§
impl<S> Freeze for ScalarVariableContext<S>
impl<S> RefUnwindSafe for ScalarVariableContext<S>
impl<S> Send for ScalarVariableContext<S>
impl<S> Sync for ScalarVariableContext<S>
impl<S> Unpin for ScalarVariableContext<S>
impl<S> UnsafeUnpin for ScalarVariableContext<S>
impl<S> UnwindSafe for ScalarVariableContext<S>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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