pub struct Simulation { /* private fields */ }
Expand description
A simulation of a series of streams of speed runs, distributed over worker threads.
Implementations§
Source§impl Simulation
impl Simulation
Sourcepub fn new(goals: SimulationGoals, thread_count: u32) -> Self
pub fn new(goals: SimulationGoals, thread_count: u32) -> Self
Create a simulation.
let goals = SimulationGoalsBuilder::new().add_runs(5, 10, 7).goals();
let simulation = Simulation::new(goals, 4);
let results = simulation.simulate_n_times(100);
Sourcepub fn simulate_n_times(self, cycles: u64) -> Vec<StreamResults>
pub fn simulate_n_times(self, cycles: u64) -> Vec<StreamResults>
Run the simulation for a given number of cycles and get the results. This will consume the simulator.
Sourcepub fn run_to_p_value(self, p_value: f64) -> StreamResults
pub fn run_to_p_value(self, p_value: f64) -> StreamResults
Run the simulation until a desired p-value is reached. I.E. The luckiest run seen, is as lucky, or luckier than the given p-value.
Sourcepub fn goals(&self) -> &SimulationGoals
pub fn goals(&self) -> &SimulationGoals
The goals of the simulation.
Auto Trait Implementations§
impl Freeze for Simulation
impl !RefUnwindSafe for Simulation
impl Send for Simulation
impl Sync for Simulation
impl Unpin for Simulation
impl !UnwindSafe for Simulation
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.