pub struct TimeEngine { /* private fields */ }Expand description
Time Engine - manages dual clocks and temporal control
Implementations§
Source§impl TimeEngine
impl TimeEngine
Sourcepub fn with_config(config: TimeEngineConfig) -> Self
pub fn with_config(config: TimeEngineConfig) -> Self
Create a new Time Engine with custom configuration
Sourcepub fn tick(&mut self)
pub fn tick(&mut self)
Advance clocks by one tick This is the core tick function - MUST be called every tick
Sourcepub fn τp(&self) -> PerceptualTime
pub fn τp(&self) -> PerceptualTime
Get current perceptual time (τp)
pub fn tau_p(&self) -> PerceptualTime
pub fn tau_s(&self) -> StateTime
Sourcepub fn reality_window(&self) -> RealityWindow
pub fn reality_window(&self) -> RealityWindow
Get current reality window
Sourcepub fn classify_time(&self, t: StateTime) -> TimePosition
pub fn classify_time(&self, t: StateTime) -> TimePosition
Classify a time relative to the reality window
Sourcepub fn update_from_packet(
&mut self,
peer: NodeId,
remote_time: StateTime,
seq: u16,
)
pub fn update_from_packet( &mut self, peer: NodeId, remote_time: StateTime, seq: u16, )
Update network model from a received packet
Sourcepub fn record_reorder(&mut self, depth: u32)
pub fn record_reorder(&mut self, depth: u32)
Record packet reorder
Sourcepub fn record_loss(&mut self, lost: u32, total: u32)
pub fn record_loss(&mut self, lost: u32, total: u32)
Record packet loss
Sourcepub fn stability_score(&self) -> f64
pub fn stability_score(&self) -> f64
Get network stability score
Sourcepub fn correction_weight(&self, delay: Duration) -> f64
pub fn correction_weight(&self, delay: Duration) -> f64
Calculate correction weight for a late event Weight decreases as event gets older
Sourcepub fn network(&self) -> &NetworkModel
pub fn network(&self) -> &NetworkModel
Get reference to network model
Sourcepub fn state_clock_mut(&mut self) -> &mut StateClock
pub fn state_clock_mut(&mut self) -> &mut StateClock
Get mutable reference to state clock (for convergence control)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimeEngine
impl RefUnwindSafe for TimeEngine
impl Send for TimeEngine
impl Sync for TimeEngine
impl Unpin for TimeEngine
impl UnsafeUnpin for TimeEngine
impl UnwindSafe for TimeEngine
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