pub trait SimulationAuditLog {
type StateSnapshot: Clone + Serialize + for<'de> Deserialize<'de>;
// Required methods
fn log_step(&mut self, entry: StepEntry<Self::StateSnapshot>);
fn audit_log(&self) -> &[StepEntry<Self::StateSnapshot>];
fn audit_log_mut(&mut self) -> &mut Vec<StepEntry<Self::StateSnapshot>>;
fn clear_audit_log(&mut self);
// Provided methods
fn export_audit_json(&self) -> SimResult<String> { ... }
fn export_audit_json_compact(&self) -> SimResult<String> { ... }
fn generate_test_cases(&self) -> Vec<GeneratedTestCase> { ... }
fn total_equation_evals(&self) -> usize { ... }
fn total_decisions(&self) -> usize { ... }
fn verify_all_equations(&self, tolerance: f64) -> Vec<(u64, String, f64)> { ... }
}Expand description
MANDATORY trait for all EDD simulations (EDD-16, EDD-17, EDD-18).
Every simulation MUST implement this trait to produce a complete audit trail of every step.
Required Associated Types§
Sourcetype StateSnapshot: Clone + Serialize + for<'de> Deserialize<'de>
type StateSnapshot: Clone + Serialize + for<'de> Deserialize<'de>
State snapshot type (must be serializable and cloneable)
Required Methods§
Sourcefn log_step(&mut self, entry: StepEntry<Self::StateSnapshot>)
fn log_step(&mut self, entry: StepEntry<Self::StateSnapshot>)
Record a step with full state capture.
Sourcefn audit_log(&self) -> &[StepEntry<Self::StateSnapshot>]
fn audit_log(&self) -> &[StepEntry<Self::StateSnapshot>]
Get all logged entries.
Sourcefn audit_log_mut(&mut self) -> &mut Vec<StepEntry<Self::StateSnapshot>>
fn audit_log_mut(&mut self) -> &mut Vec<StepEntry<Self::StateSnapshot>>
Get mutable access to audit log.
Sourcefn clear_audit_log(&mut self)
fn clear_audit_log(&mut self)
Clear the audit log.
Provided Methods§
Sourcefn export_audit_json(&self) -> SimResult<String>
fn export_audit_json(&self) -> SimResult<String>
Sourcefn export_audit_json_compact(&self) -> SimResult<String>
fn export_audit_json_compact(&self) -> SimResult<String>
Sourcefn generate_test_cases(&self) -> Vec<GeneratedTestCase>
fn generate_test_cases(&self) -> Vec<GeneratedTestCase>
Generate test cases from audit log (EDD-18).
Sourcefn total_equation_evals(&self) -> usize
fn total_equation_evals(&self) -> usize
Get total number of equation evaluations in log.
Sourcefn total_decisions(&self) -> usize
fn total_decisions(&self) -> usize
Get total number of decisions in log.