pub mod engine;
pub mod harmonic_oscillator;
pub mod kepler_orbit;
pub mod kingmans_hockey;
pub mod littles_law_factory;
pub mod monte_carlo_pi;
pub mod orbit_engine;
pub mod tsp_engine;
pub mod tsp_grasp;
pub mod tsp_instance;
#[cfg(feature = "wasm")]
#[allow(clippy::unwrap_used)]
#[allow(clippy::expect_used)]
#[allow(clippy::missing_panics_doc)]
#[allow(clippy::missing_errors_doc)]
#[allow(clippy::cast_lossless)]
#[allow(clippy::redundant_closure_for_method_calls)]
#[allow(clippy::manual_let_else)]
pub mod tsp_wasm_app;
#[cfg(feature = "wasm")]
#[allow(clippy::unwrap_used)]
#[allow(clippy::expect_used)]
#[allow(clippy::missing_panics_doc)]
#[allow(clippy::missing_errors_doc)]
#[allow(clippy::cast_lossless)]
#[allow(clippy::redundant_closure_for_method_calls)]
#[allow(clippy::manual_let_else)]
pub mod orbit_wasm_app;
pub use engine::{
CriterionResult, DemoEngine, DemoError, DemoMeta, DeterministicReplay, FalsificationCriterion,
MetamorphicRelation, MrResult, RendererIndependent, Severity,
};
pub use harmonic_oscillator::HarmonicOscillatorDemo;
pub use kepler_orbit::KeplerOrbitDemo;
pub use kingmans_hockey::KingmanHockeyDemo;
pub use littles_law_factory::LittlesLawFactoryDemo;
pub use monte_carlo_pi::MonteCarloPlDemo;
pub use orbit_engine::{OrbitConfig, OrbitalEngine, OrbitalState, OrbitalStepResult};
pub use tsp_engine::{TspConfig, TspEngine, TspState, TspStepResult};
pub use tsp_grasp::TspGraspDemo;
pub use tsp_instance::{
Coords, TspAlgorithmConfig, TspCity, TspInstanceError, TspInstanceYaml, TspMeta, TspParams,
};
use serde::{Deserialize, Serialize};
pub trait EddDemo {
fn name(&self) -> &'static str;
fn emc_ref(&self) -> &'static str;
fn step(&mut self, dt: f64);
fn verify_equation(&self) -> bool;
fn get_falsification_status(&self) -> FalsificationStatus;
fn reset(&mut self);
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FalsificationStatus {
pub verified: bool,
pub criteria: Vec<CriterionStatus>,
pub message: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CriterionStatus {
pub id: String,
pub name: String,
pub passed: bool,
pub value: f64,
pub threshold: f64,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)]
pub enum IntegratorType {
#[default]
StormerVerlet,
RK4,
Euler,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_integrator_type_default() {
assert_eq!(IntegratorType::default(), IntegratorType::StormerVerlet);
}
#[test]
fn test_falsification_status_serialization() {
let status = FalsificationStatus {
verified: true,
criteria: vec![CriterionStatus {
id: "TEST-001".to_string(),
name: "Test criterion".to_string(),
passed: true,
value: 0.0,
threshold: 1e-10,
}],
message: "All criteria passed".to_string(),
};
let json = serde_json::to_string(&status).expect("serialize");
assert!(json.contains("TEST-001"));
}
}