pub struct MonteCarlo { /* private fields */ }Expand description
A rocket’s nominal flight and the dispersion of its inputs, ready to fly samples.
Implementations§
Source§impl MonteCarlo
impl MonteCarlo
Sourcepub fn new(
nominal: FlightInputs,
dispersion: Dispersion,
) -> Result<Self, AnalysisError>
pub fn new( nominal: FlightInputs, dispersion: Dispersion, ) -> Result<Self, AnalysisError>
A run of nominal dispersed by dispersion.
§Errors
- As
Dispersion::validate. AnalysisError::NoConfigurationif the design has no configuration of that id.AnalysisError::Designif the design can’t be laid out.AnalysisError::Unsupportedfor a dispersed impulse or burn time on a motor whose propellant modeldispersed_motordoesn’t know.
Sourcepub fn nominal(&self) -> &FlightInputs
pub fn nominal(&self) -> &FlightInputs
The nominal flight.
Sourcepub fn dispersion(&self) -> &Dispersion
pub fn dispersion(&self) -> &Dispersion
The dispersion.
Sourcepub fn draw(&self, seed: u64, index: u64) -> Draw
pub fn draw(&self, seed: u64, index: u64) -> Draw
What sample index of a run seeded with seed draws.
Sourcepub fn inputs(&self, draw: &Draw) -> Result<FlightInputs, AnalysisError>
pub fn inputs(&self, draw: &Draw) -> Result<FlightInputs, AnalysisError>
The flight inputs draw gives: the nominal ones, with each input whose entry isn’t its
nominal value (a factor of 1, an offset of 0) changed as the module’s docs say. An entry at
its nominal value leaves its input as it is, so a draw with no dispersion flies the
nominal flight bit for bit; any other entry is applied, whatever the dispersion, so a
draw read back or written by hand flies as it says.
§Errors
AnalysisError::Countfor a list whose length isn’t the design’s number of stages, the configuration’s number of motors or the number of recovery devices.AnalysisError::Domainfor an entry that isn’t finite, and fromdispersed_motorfor an impulse or burn-time factor at or below zero.AnalysisError::UnsupportedandAnalysisError::Motorasdispersed_motor.
Sourcepub fn fly(&self, draw: &Draw) -> Result<FlightSummary, AnalysisError>
pub fn fly(&self, draw: &Draw) -> Result<FlightSummary, AnalysisError>
Flies draw (MonteCarlo::inputs) to the ground and gives its metrics, on what the
run’s flights share (the module’s Speed): as FlightInputs::fly on the same inputs,
bit for bit, but without laying out the parts or building a supersonic table again. For
flights drawn by hand, as a sensitivity analysis’s (crate::sensitivity).
§Errors
As MonteCarlo::inputs, and AnalysisError::Sim around the errors of
FlightInputs::fly.
Sourcepub fn sample(&self, seed: u64, index: u64) -> Sample
pub fn sample(&self, seed: u64, index: u64) -> Sample
Draws and flies sample index of a run seeded with seed. A draw that makes an input
impossible, or a flight that stops with an error, is a failed sample, not an error.
Sourcepub fn run(&self, seed: u64, count: u64) -> Run
pub fn run(&self, seed: u64, count: u64) -> Run
Flies samples 0..count of a run seeded with seed, one after another.
Sourcepub fn run_parallel(&self, seed: u64, count: u64) -> Run
pub fn run_parallel(&self, seed: u64, count: u64) -> Run
As MonteCarlo::run, with the samples spread over the threads of the current rayon
pool: the global one, or one a caller’s rayon::ThreadPool::install sets up to choose
how many. The run is the same, bit for bit, whatever the number of threads.
Trait Implementations§
Source§impl Clone for MonteCarlo
impl Clone for MonteCarlo
Source§fn clone(&self) -> MonteCarlo
fn clone(&self) -> MonteCarlo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MonteCarlo
impl !UnwindSafe for MonteCarlo
impl Freeze for MonteCarlo
impl Send for MonteCarlo
impl Sync for MonteCarlo
impl Unpin for MonteCarlo
impl UnsafeUnpin for MonteCarlo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more