pub struct SimMetrics {
pub time: f64,
pub step: u64,
pub steps_per_second: f64,
pub total_energy: Option<f64>,
pub kinetic_energy: Option<f64>,
pub potential_energy: Option<f64>,
pub energy_drift: Option<f64>,
pub body_count: usize,
pub jidoka_warnings: u32,
pub jidoka_errors: u32,
pub memory_bytes: usize,
pub custom: HashMap<String, f64>,
}Expand description
Real-time simulation metrics for visualization.
Fields§
§time: f64Current simulation time.
step: u64Current step number.
steps_per_second: f64Steps per second (throughput).
total_energy: Option<f64>Total energy (if applicable).
kinetic_energy: Option<f64>Kinetic energy (if applicable).
potential_energy: Option<f64>Potential energy (if applicable).
energy_drift: Option<f64>Energy drift from initial (relative).
body_count: usizeNumber of bodies/particles.
jidoka_warnings: u32Number of Jidoka warnings.
jidoka_errors: u32Number of Jidoka errors.
memory_bytes: usizeMemory usage in bytes.
custom: HashMap<String, f64>Custom metrics.
Implementations§
Source§impl SimMetrics
impl SimMetrics
Sourcepub fn update_from_state(&mut self, state: &SimState, time: SimTime)
pub fn update_from_state(&mut self, state: &SimState, time: SimTime)
Update from simulation state.
Sourcepub fn set_energy_drift(&mut self, initial_energy: f64)
pub fn set_energy_drift(&mut self, initial_energy: f64)
Set energy drift relative to initial energy.
Sourcepub fn add_custom(&mut self, name: impl Into<String>, value: f64)
pub fn add_custom(&mut self, name: impl Into<String>, value: f64)
Add custom metric.
Sourcepub fn get_custom(&self, name: &str) -> Option<f64>
pub fn get_custom(&self, name: &str) -> Option<f64>
Get custom metric.
Trait Implementations§
Source§impl Clone for SimMetrics
impl Clone for SimMetrics
Source§fn clone(&self) -> SimMetrics
fn clone(&self) -> SimMetrics
Returns a duplicate of the value. Read more
1.0.0 · 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 SimMetrics
impl Debug for SimMetrics
Source§impl Default for SimMetrics
impl Default for SimMetrics
Source§fn default() -> SimMetrics
fn default() -> SimMetrics
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SimMetrics
impl<'de> Deserialize<'de> for SimMetrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SimMetrics
impl RefUnwindSafe for SimMetrics
impl Send for SimMetrics
impl Sync for SimMetrics
impl Unpin for SimMetrics
impl UnsafeUnpin for SimMetrics
impl UnwindSafe for SimMetrics
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