pub struct VariableDescriptor {
pub name: &'static str,
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>,
}Expand description
Describes a planning variable at runtime.
Fields§
§name: &'static strName of the variable (field name).
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.
Implementations§
Source§impl VariableDescriptor
impl VariableDescriptor
Sourcepub fn chained(name: &'static str) -> Self
pub fn chained(name: &'static str) -> Self
Creates a new chained variable descriptor.
Chained variables form chains rooted at anchor problem facts. For example, in vehicle routing: Vehicle ← Customer1 ← Customer2
Sourcepub fn shadow(name: &'static str, kind: ShadowVariableKind) -> Self
pub fn shadow(name: &'static str, kind: ShadowVariableKind) -> Self
Creates a new shadow variable descriptor.
Sourcepub fn with_value_range(self, provider: &'static str) -> Self
pub fn with_value_range(self, provider: &'static str) -> Self
Sets the value range provider reference.
Sourcepub fn with_allows_unassigned(self, allows: bool) -> Self
pub fn with_allows_unassigned(self, allows: bool) -> Self
Sets whether unassigned values are allowed.
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 value range type.
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 variable for shadow variables.
Trait Implementations§
Source§impl Clone for VariableDescriptor
impl Clone for VariableDescriptor
Source§fn clone(&self) -> VariableDescriptor
fn clone(&self) -> VariableDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more