adevs::Devs< X > Class Template Reference

#include <adevs_models.h>

Inheritance diagram for adevs::Devs< X >:

adevs::Atomic< X > adevs::Network< X > adevs::DESS< X > adevs::CellSpace< X > adevs::Digraph< VALUE, PORT > adevs::rk4< X > adevs::rk45< X > adevs::rk45_improved< X >

List of all members.

Public Member Functions

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


Detailed Description

template<class X>
class adevs::Devs< X >

The Devs class provides basic operations for all devs models. The model I/O type can be specialized with the the template argument.

Member Function Documentation

template<class X>
virtual Network<X>* adevs::Devs< X >::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 >, adevs::Network< adevs::PortValue< VALUE, PORT > >, adevs::Network< InternalType >, adevs::Network< adevs::CellEvent< X > >, adevs::Network< VALUE >, and adevs::Network< ExternalType >.

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

template<class X>
const Network<X>* adevs::Devs< X >::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 >::computeNextOutput(), and adevs::Simulator< X >::computeNextState().

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

Assign a new parent to this model. This method is intended to support end user network models.

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

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

This is the model transition function. It should return true if a model transition occurs, 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 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 >::computeNextState().

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

If you are using the parallel simulator, then this must return the model's lookahead. It returns zero by default.

template<class X>
void adevs::Devs< X >::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>
int adevs::Devs< X >::getProc (  )  [inline]

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


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

Generated on Mon Mar 16 07:32:24 2009 for adevs by  doxygen 1.5.5