Skip to main content

RunOptions

Struct RunOptions 

Source
pub struct RunOptions {
    pub seed: Option<u32>,
    pub var_order: VarOrder,
    pub val_order: ValOrder,
    pub randomise_order: bool,
    pub preprocess: Propagation,
    pub prop_node: Propagation,
    pub node_limit: u64,
    pub time_limit: Option<TimeLimit>,
}
Expand description

Knobs for a single solve. Extend as needed — using a struct keeps the public call surface stable when we add more options.

Fields§

§seed: Option<u32>

Seed for Minion’s random heuristics. None keeps Minion’s own default (currently std::random_device{}(), i.e. non-deterministic).

Pass Some(s) to make a solve reproducible — tests that want to diff two runs (e.g. “same prefix before the injection point”) must set the same seed for both runs.

§var_order: VarOrder

Variable-ordering heuristic. Defaults to VarOrder::Static.

§val_order: ValOrder

Value-ordering heuristic. Defaults to ValOrder::Ascend.

§randomise_order: bool

Shuffle the variable order and force a random value order, on top of var_order/val_order. Mirrors -randomiseorder, and is what exec mode’s -varorder random / -varorder sdf-random (etc.) set.

This is orthogonal to var_order: minion shuffles the search order once, when the instance is built, and overwrites every value order with VALORDER_RANDOM. Set seed too if you want it reproducible.

§preprocess: Propagation

One-shot propagation level applied before search begins. Default is None + no limit — no preprocessing beyond each constraint’s own fullPropagate.

§prop_node: Propagation

Propagation level applied at every search node. Default is GAC + no limit — each constraint runs its own propagator. Stronger levels (SAC, SSAC) add global propagation on top at every node; weaker levels (None) are not meaningful here (a solver has to propagate something).

§node_limit: u64

Abort search after this many nodes have been explored. 0 (default) means unlimited. Mirrors -nodelimit N.

A truncated run still returns normally; compare the reported Nodes against the limit to tell “finished” from “gave up”.

§time_limit: Option<TimeLimit>

Abort search after this many seconds of wall-clock or CPU time. None (default) means unlimited. is_cpu_time = true mirrors -cpulimit; false mirrors -timelimit. C++ exec mode rejects setting both; in this struct we accept whichever is non-None.

Unlike node_limit, a run that hits the time limit comes back as RuntimeError::Timeout — no context, and so no statistics.

Trait Implementations§

Source§

impl Clone for RunOptions

Source§

fn clone(&self) -> RunOptions

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 Copy for RunOptions

Source§

impl Debug for RunOptions

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RunOptions

Source§

fn default() -> Self

Returns the “default value” for a type. 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.

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: 32 bytes