pub struct DdminStats { /* private fields */ }Expand description
Oracle accounting for one DDMin run.
Implementations§
Source§impl DdminStats
impl DdminStats
Sourcepub const fn oracle_calls(self) -> usize
pub const fn oracle_calls(self) -> usize
Total oracle evaluations performed.
Examples found in repository?
examples/budgeted.rs (line 24)
7fn main() {
8 let options = DdminOptions::new(NonZeroUsize::MIN, Some(1));
9 let input = DdminInput::new(vec![1_u8, 2, 3, 4], options);
10 let mut oracle = |remaining: &[u8]| {
11 if remaining.contains(&2) {
12 OracleOutcome::Interesting
13 } else {
14 OracleOutcome::NotInteresting
15 }
16 };
17
18 let output = ddmin(input, &mut oracle);
19 assert_eq!(
20 output.guarantee(),
21 DdminGuarantee::Incomplete(DdminStopReason::MaxOracleCallsReached),
22 "DDMin should report an incomplete guarantee when the oracle-call budget is exhausted"
23 );
24 assert_eq!(output.stats().oracle_calls(), 1, "DDMin should stop at the configured budget");
25}Sourcepub const fn interesting_trials(self) -> usize
pub const fn interesting_trials(self) -> usize
Oracle evaluations that returned Interesting.
Sourcepub const fn not_interesting_trials(self) -> usize
pub const fn not_interesting_trials(self) -> usize
Oracle evaluations that returned NotInteresting.
Sourcepub const fn unresolved_trials(self) -> usize
pub const fn unresolved_trials(self) -> usize
Oracle evaluations that returned Unresolved.
Examples found in repository?
examples/unresolved.rs (line 18)
3fn main() {
4 let input = DdminInput::new(vec!["core", "flaky", "noise"], DdminOptions::default());
5 let mut oracle = |remaining: &[&str]| {
6 if remaining.contains(&"flaky") && remaining.len() == 1 {
7 OracleOutcome::Unresolved(UnresolvedReason::NonDeterministic)
8 } else if remaining.contains(&"core") {
9 OracleOutcome::Interesting
10 } else {
11 OracleOutcome::NotInteresting
12 }
13 };
14
15 let output = ddmin(input, &mut oracle);
16 assert_eq!(output.remaining(), &["core"], "DDMin should keep the stable interesting value");
17 assert_eq!(
18 output.stats().unresolved_trials(),
19 1,
20 "DDMin should count unresolved oracle outcomes"
21 );
22}Trait Implementations§
Source§impl Clone for DdminStats
impl Clone for DdminStats
Source§fn clone(&self) -> DdminStats
fn clone(&self) -> DdminStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DdminStats
impl Debug for DdminStats
Source§impl Default for DdminStats
impl Default for DdminStats
Source§fn default() -> DdminStats
fn default() -> DdminStats
Returns the “default value” for a type. Read more
Source§impl PartialEq for DdminStats
impl PartialEq for DdminStats
Source§fn eq(&self, other: &DdminStats) -> bool
fn eq(&self, other: &DdminStats) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for DdminStats
impl Eq for DdminStats
impl StructuralPartialEq for DdminStats
Auto Trait Implementations§
impl Freeze for DdminStats
impl RefUnwindSafe for DdminStats
impl Send for DdminStats
impl Sync for DdminStats
impl Unpin for DdminStats
impl UnsafeUnpin for DdminStats
impl UnwindSafe for DdminStats
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