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

This class offers the standard PDEVS interface for an atomic model. More...

#include <adevs_pdevs.h>

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

Public Member Functions

virtual void delta_int ()=0
 Internal transition function.
 
virtual void delta_ext (TimeType e, std::vector< DataType > &x)=0
 External transition function.
 
virtual void delta_conf (std::vector< DataType > &x)=0
 Confluent transition function.
 
virtual TimeType ta ()=0
 Time advance function.
 
virtual void output_func (std::vector< DataType > &y)=0
 Output function. More...
 
TimeType init (SimEnv< DataType, TimeType > *env)
 Schedules the first output event. Do not override this method.
 
TimeType update (SimEnv< DataType, TimeType > *env)
 
TimeType update (SimEnv< DataType, TimeType > *env, std::vector< DataType > &x)
 Implements the external and confluent transitions. Do not override.
 
void fini (TimeType)
 No op fini.
 
void add (SimEnv< DataType, TimeType > *env)
 Adds this model to the simulation context.
 
- Public Member Functions inherited from adevs::Devs< DataType, TimeType >
Network< DataType, TimeType > * parent () const
 Get the parent of this model. More...
 
- Public Member Functions inherited from adevs::Model< DataType, TimeType >
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...
 

Detailed Description

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

This class offers the standard PDEVS interface for an atomic model.

The time advance method ta() returns the lifetime of the current state. Given state q at time now, the state will still be q at q+ta() and a new state will be assigned via delta_int(), delta_ext(), or delta_conf() at time (now+ta())+adevs_epsilon()). The output for state q will occur at time t+ta() and be delivered to other models at (t+ta())+adevs_epsilon().

Member Function Documentation

◆ output_func()

template<typename DataType , typename TimeType = Time>
virtual void adevs::Atomic< DataType, TimeType >::output_func ( std::vector< DataType > &  y)
pure virtual

Output function.

Data to be delivered to other models must be inserted into the supplied vector.

Parameters
yA vector to be filled with data for other models

◆ update()

template<typename DataType , typename TimeType >
TimeType adevs::Atomic< DataType, TimeType >::update ( SimEnv< DataType, TimeType > *  env)
virtual

Implements the internal transition and output function. Do not override.

Implements adevs::Model< DataType, TimeType >.

References adevs::SimEnv< DataType, TimeType >::now().


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