adevs
Public Member Functions | Friends | List of all members
adevs::Devs< DataType, TimeType > Class Template Referenceabstract

This is the base class for all components in a Parallel DEVS model. More...

#include <adevs_pdevs.h>

Inheritance diagram for adevs::Devs< DataType, TimeType >:
adevs::Model< DataType, TimeType > adevs::Atomic< DataType, TimeType > adevs::Network< DataType, TimeType > adevs::SimpleDigraph< DataType, TimeType >

Public Member Functions

Network< DataType, TimeType > * parent () const
 Get the parent of this model. More...
 
virtual void add (SimEnv< DataType, TimeType > *env)=0
 Add this model and any submodels to the simulation.
 
- Public Member Functions inherited from adevs::Model< DataType, TimeType >
virtual TimeType init (SimEnv< DataType, TimeType > *env)=0
 Called when the model is added to the simulation. More...
 
virtual void fini (TimeType now)=0
 Called after the model has been removed from the simulation. More...
 
virtual TimeType update (SimEnv< DataType, TimeType > *env, std::vector< DataType > &x)=0
 Called to assign a new state to the model at now() when input is present. More...
 
virtual TimeType update (SimEnv< DataType, TimeType > *env)=0
 Called to assign a new state to the model at now(). More...
 
virtual std::pair< Model< DataType, TimeType > *, DataType > relay (Model< DataType, TimeType > *src, DataType x)
 Relay a message to another model. More...
 
virtual std::string name ()
 Return a name for this model. More...
 
virtual ~Model ()
 Destructor.
 
void reset ()
 Reset simulation support to reuse the model in a new simulation context. More...
 

Friends

class Network< DataType, TimeType >
 

Detailed Description

template<typename DataType, typename TimeType = Time>
class adevs::Devs< DataType, TimeType >

This is the base class for all components in a Parallel DEVS model.

You can use this to implement basic behavior by implementing the update methods or use the Atomic class instead. If using the update methods, then sending a message to the parent is the way to generate input for other components belonging to that parent.

Member Function Documentation

◆ parent()

template<typename DataType, typename TimeType = Time>
Network<DataType,TimeType>* adevs::Devs< DataType, TimeType >::parent ( ) const
inline

Get the parent of this model.

Messages sent to the parent will be redirected redirected via its route method.

Returns
The parent of this model.

Referenced by adevs::Network< port_value< DataType >, TimeType >::relay(), and adevs::Atomic< DataType, TimeType >::update().


The documentation for this class was generated from the following file: