Skip to main content

Crate use_simulation

Crate use_simulation 

Source
Expand description

Thin facade for the use-simulation workspace.

The crate reexports the focused simulation crates directly so consumers can opt into one dependency while still using the smaller APIs.

§Examples

use use_simulation::*;

let seed = SimulationSeed::new(5);
let path = random_walk(RandomWalkConfig {
    start: 0.0,
    step_size: 1.0,
    steps: 3,
    seed,
})
.unwrap();
let result = summarize(&path).unwrap();
let mut clock = SimulationClock::new(0.5).unwrap();

assert_eq!(clock.advance().unwrap(), 0.5);
assert_eq!(result.steps, 3);
assert_eq!(step_state(1.0, 0.5, 0).unwrap().next_state, 1.5);

Re-exports§

pub use use_event_simulation;
pub use use_monte_carlo;
pub use use_random_walk;
pub use use_seed;
pub use use_simulation_clock;
pub use use_simulation_result;
pub use use_state_step;

Structs§

EventState
MonteCarloEstimate
RandomWalkConfig
RandomWalkSummary
SimulationClock
SimulationEvent
SimulationResult
SimulationSeed
StateStep

Enums§

EventSimulationError
MonteCarloError
RandomWalkError
SeedError
SimulationClockError
SimulationResultError
StateStepError

Functions§

apply_steps
elapsed_for
mix_value
monte_carlo_mean
random_walk
run_event_simulation
sorted_events
states
step_state
summarize
summarize_walk
unit_f64_from_seed