|
adevs
|
Interface to a simulation context for sending messages, getting the time, and adding or removing models. More...
#include <adevs_base.h>
Public Member Functions | |
| virtual void | send (Model< DataType, TimeType > *src, Model< DataType, TimeType > *dst, DataType data)=0 |
| Send a message to a model. More... | |
| virtual void | add (Model< DataType, TimeType > *model)=0 |
| Add a model to the simulator. More... | |
| virtual void | remove (Model< DataType, TimeType > *model)=0 |
| Remove a model from a running simulation. More... | |
| virtual TimeType | now ()=0 |
| Get the current time. | |
| virtual | ~SimEnv () |
| Destructor. | |
Interface to a simulation context for sending messages, getting the time, and adding or removing models.
The simulation context passed to the Model update() and init() method is the same context to which the Model was added. The first template argument is the data type of a message and the second is the type to use for time.
|
pure virtual |
Add a model to the simulator.
This method causes the new model to be assigned a state via Model::init(SimEnv*) at time now(). The model being added cannot already be active in the simulation.
| model | The model to add to the simulation |
Implemented in adevs::Simulator< DataType, TimeType >.
Referenced by adevs::Atomic< DataType, TimeType >::add(), and adevs::Model< port_value< DataType >, TimeType >::reset().
|
pure virtual |
Remove a model from a running simulation.
The model is removed at time now()+adevs_epsilon(). At that instant its Model::fini() method is called.
| model | The model to remove |
Implemented in adevs::Simulator< DataType, TimeType >.
|
pure virtual |
Send a message to a model.
Send a message that will be delivered via the destination's update method at now()+adevs_epsilon().
| src | Who is sending the message? |
| dst | Who will receive the message? |
| data | The data to transmit |
Implemented in adevs::Simulator< DataType, TimeType >.
Referenced by adevs::Model< port_value< DataType >, TimeType >::reset(), and adevs::Atomic< DataType, TimeType >::update().
1.8.13