Skip to main content

SimulationModel

Trait SimulationModel 

Source
pub trait SimulationModel: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn generate_path(
        &self,
        rng: &mut MonteCarloRng,
        time_horizon: &TimeHorizon,
        path_id: usize,
    ) -> SimulationPath;

    // Provided method
    fn generate_antithetic_path(
        &self,
        rng: &mut MonteCarloRng,
        time_horizon: &TimeHorizon,
        path_id: usize,
    ) -> SimulationPath { ... }
}
Expand description

Trait for simulation models

Required Methods§

Source

fn name(&self) -> &'static str

Get the model name

Source

fn generate_path( &self, rng: &mut MonteCarloRng, time_horizon: &TimeHorizon, path_id: usize, ) -> SimulationPath

Generate a single simulation path

Provided Methods§

Source

fn generate_antithetic_path( &self, rng: &mut MonteCarloRng, time_horizon: &TimeHorizon, path_id: usize, ) -> SimulationPath

Generate an antithetic path for variance reduction

Implementors§