pub struct Experiment {
pub specs: Specs,
pub transform: Arc<dyn Fn() -> ResultTransform + Sync + Send>,
pub locale: ResultLocale,
pub run_count: usize,
pub title: String,
pub description: Option<String>,
pub verbose: bool,
pub num_threads: Option<usize>,
}
Expand description
It defines the simulation experiment.
Fields§
§specs: Specs
The simulation specs for the experiment.
transform: Arc<dyn Fn() -> ResultTransform + Sync + Send>
How the results must be transformed before rendering.
locale: ResultLocale
Specifies a locale.
run_count: usize
How many simulation runs should be launched.
title: String
The experiment title.
description: Option<String>
The experiment description.
verbose: bool
Whether the process of generating the results is verbose.
num_threads: Option<usize>
The number of threads used when running the simulation experiment (can be ignored).
Implementations§
Source§impl Experiment
impl Experiment
Sourcepub fn run<I, R, F, E, M>(
&self,
generators: I,
rendering: R,
simulation: F,
executor: E,
) -> Result<()>where
I: IntoIterator<Item = Box<dyn ExperimentGenerator<R>>>,
R: ExperimentRendering + Send + 'static,
F: FnOnce() -> M + Sync + Send + Clone + 'static,
M: Simulation<Item = ResultSet> + Clone + 'static,
E: ExperimentExecutor,
pub fn run<I, R, F, E, M>(
&self,
generators: I,
rendering: R,
simulation: F,
executor: E,
) -> Result<()>where
I: IntoIterator<Item = Box<dyn ExperimentGenerator<R>>>,
R: ExperimentRendering + Send + 'static,
F: FnOnce() -> M + Sync + Send + Clone + 'static,
M: Simulation<Item = ResultSet> + Clone + 'static,
E: ExperimentExecutor,
Run the simulation experiment with the specified executor.
Trait Implementations§
Source§impl Clone for Experiment
impl Clone for Experiment
Source§fn clone(&self) -> Experiment
fn clone(&self) -> Experiment
Returns a copy 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 Experiment
impl !RefUnwindSafe for Experiment
impl Send for Experiment
impl Sync for Experiment
impl Unpin for Experiment
impl !UnwindSafe for Experiment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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