Skip to main content

Runner

Struct Runner 

Source
pub struct Runner { /* private fields */ }
Expand description

The campaign runner (builder; see the module documentation).

Implementations§

Source§

impl Runner

Source

pub fn new() -> Runner

Seed 0, batches of 32 trials, all cores, 100 trials per condition, 95 % intervals.

Source

pub fn config(self, json: impl Into<String>) -> Runner

The configuration that produced the run, a JSON document recorded in the run information (and the JSON report) next to the version, the commit and the seed.

Source

pub fn seed(self, seed: u64) -> Runner

The base seed of every stream.

Source

pub fn batch(self, n: u64) -> Runner

Trials per batch (at least 1): the stopping rule is checked after every batch.

Source

pub fn threads(self, n: usize) -> Runner

Worker threads (0: one per core).

Source

pub fn stop(self, rule: Stop) -> Runner

The stopping rule of every condition.

Source

pub fn confidence(self, c: f64) -> Runner

Confidence level of the intervals reported by the loggers (default 0.95), in $(0, 1)$ (Runner::run refuses another value).

Source

pub fn fast_dev_run(self, on: bool) -> Runner

Run one batch per condition and ignore the stopping rule (a quick check).

Source

pub fn callback(self, c: impl Callback + 'static) -> Runner

Add a callback.

Source

pub fn logger(self, l: impl Logger + 'static) -> Runner

Add a logger.

Source

pub fn run_info(&self, scenario: &str, n_conditions: usize) -> RunInfo

What the callbacks and the loggers know about a run of this runner on the scenario scenario over n_conditions conditions, started now (all the cores counted for threads: 0): the header of every report, that of a run, of a search and of a verification.

Source

pub fn run<S: Scenario>( self, scenario: &S, grid: &Grid, ) -> Result<Vec<ConditionResult>>

Run the scenario on every condition of the grid.

§Errors

Error::Config for a grid that gives a key twice (Grid::check); for a confidence level outside $(0, 1)$ (of the runner or of a precision target, see check_confidence); for a stopping rule that can never stop, or whose target is a metric that the first batch of a condition does not record (or min_errors on a mean, see Stop::check_metrics); the first error of a setup or of a trial, of the same kind, with the condition and the trial in the message; the errors of the loggers.

Trait Implementations§

Source§

impl Default for Runner

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Runner

§

impl !Sync for Runner

§

impl !UnwindSafe for Runner

§

impl Forget for Runner

§

impl Freeze for Runner

§

impl Send for Runner

§

impl Unpin for Runner

§

impl UnsafeUnpin for Runner

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.