SyDEVS
v0.6.7
Multiscale Simulation and Systems Modeling Library
|
A data structure which represents progress through a simulation, encapsulating both simulated time and a counter of events within a single point in simulated time. More...
#include <discrete_event_time.h>
Public Member Functions | |
discrete_event_time () | |
Constructs a discrete_event_time object starting at time zero and a counter value of zero. More... | |
discrete_event_time (const time_point &t) | |
Constructs a discrete_event_time object starting at time t and a counter value of zero. More... | |
discrete_event_time (const time_point &t, int64 c) | |
Constructs a discrete_event_time object starting at time t and a counter value of c . More... | |
discrete_event_time (const discrete_event_time &)=default | |
Copy constructor. More... | |
discrete_event_time & | operator= (const discrete_event_time &)=default |
Copy assignment. More... | |
discrete_event_time (discrete_event_time &&)=default | |
Move constructor. More... | |
discrete_event_time & | operator= (discrete_event_time &&)=default |
Move assignment. More... | |
virtual | ~discrete_event_time ()=default |
Destructor. More... | |
const time_point & | t () const |
Return the current point in simulated time. More... | |
int64 | t_index () const |
Return the index associated with the current point in simulated time. More... | |
int64 | c () const |
Return the counter value of associated with the current point in simulated time. More... | |
void | advance (duration dt, const time_point &end_t) |
Advance the simulated time point by dt , but not beyond end_t . More... | |
void | advance () |
Advance the counter without changing simulated time point. More... | |
A data structure which represents progress through a simulation, encapsulating both simulated time and a counter of events within a single point in simulated time.
A discrete_event_time
object tracks both a simulated time point and the number of events or steps that have occurred within that time point. Whenever the simulated time point advances, the counter of past events is reset to zero.
Below is an example of how a discrete_event_time
object can be initialized and advanced.
|
inline |
Constructs a discrete_event_time
object starting at time zero and a counter value of zero.
|
inline |
Constructs a discrete_event_time
object starting at time t
and a counter value of zero.
|
inline |
Constructs a discrete_event_time
object starting at time t
and a counter value of c
.
|
default |
Copy constructor.
|
default |
Move constructor.
|
virtualdefault |
Destructor.
|
inline |
Advance the simulated time point by dt
, but not beyond end_t
.
|
inline |
Advance the counter without changing simulated time point.
|
inline |
Return the counter value of associated with the current point in simulated time.
|
default |
Copy assignment.
|
default |
Move assignment.
|
inline |
Return the current point in simulated time.
|
inline |
Return the index associated with the current point in simulated time.