|
| real_time_simulation (const time_point &start_t, const time_point &end_t, bool can_end_early, int64 seed, std::ostream &stream) |
| Constructs a real_time_simulation with the full set of configuration options. More...
|
|
| real_time_simulation (duration total_dt, int64 seed, std::ostream &stream) |
| Constructs a real_time_simulation with a reduced set of configuration options. More...
|
|
virtual | ~real_time_simulation ()=default |
| Destructor. More...
|
|
Node::injection_type & | injection () |
| Returns a reference to the injection object that supports communication into the interactive system node. More...
|
|
const Node::observation_type & | observation () |
| Returns a reference to the observation object that supports communication from the interactive system node. More...
|
|
float64 | time_advancement_rate () const |
| Returns the time advancement rate. More...
|
|
float64 | time_synchronization_rate () const |
| Returns the time synchronization rate. More...
|
|
void | update_time_advancement_rate (float64 t_adv_rate) |
| Updates the time advancement rate. More...
|
|
void | update_time_synchronization_rate (float64 t_syn_rate) |
| Updates the time synchonization rate. More...
|
|
time_point | synchronization_time () const |
| Returns the simulated time of the synchronization reference point. More...
|
|
clock_time | synchronization_clock_time () const |
| Returns the wallclock time of the synchronization reference point. More...
|
|
void | update_synchronization_time (const time_point &sim_t, const clock_time &clk_t) |
| Updates the synchonization reference point. More...
|
|
int64 | frame_index () const |
| Returns the index of the most recently processed frame of the simulation. More...
|
|
time_point | frame_time () const |
| Returns the simulated time point of the most recently processed frame of the simulation. More...
|
|
clock_time | frame_clock_time () const |
| Returns the wallclock time point of the most recently processed frame of the simulation. More...
|
|
int64 | process_frame_if_time_reached () |
| If a sufficent amount of wallclock time has elapsed, processes all events until the frame index has advanced. More...
|
|
| simulation (const time_point &start_t, const time_point &end_t, bool can_end_early, int64 seed, std::ostream &stream) |
| Constructs a simulation with the full set of configuration options. More...
|
|
| simulation (duration total_dt, int64 seed, std::ostream &stream) |
| Constructs a simulation with a reduced set of configuration options. More...
|
|
| simulation (const simulation &)=delete |
| No copy constructor. More...
|
|
simulation & | operator= (const simulation &)=delete |
| No copy assignment. More...
|
|
| simulation (simulation &&)=delete |
| No move constructor. More...
|
|
simulation & | operator= (simulation &&)=delete |
| No move assignment. More...
|
|
virtual | ~simulation ()=default |
| Destructor. More...
|
|
const time_point & | start_time () const |
| Returns the start time of the simulation. More...
|
|
const time_point & | end_time () const |
| Returns the end time of the simulation. More...
|
|
bool | can_end_early () const |
| Returns true if the simulation can end before the specified end time. More...
|
|
bool | started () const |
| Returns true if the simulation has started. More...
|
|
bool | finishing () const |
| Returns true if all events are finished except finalization. More...
|
|
bool | finished () const |
| Returns true if the simulation has finished. More...
|
|
const discrete_event_time & | time () const |
| Returns the current point in discrete event time. More...
|
|
duration | imminent_duration () const |
| Returns the duration until the imminent event. More...
|
|
void | process_next_event () |
| Runs the next event of the topmost system node. More...
|
|
int64 | process_next_events () |
| Runs all events until simulated time advances; returns the number of processed events. More...
|
|
int64 | process_events_until (const time_point &t) |
| Runs all events until simulated time advances at least to t ; returns the number of processed events. More...
|
|
int64 | process_remaining_events () |
| Runs simulation until completion; returns the number of processed events. More...
|
|
const timer & | event_timer () const |
| Returns the object that accumulated wallclock event durations. More...
|
|
template<typename Node>
class sydevs::systems::real_time_simulation< Node >
A class template for running simulations in real time.
The real_time_simulation
class template represents a simulation run in real time based on an interactive_system
class specified as a template parameter. Member functions allow the represented simulation to be performed one frame at a time, where each frame includes however many events need to be processed to advance the macro level of the interactive_system
instance by its planned duration.
A real time simulation is performed by repeatedly calling the process_frame_if_time_reached
member function. If the resulting event count is zero, nothing happened because not enough wallclock time is deemed to have passed. If the resulting event count is greater than zero, then the simulation has advanced by one frame. It may then be time to observe data from the simulation using the observation
member function, or inject data into the simulation using the injection
member function.