pub struct SimLogEntry {
pub timestep: u64,
pub sim_time: f64,
pub wall_time: f64,
pub energy: f64,
pub n_bodies: usize,
pub custom: HashMap<String, f64>,
}Expand description
A single logged snapshot of simulation state at one timestep.
Fields§
§timestep: u64Simulation timestep index (0-based).
sim_time: f64Simulation time in seconds.
wall_time: f64Wall-clock time in seconds since start.
energy: f64Total mechanical energy at this step.
n_bodies: usizeNumber of bodies/particles active at this step.
custom: HashMap<String, f64>Arbitrary additional fields (name → value).
Implementations§
Source§impl SimLogEntry
impl SimLogEntry
Sourcepub fn new(
timestep: u64,
sim_time: f64,
wall_time: f64,
energy: f64,
n_bodies: usize,
) -> Self
pub fn new( timestep: u64, sim_time: f64, wall_time: f64, energy: f64, n_bodies: usize, ) -> Self
Create a new log entry with no custom fields.
Sourcepub fn to_csv_row(&self, extra_keys: &[String]) -> String
pub fn to_csv_row(&self, extra_keys: &[String]) -> String
Serialise this entry to a CSV row (timestep, sim_time, wall_time, energy, n_bodies, then sorted custom keys).
Trait Implementations§
Source§impl Clone for SimLogEntry
impl Clone for SimLogEntry
Source§fn clone(&self) -> SimLogEntry
fn clone(&self) -> SimLogEntry
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 SimLogEntry
impl Debug for SimLogEntry
Source§impl PartialEq for SimLogEntry
impl PartialEq for SimLogEntry
Source§fn eq(&self, other: &SimLogEntry) -> bool
fn eq(&self, other: &SimLogEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SimLogEntry
Auto Trait Implementations§
impl Freeze for SimLogEntry
impl RefUnwindSafe for SimLogEntry
impl Send for SimLogEntry
impl Sync for SimLogEntry
impl Unpin for SimLogEntry
impl UnsafeUnpin for SimLogEntry
impl UnwindSafe for SimLogEntry
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.