Skip to main content

VariableDescriptor

Struct VariableDescriptor 

Source
pub struct VariableDescriptor {
Show 20 fields pub name: &'static str, pub logical_id: Option<VariableId>, pub variable_type: VariableType, pub allows_unassigned: bool, pub value_range_provider: Option<&'static str>, pub value_range_type: ValueRangeType, pub source_variable: Option<&'static str>, pub source_entity: Option<&'static str>, pub usize_getter: Option<UsizeGetter>, pub usize_setter: Option<UsizeSetter>, pub entity_value_provider: Option<UsizeEntityValueProvider>, pub candidate_values: Option<UsizeCandidateValues>, pub nearby_value_candidates: Option<UsizeCandidateValues>, pub nearby_entity_candidates: Option<UsizeCandidateValues>, pub nearby_value_distance_meter: Option<UsizeNearbyValueDistanceMeter>, pub nearby_entity_distance_meter: Option<UsizeNearbyEntityDistanceMeter>, pub construction_entity_order_key: Option<UsizeConstructionEntityOrderKey>, pub construction_value_order_key: Option<UsizeConstructionValueOrderKey>, pub search_entity_order_key: Option<UsizeSearchEntityOrderKey>, pub search_value_order_key: Option<UsizeSearchValueOrderKey>,
}
Expand description

Describes a planning variable at runtime.

Fields§

§name: &'static str

Name of the variable (field name).

§logical_id: Option<VariableId>

Logical variable ID for dynamic binding models.

§variable_type: VariableType

Type of the variable.

§allows_unassigned: bool

Whether the variable can be unassigned (null).

§value_range_provider: Option<&'static str>

Reference to the value range provider.

§value_range_type: ValueRangeType

The type of value range.

§source_variable: Option<&'static str>

For shadow variables: the source variable name.

§source_entity: Option<&'static str>

For shadow variables: the source entity type name.

§usize_getter: Option<UsizeGetter>

Dynamic accessors for canonical scalar-variable solving.

§usize_setter: Option<UsizeSetter>

Scalar value setter, paired with usize_getter.

§entity_value_provider: Option<UsizeEntityValueProvider>

Legal values read from an entity field, when the value range provider is an entity field.

§candidate_values: Option<UsizeCandidateValues>

Bounded per-entity candidate values used instead of the full value range.

§nearby_value_candidates: Option<UsizeCandidateValues>

Bounded nearby-value candidates for local search.

§nearby_entity_candidates: Option<UsizeCandidateValues>

Bounded nearby-entity candidates for local search; the slice holds entity indexes.

§nearby_value_distance_meter: Option<UsizeNearbyValueDistanceMeter>

Ranks nearby-value candidates; it does not bound them.

§nearby_entity_distance_meter: Option<UsizeNearbyEntityDistanceMeter>

Ranks nearby-entity candidates; it does not bound them.

§construction_entity_order_key: Option<UsizeConstructionEntityOrderKey>

Entity ranking for construction heuristics that order entities.

§construction_value_order_key: Option<UsizeConstructionValueOrderKey>

Value ranking for construction heuristics that order values (weakest/strongest fit, queue allocation).

§search_entity_order_key: Option<UsizeSearchEntityOrderKey>

Entity ranking for local-search change and swap moves.

§search_value_order_key: Option<UsizeSearchValueOrderKey>

Value ranking for local-search change and swap moves.

Implementations§

Source§

impl VariableDescriptor

Source

pub fn genuine(name: &'static str) -> Self

Creates a genuine scalar variable that must be assigned and has no hooks.

Source

pub fn list(name: &'static str) -> Self

Creates a list variable with no hooks.

Source

pub fn shadow(name: &'static str, kind: ShadowVariableKind) -> Self

Creates a shadow variable of the given kind; shadow variables may be unassigned.

Source

pub fn with_value_range(self, provider: &'static str) -> Self

Names the value range provider that supplies this variable’s values.

Source

pub fn with_allows_unassigned(self, allows: bool) -> Self

Sets whether the variable may stay unassigned.

Source

pub fn with_logical_id(self, logical_id: VariableId) -> Self

Sets the logical variable ID used by dynamic bindings.

Source

pub fn piggyback(name: &'static str, source_shadow: &'static str) -> Self

Creates a piggyback shadow variable descriptor.

Piggyback shadows ride on another shadow variable’s listener, updated as a side-effect without their own dedicated listener.

Source

pub fn with_value_range_type(self, value_range_type: ValueRangeType) -> Self

Sets the kind of value range.

Source

pub fn with_source(self, entity: &'static str, variable: &'static str) -> Self

Sets the source entity type and variable a shadow variable derives from.

Source

pub fn with_usize_accessors( self, getter: UsizeGetter, setter: UsizeSetter, ) -> Self

Sets the scalar getter and setter.

Source

pub fn with_entity_value_provider( self, provider: UsizeEntityValueProvider, ) -> Self

Sets the entity-field value provider.

Source

pub fn with_candidate_values(self, provider: UsizeCandidateValues) -> Self

Sets the bounded candidate-values hook.

Source

pub fn with_nearby_value_candidates( self, provider: UsizeCandidateValues, ) -> Self

Sets the nearby-value candidates hook.

Source

pub fn with_nearby_entity_candidates( self, provider: UsizeCandidateValues, ) -> Self

Sets the nearby-entity candidates hook.

Source

pub fn with_nearby_value_distance_meter( self, meter: UsizeNearbyValueDistanceMeter, ) -> Self

Sets the nearby-value distance meter.

Source

pub fn with_nearby_entity_distance_meter( self, meter: UsizeNearbyEntityDistanceMeter, ) -> Self

Sets the nearby-entity distance meter.

Source

pub fn with_construction_entity_order_key( self, order_key: UsizeConstructionEntityOrderKey, ) -> Self

Sets the construction entity order key.

Source

pub fn with_construction_value_order_key( self, order_key: UsizeConstructionValueOrderKey, ) -> Self

Sets the construction value order key.

Trait Implementations§

Source§

impl Clone for VariableDescriptor

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VariableDescriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.