[][src]Struct mc_sim::sim::SimulationGoalsBuilder

pub struct SimulationGoalsBuilder { /* fields omitted */ }

Builds simulation goals from chain calls, to make simulation goals easier to configure.

Implementations

impl SimulationGoalsBuilder[src]

pub fn new() -> Self[src]

Create a simulation goals builder.

let goals = SimulationGoalsBuilder::new()
    .add_stream()
    .add_run(10, 7)
    .add_run(10, 6)
    .add_run(10, 8)
    .add_run(10, 7)
    .add_stream()
    .add_runs(3, 10, 7)
    .goals();

assert_eq!(goals.streams.len(), 2);
assert_eq!(goals.streams[0].len(), 4);
assert_eq!(goals.streams[1].len(), 3);
assert_eq!(goals.streams[0][1].target_pearls, 10);
assert_eq!(goals.streams[0][1].target_rods, 6);

pub fn goals(self) -> SimulationGoals[src]

Get the simulation goals, consumes the builder.

pub fn add_stream(self) -> Self[src]

Add a stream to the simulation.

pub fn add_run(self, target_pearls: u32, target_rods: u32) -> Self[src]

Add a run to the simulation.

pub fn add_runs(self, runs: u32, target_pearls: u32, target_rods: u32) -> Self[src]

Add a set of runs to the simulation.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,