2 #ifndef SYDEVS_SYSTEMS_REAL_TIME_BUFFER_H_
3 #define SYDEVS_SYSTEMS_REAL_TIME_BUFFER_H_
64 void recompute_planned_clock_duration();
104 return current_sim_t_;
110 return current_clk_t_;
116 return current_clk_t_ + std::chrono::milliseconds(
int64(planned_clk_dt_));
time_point current_time() const
Returns the current simulated time.
Definition: real_time_buffer.h:102
clock_time planned_clock_time() const
Returns the recommended point in wallclock time of the planned event.
Definition: real_time_buffer.h:114
void update_current_time(const time_point &sim_t, const clock_time &clk_t, duration planned_sim_dt)
Updates the current time and the planned duration of simulated time until the planned event...
Definition: real_time_buffer.cpp:47
clock_time current_clock_time() const
Returns the current wallclock time.
Definition: real_time_buffer.h:108
A data structure which suggests event wallclock times to aid in the synchronization of a simulation's...
Definition: real_time_buffer.h:40
void update_synchronization_time(const time_point &sim_t, const clock_time &clk_t)
Updates the synchonization reference point and recomputes the planned wallclock time.
Definition: real_time_buffer.cpp:38
void update_time_advancement_rate(float64 t_adv_rate)
Updates the time advancement rate and recomputes the planned wallclock time.
Definition: real_time_buffer.cpp:22
clock_time synchronization_clock_time() const
Returns the wallclock time of the synchronization reference point.
Definition: real_time_buffer.h:96
float64 time_synchronization_rate() const
Returns the time synchronization rate.
Definition: real_time_buffer.h:84
real_time_buffer(float64 t_adv_rate, int64 t_syn_rate)
Constructs a real time buffer with the specified time advancement rate t_adv_rate and time synchroniz...
Definition: real_time_buffer.cpp:7
void update_time_synchronization_rate(float64 t_syn_rate)
Updates the time synchonization rate and recomputes the planned wallclock time.
Definition: real_time_buffer.cpp:30
A data structure which represents a point in time as an arbitrary-precision multiple of its shortest ...
Definition: time_point.h:84
std::chrono::time_point< clock > clock_time
Definition: timer.h:11
int64_t int64
Definition: number_types.h:14
time_point synchronization_time() const
Returns the simulated time of the synchronization reference point.
Definition: real_time_buffer.h:90
double float64
Definition: number_types.h:22
float64 time_advancement_rate() const
Returns the time advancement rate.
Definition: real_time_buffer.h:78