pub struct ReplayLog { /* private fields */ }Expand description
Reads back a log and supports time-series reconstruction and interpolation.
Implementations§
Source§impl ReplayLog
impl ReplayLog
Sourcepub fn new(entries: Vec<SimLogEntry>) -> Self
pub fn new(entries: Vec<SimLogEntry>) -> Self
Build a replay log from a vector of entries. Entries are sorted by
sim_time.
Sourcepub fn get(&self, i: usize) -> Option<&SimLogEntry>
pub fn get(&self, i: usize) -> Option<&SimLogEntry>
Return the entry at index i.
Sourcepub fn energy_series(&self) -> Vec<(f64, f64)>
pub fn energy_series(&self) -> Vec<(f64, f64)>
Extract the full time series for energy.
Sourcepub fn interpolate_energy(&self, t: f64) -> Option<f64>
pub fn interpolate_energy(&self, t: f64) -> Option<f64>
Linearly interpolate the energy field at an arbitrary t.
Returns None if the log is empty or t is outside the covered range.
Sourcepub fn iter(&self) -> impl Iterator<Item = &SimLogEntry>
pub fn iter(&self) -> impl Iterator<Item = &SimLogEntry>
Iterate over all entries in sim_time order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReplayLog
impl RefUnwindSafe for ReplayLog
impl Send for ReplayLog
impl Sync for ReplayLog
impl Unpin for ReplayLog
impl UnsafeUnpin for ReplayLog
impl UnwindSafe for ReplayLog
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.