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 strName of the variable (field name).
logical_id: Option<VariableId>Logical variable ID for dynamic binding models.
variable_type: VariableTypeType of the variable.
allows_unassigned: boolWhether the variable can be unassigned (null).
value_range_provider: Option<&'static str>Reference to the value range provider.
value_range_type: ValueRangeTypeThe 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
impl VariableDescriptor
Sourcepub fn genuine(name: &'static str) -> Self
pub fn genuine(name: &'static str) -> Self
Creates a genuine scalar variable that must be assigned and has no hooks.
Sourcepub fn shadow(name: &'static str, kind: ShadowVariableKind) -> Self
pub fn shadow(name: &'static str, kind: ShadowVariableKind) -> Self
Creates a shadow variable of the given kind; shadow variables may be unassigned.
Sourcepub fn with_value_range(self, provider: &'static str) -> Self
pub fn with_value_range(self, provider: &'static str) -> Self
Names the value range provider that supplies this variable’s values.
Sourcepub fn with_allows_unassigned(self, allows: bool) -> Self
pub fn with_allows_unassigned(self, allows: bool) -> Self
Sets whether the variable may stay unassigned.
Sourcepub fn with_logical_id(self, logical_id: VariableId) -> Self
pub fn with_logical_id(self, logical_id: VariableId) -> Self
Sets the logical variable ID used by dynamic bindings.
Sourcepub fn piggyback(name: &'static str, source_shadow: &'static str) -> Self
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.
Sourcepub fn with_value_range_type(self, value_range_type: ValueRangeType) -> Self
pub fn with_value_range_type(self, value_range_type: ValueRangeType) -> Self
Sets the kind of value range.
Sourcepub fn with_source(self, entity: &'static str, variable: &'static str) -> Self
pub fn with_source(self, entity: &'static str, variable: &'static str) -> Self
Sets the source entity type and variable a shadow variable derives from.
Sourcepub fn with_usize_accessors(
self,
getter: UsizeGetter,
setter: UsizeSetter,
) -> Self
pub fn with_usize_accessors( self, getter: UsizeGetter, setter: UsizeSetter, ) -> Self
Sets the scalar getter and setter.
Sourcepub fn with_entity_value_provider(
self,
provider: UsizeEntityValueProvider,
) -> Self
pub fn with_entity_value_provider( self, provider: UsizeEntityValueProvider, ) -> Self
Sets the entity-field value provider.
Sourcepub fn with_candidate_values(self, provider: UsizeCandidateValues) -> Self
pub fn with_candidate_values(self, provider: UsizeCandidateValues) -> Self
Sets the bounded candidate-values hook.
Sourcepub fn with_nearby_value_candidates(
self,
provider: UsizeCandidateValues,
) -> Self
pub fn with_nearby_value_candidates( self, provider: UsizeCandidateValues, ) -> Self
Sets the nearby-value candidates hook.
Sourcepub fn with_nearby_entity_candidates(
self,
provider: UsizeCandidateValues,
) -> Self
pub fn with_nearby_entity_candidates( self, provider: UsizeCandidateValues, ) -> Self
Sets the nearby-entity candidates hook.
Sourcepub fn with_nearby_value_distance_meter(
self,
meter: UsizeNearbyValueDistanceMeter,
) -> Self
pub fn with_nearby_value_distance_meter( self, meter: UsizeNearbyValueDistanceMeter, ) -> Self
Sets the nearby-value distance meter.
Sourcepub fn with_nearby_entity_distance_meter(
self,
meter: UsizeNearbyEntityDistanceMeter,
) -> Self
pub fn with_nearby_entity_distance_meter( self, meter: UsizeNearbyEntityDistanceMeter, ) -> Self
Sets the nearby-entity distance meter.
Sourcepub fn with_construction_entity_order_key(
self,
order_key: UsizeConstructionEntityOrderKey,
) -> Self
pub fn with_construction_entity_order_key( self, order_key: UsizeConstructionEntityOrderKey, ) -> Self
Sets the construction entity order key.
Sourcepub fn with_construction_value_order_key(
self,
order_key: UsizeConstructionValueOrderKey,
) -> Self
pub fn with_construction_value_order_key( self, order_key: UsizeConstructionValueOrderKey, ) -> Self
Sets the construction value order key.