pub struct ConditionResult {
pub index: usize,
pub condition: Condition,
pub status: Status,
pub trials: u64,
pub wall_s: f64,
pub record: Record,
}Expand description
The result of one condition.
Fields§
§index: usizeIndex of the condition in the grid.
condition: ConditionThe condition.
status: StatusHow it ended.
trials: u64Number of trials run.
wall_s: f64Wall time of the condition, setup included (s).
record: RecordThe metrics merged over the trials, with the counts of the values dropped
(Record::dropped).
Implementations§
Source§impl ConditionResult
impl ConditionResult
Sourcepub fn row(&self, confidence: f64) -> Vec<(String, Value)>
pub fn row(&self, confidence: f64) -> Vec<(String, Value)>
The result as one flat row of named values: index, the entries of the
condition, status, trials, wall_s, then the columns of every metric
(metric_columns) with its interval at confidence, in the order of the
names: the columns of the CSV report (CsvLogger)
and the rows of the Python results.
§Examples
use comnum_sim::prelude::*;
use comnum_sim::scenario::from_fn;
let s = from_fn("coin", |_, rng, rec| { rec.errors("p", rng.bit() as u64, 1); Ok(()) });
let r = Runner::new().stop(Stop::max_trials(8)).run(&s, &Grid::new().axis("n", [1usize])).unwrap();
let names: Vec<String> = r[0].row(0.95).into_iter().map(|(k, _)| k).collect();
assert_eq!(names, ["index", "n", "status", "trials", "wall_s", "p", "p_lo", "p_hi", "p_count", "p_total"]);Trait Implementations§
Source§impl Clone for ConditionResult
impl Clone for ConditionResult
Source§impl Debug for ConditionResult
impl Debug for ConditionResult
Source§impl PartialEq for ConditionResult
impl PartialEq for ConditionResult
impl StructuralPartialEq for ConditionResult
Auto Trait Implementations§
impl Forget for ConditionResult
impl Freeze for ConditionResult
impl RefUnwindSafe for ConditionResult
impl Send for ConditionResult
impl Sync for ConditionResult
impl Unpin for ConditionResult
impl UnsafeUnpin for ConditionResult
impl UnwindSafe for ConditionResult
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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