delphyne
|
A class that keeps statistics of a single simulation run.
An interactive session is usually composed of one or more simulation runs, depending on the interactions with the external world. Each simulation run captures the moment it started (both in simulation and real time), the number of simulation steps executed, the timestamps for that last step (again, in simulation and real time) and a flag indicating if the run has finished (once this happens no more steps can be recorded).
#include <src/backend/simulation_run_stats.h>
Public Member Functions | |
SimulationRunStats (double start_simtime, double expected_realtime_rate) | |
Creates a new simulation run, starting at start_simtime . More... | |
SimulationRunStats (double start_simtime, double expected_realtime_rate, const TimePoint &start_realtime) | |
Creates a new simulation run. More... | |
void | StepExecuted (double simtime) |
Records that a step was executed by the simulator. More... | |
void | SetRealtime (const TimePoint &realtime) |
Records the current real time, typically used after a simulation step has occurred. More... | |
double | ElapsedSimtime () const |
Returns the simulation time difference, in seconds, since the run started until the last step. More... | |
double | ElapsedRealtime () const |
Returns the real time difference, in seconds, since the run started until the last step. More... | |
void | RunFinished () |
Indicates that the run has finished. More... | |
double | EffectiveRealtimeRate () |
Returns the actual real time rate based on elapsed simulation and real time. More... | |
int | get_executed_steps () const |
Returns the number of executed steps. More... | |
double | get_start_simtime () const |
Returns the start time, based on simulator clock. More... | |
double | get_last_step_simtime () const |
Returns the simulation time of the last recorded step. More... | |
const TimePoint & | get_start_realtime () const |
Returns the start time, based on real time clock. More... | |
const TimePoint & | get_last_step_realtime () const |
Returns the real time of the last recorded step. More... | |
double | get_expected_realtime_rate () const |
|
explicit |
Creates a new simulation run, starting at start_simtime
.
Assumes that the real-time start is the current time.
[in] | start_simtime | The time the simulation started, in seconds, given by the simulator clock. |
[in] | expected_realtime_rate | The desired real time based in the simulation runner configuration. |
|
explicit |
Creates a new simulation run.
[in] | start_simtime | The time the simulation started, in seconds, given by the simulator clock. |
[in] | expected_realtime_rate | The desired real time based in the simulation runner configuration. |
[in] | start_realtime | The time the simulation started, given by the wall clock. |
double EffectiveRealtimeRate | ( | ) |
Returns the actual real time rate based on elapsed simulation and real time.
double ElapsedRealtime | ( | ) | const |
Returns the real time difference, in seconds, since the run started until the last step.
double ElapsedSimtime | ( | ) | const |
Returns the simulation time difference, in seconds, since the run started until the last step.
int get_executed_steps | ( | ) | const |
Returns the number of executed steps.
double get_expected_realtime_rate | ( | ) | const |
const TimePoint& get_last_step_realtime | ( | ) | const |
Returns the real time of the last recorded step.
double get_last_step_simtime | ( | ) | const |
Returns the simulation time of the last recorded step.
const TimePoint& get_start_realtime | ( | ) | const |
Returns the start time, based on real time clock.
double get_start_simtime | ( | ) | const |
Returns the start time, based on simulator clock.
void RunFinished | ( | ) |
Indicates that the run has finished.
void SetRealtime | ( | const TimePoint & | realtime | ) |
Records the current real time, typically used after a simulation step has occurred.
[in] | realtime | The time the step was executed, given by the wall clock. |
void StepExecuted | ( | double | simtime | ) |
Records that a step was executed by the simulator.
[in] | simtime | The time the step was executed, in seconds, given by the simulator clock. |