$darkmode
engine::SimulationSync Class Reference

#include <simulation_context.hpp>

Inheritance diagram for engine::SimulationSync:
Collaboration diagram for engine::SimulationSync:

Public Member Functions

 SimulationSync (const cloe::Duration &step_width)
 
uint64_t step () const override
 
cloe::Duration step_width () const override
 
cloe::Duration time () const override
 
cloe::Duration eta () const override
 
double realtime_factor () const override
 
double achievable_realtime_factor () const override
 
void increment_step ()
 
void set_realtime_factor (double s)
 
void set_eta (cloe::Duration d)
 
void reset ()
 
void set_cycle_time (cloe::Duration d)
 
- Public Member Functions inherited from cloe::Sync
virtual bool is_realtime_factor_unlimited () const
 

Detailed Description

SimulationSync is the synchronization context of the simulation.

Member Function Documentation

◆ achievable_realtime_factor()

double engine::SimulationSync::achievable_realtime_factor ( ) const
inlineoverridevirtual

Return the maximum theorically achievable simulation realtime factor, with 1.0 being realtime.

Implements cloe::Sync.

Here is the call graph for this function:

◆ eta()

cloe::Duration engine::SimulationSync::eta ( ) const
inlineoverridevirtual

Return the estimated simulation time-of-arrival.

This is the time at which the simulation is stopped by a trigger, which could be "stop", "fail", or "restart". If no such ETA is known, zero is returned.

Implements cloe::Sync.

◆ increment_step()

void engine::SimulationSync::increment_step ( )
inline

Increase the step number for the simulation.

  • It increases the step by one.
  • It moves the simulation time forward by the step width.
  • It stores the real time difference from the last time IncrementStep was called.

◆ realtime_factor()

double engine::SimulationSync::realtime_factor ( ) const
inlineoverridevirtual

Return the target simulation factor, with 1.0 being realtime.

  • If target realtime factor is <= 0.0, then it is interpreted to be unlimited.
  • Currently, the floating INFINITY value is not handled specially.

Implements cloe::Sync.

◆ set_realtime_factor()

void engine::SimulationSync::set_realtime_factor ( double  s)
inline

Set the target realtime factor, with any value less or equal to zero unlimited.

◆ step()

uint64_t engine::SimulationSync::step ( ) const
inlineoverridevirtual

Return the absolute simulation step number.

This value is monotonically increasing, and greater-or-equal to zero.

Implements cloe::Sync.

◆ step_width()

cloe::Duration engine::SimulationSync::step_width ( ) const
inlineoverridevirtual

Return the atomic simulation step width.

This is the lowest-common-denominator of all models.

Implements cloe::Sync.

Here is the caller graph for this function:

◆ time()

cloe::Duration engine::SimulationSync::time ( ) const
inlineoverridevirtual

Return the simulation time.

Implements cloe::Sync.


The documentation for this class was generated from the following file: