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 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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VariableDescriptor
impl RefUnwindSafe for VariableDescriptor
impl Send for VariableDescriptor
impl Sync for VariableDescriptor
impl Unpin for VariableDescriptor
impl UnwindSafe for VariableDescriptor
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