Main Page | Class Hierarchy | Class List | File List | Class Members

adevs::Simulator< X > Class Template Reference

#include <adevs_simulator.h>

Inheritance diagram for adevs::Simulator< X >:

adevs::AbstractSimulator< X > List of all members.

Public Member Functions

 Simulator (Devs< X > *model)
double nextEventTime ()
 Get the model's next event time.
void execNextEvent ()
 Execute the simulation cycle at time nextEventTime().
void execUntil (double tend)
 Execute until nextEventTime() > tend.
void computeNextOutput ()
void computeNextState (Bag< Event< X > > &input, double t)
 ~Simulator ()
void addModel (Atomic< X > *model)
 Simulator (LogicalProcess< X > *lp)

Detailed Description

template<class X>
class adevs::Simulator< X >

This Simulator class implements the DEVS simulation algorithm. Its methods can throw adevs::exception objects if any of the DEVS model constraints are violated (i.e., a negative time advance of a model attempting to send an input directly to itself).


Constructor & Destructor Documentation

template<class X>
adevs::Simulator< X >::Simulator Devs< X > *  model  )  [inline]
 

Create a simulator for the provided model. The simulator constructor will fail and throw an adevs::exception if the time advance of any component atomic model is less than zero.

template<class X>
adevs::Simulator< X >::~Simulator  ) 
 

Deletes the simulator, but leaves the model intact. The model must exist when the simulator is deleted. Delete the model only after the Simulator is deleted.

template<class X>
adevs::Simulator< X >::Simulator LogicalProcess< X > *  lp  )  [inline]
 

Create a simulator that will be used by an LP as part of a parallel simulation.


Member Function Documentation

template<class X>
void adevs::Simulator< X >::addModel Atomic< X > *  model  )  [inline]
 

Assign a model to the simulator. This has the same effect as passing the model to the constructor.

template<class X>
void adevs::Simulator< X >::computeNextOutput  ) 
 

Compute the output values of the imminent models if these values have not already been computed. This will notify the EventListener objects as the outputs are found. This, in effect, implements the output function of the resultant model.

template<class X>
void adevs::Simulator< X >::computeNextState Bag< Event< X > > &  input,
double  t
 

Apply the specified inputs at time t and then compute the next model states. Requires that lastEventTime() <= t <= nextEventTime(). This, in effect, implements the state transition function of the resultant model.


The documentation for this class was generated from the following file:
Generated on Mon Jun 1 09:53:43 2009 for adevs by  doxygen 1.3.9.1