adevs::Devs< X, T > Class Template Reference

#include <adevs_models.h>

Inheritance diagram for adevs::Devs< X, T >:
adevs::Atomic< X, T > adevs::Network< X, T > adevs::Atomic< ExternalType, T > adevs::Network< CellEvent< X >, T > adevs::Network< ExternalType, T > adevs::Network< PortValue< VALUE, PORT >, T > adevs::Network< VALUE, T > adevs::Hybrid< X, T > adevs::ModelWrapper< ExternalType, InternalType, T > adevs::CellSpace< X, T > adevs::Digraph< VALUE, PORT, T > adevs::SimpleDigraph< VALUE, T >

List of all members.

Public Member Functions

 Devs ()
 Default constructor.
virtual ~Devs ()
 Destructor.
virtual Network< X, T > * typeIsNetwork ()
virtual Atomic< X, T > * typeIsAtomic ()
 Returns NULL if this is not an atomic model; returns itself otherwise.
const Network< X, T > * getParent () const
Network< X, T > * getParent ()
void setParent (Network< X, T > *parent)
virtual bool model_transition ()
virtual T lookahead ()
void setProc (int proc)
int getProc ()

Detailed Description

template<class X, class T = double>
class adevs::Devs< X, T >

The Devs class provides basic operations for all devs models. The model I/O type is set by the template argument X. The type to be used for time is set with the template argument T. The default type for time is double.


Member Function Documentation

template<class X, class T = double>
const Network<X,T>* adevs::Devs< X, T >::getParent (  )  const [inline]

Get the model that contains this model as a component. Returns NULL if this model is at the top of the hierarchy.

Referenced by adevs::Simulator< X, T >::computeNextState().

template<class X, class T = double>
int adevs::Devs< X, T >::getProc (  )  [inline]

Get the processor assignment for this model. A negative number is returned if no assignment was made.

template<class X, class T = double>
virtual T adevs::Devs< X, T >::lookahead (  )  [inline, virtual]

This method should return the model's lookahead, which is used by the parallel simulator to detect opportunities for parallel execution. The lookahead of a model (network or atomic) is the time into the future for which its output can be predicted without knowledge of the input to that that. This method returns zero by default.

template<class X, class T = double>
virtual bool adevs::Devs< X, T >::model_transition (  )  [inline, virtual]

This is the structure transition function. It should return true if a structure change is to occur, and false otherwise. False is the default return value. This method is used by the simulator to limit the execution of potentially expensive structure changes. If the return value is true, then the parent's model_transition() will also be evaluated. For network models, the model_transition() function is preceded and anteceded by a call to getComponents(). The difference of these two sets is used to determine if any models were added or removed as part of the model transition.

Referenced by adevs::Simulator< X, T >::computeNextState().

template<class X, class T = double>
void adevs::Devs< X, T >::setParent ( Network< X, T > *  parent  )  [inline]

Assign a new parent to this model. Network model's should always call this method to make themselves the parent of their components. If the parent is not set correctly, then the event routing algorithm in the simulator will fail.

Referenced by adevs::SimpleDigraph< VALUE, T >::add(), adevs::Digraph< VALUE, PORT, T >::add(), and adevs::CellSpace< X, T >::add().

template<class X, class T = double>
void adevs::Devs< X, T >::setProc ( int  proc  )  [inline]

This assigns the model to a processor on the parallel computer. If this is a network model, then its assignment will override the assignment of its components. If no assignment is made, then the atomic leaves of the model (or the model itself if it is already atomic) are assigned at random.

template<class X, class T = double>
virtual Network<X,T>* adevs::Devs< X, T >::typeIsNetwork (  )  [inline, virtual]

Returns NULL if this is not a network model; returns a pointer to itself otherwise. This method is used to avoid a relatively expensive dynamic cast.

Reimplemented in adevs::Network< X, T >, adevs::Network< InternalType, T >, adevs::Network< ExternalType, T >, adevs::Network< CellEvent< X >, T >, adevs::Network< VALUE, T >, and adevs::Network< PortValue< VALUE, PORT >, T >.

Referenced by adevs::Simulator< X, T >::computeNextState().


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

Generated on 3 Jul 2013 for adevs by  doxygen 1.6.1