#[non_exhaustive]pub struct Model {
pub named_variables: SymbolTable,
pub constraints: Vec<Constraint>,
pub tuple_tables: Vec<(String, Vec<Tuple>)>,
pub optimise: Option<Optimise>,
}Expand description
A Minion model.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.named_variables: SymbolTable§constraints: Vec<Constraint>§tuple_tables: Vec<(String, Vec<Tuple>)>Named tuple tables. Needed by tuple-based constraints that
reference a table by name rather than carry tuples inline
(most notably CT_STR / Str2Plus). Register a table with
Model::add_tuple_table, then reference it from a
constraint via Var::NameRef(table_name).
Storage order is preserved so the order in which tables are
installed into the CSPInstance matches insertion order.
optimise: Option<Optimise>Optional single-objective optimisation directive. When set,
minion treats the run as MINIMISING/MAXIMISING on the
chosen variable; the best objective value found is reported
via [SolverContext::get_from_table] under the key
"OptimumValue" (with "OptimumDirection" returning
"min" or "max").
Implementations§
Source§impl Model
impl Model
Sourcepub fn add_tuple_table(
&mut self,
name: String,
tuples: Vec<Tuple>,
) -> Option<()>
pub fn add_tuple_table( &mut self, name: String, tuples: Vec<Tuple>, ) -> Option<()>
Registers a named tuple table on the model. The table is
copied into Minion’s CSPInstance at solve time so constraints
like Str2Plus(vars, Var::NameRef(name)) can look it up.
Returns None if a table with that name is already registered.
Trait Implementations§
impl Eq for Model
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 176 bytes