|
adevs
|
The simulator generates trajectories for its models. More...
#include <adevs_base.h>
Public Member Functions | |
| Simulator (TimeType tStart=adevs_zero< TimeType >()) | |
| Constructor sets the simulation start time. More... | |
| ~Simulator () | |
| Destructor leaves all models intact. | |
| void | send (Model< DataType, TimeType > *src, Model< DataType, TimeType > *dst, DataType data) |
| Send a message to a model. More... | |
| void | add (Model< DataType, TimeType > *model) |
| Add a model to the simulation context. More... | |
| void | remove (Model< DataType, TimeType > *model) |
| Remove a model from the simulation context. More... | |
| TimeType | now () |
| Returns the current simulation time. | |
| TimeType | next_event_time () const |
| Returns the time of the next event. | |
| void | exec_next_event () |
| Execute update() methods at the next event time. | |
| void | exec_until (TimeType t) |
| Advance until the simulation time until it equals the supplied time. | |
Public Member Functions inherited from adevs::SimEnv< DataType, TimeType > | |
| virtual | ~SimEnv () |
| Destructor. | |
The simulator generates trajectories for its models.
The template argument is the data type of a message.
| adevs::Simulator< DataType, TimeType >::Simulator | ( | TimeType | tStart = adevs_zero<TimeType>() | ) |
Constructor sets the simulation start time.
| tStart | The simulation start time. Default is zero. |
|
virtual |
Add a model to the simulation context.
This causes Model::init(SimEnv*) to be called at the current simulation time.
Implements adevs::SimEnv< DataType, TimeType >.
References adevs::Model< DataType, TimeType >::init().
|
virtual |
Remove a model from the simulation context.
This causes Model::fini() to be called at the next instant of simulation time.
Implements adevs::SimEnv< DataType, TimeType >.
|
virtual |
Send a message to a model.
This method is used by model's in the context to send to messages to each other. It can also be used to inject data into the simulation. This latter case can use src = NULL.
Implements adevs::SimEnv< DataType, TimeType >.
References adevs::Model< DataType, TimeType >::relay().
1.8.13