use crate::{
ad::adreal::ADReal,
core::{marketdatahandling::constructedelementstore::SharedElement, pillars::Pillars},
indices::marketindex::MarketIndex,
simulations::simulation::MonteCarloSimulation,
};
pub trait ADMonteCarloSimulationElement:
MonteCarloSimulation<ADReal> + Pillars<ADReal> + Send + Sync
{
}
#[derive(Clone)]
pub struct MonteCarloSimulationElement {
market_index: MarketIndex,
simulation: SharedElement<dyn ADMonteCarloSimulationElement>,
}
impl MonteCarloSimulationElement {
#[must_use]
pub const fn new(
market_index: MarketIndex,
simulation: SharedElement<dyn ADMonteCarloSimulationElement>,
) -> Self {
Self {
market_index,
simulation,
}
}
#[must_use]
pub const fn market_index(&self) -> &MarketIndex {
&self.market_index
}
#[must_use]
pub const fn simulation(&self) -> &SharedElement<dyn ADMonteCarloSimulationElement> {
&self.simulation
}
}