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
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,
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
Auto Trait Implementations
impl !RefUnwindSafe for Experiment
impl Send for Experiment
impl Sync for Experiment
impl Unpin for Experiment
impl !UnwindSafe for Experiment
Blanket Implementations
Mutably borrows from an owned value. Read more