#include <adevs_models.h>
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 () |
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().
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().
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().
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().
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.
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.
int adevs::Devs< X >::getProc | ( | ) | [inline] |
Get the processor assignment for this model. A negative number is returned if no assignment was made.