template<typename ExternalType, typename InternalType> class adevs::ModelWrapper

This class wraps a Network or Atomic model with interface type InternalType in an Atomic model with interface type ExternalType.


Inheritance:


Public Methods

[more] ModelWrapper(Devs<InternalType>* model)
Create a wrapper for the specified model.
[more]virtual void translateInput(const Bag<ExternalType>& external_input, Bag<Event<InternalType> >& internal_input) = 0
This method is used to translate incoming input objects into input objects that the wrapped model can process.
[more]virtual void translateOutput(const Bag<Event<InternalType> >& internal_output, Bag<ExternalType>& external_output) = 0
This method is used to translate outgoing output objects into objects that the ModelWrapper can produce.
[more]virtual void gc_input(Bag<Event<InternalType> >& g) = 0
This is the garbage collection method for internal input events.
[more]Devs<InternalType> * getWrappedModel()
Get the model that is wrapped by this object
[more]void delta_int()
Atomic internal transition function
[more]void delta_ext(double e, const Bag<ExternalType>& xb)
Atomic external transition function
[more]void delta_conf(const Bag<ExternalType>& xb)
Atomic confluent transition function
[more]void output_func(Bag<ExternalType>& yb)
Atomic output function
[more]double ta()
Atomic time advance function
[more]void outputEvent(Event<InternalType> y, double t)
EventListener outputEvent method
[more] ~ModelWrapper()
Destructor.


Inherited from Atomic:

Public Methods

ovirtual void gc_output(Bag<X>& g)
oAtomic<X> * typeIsAtomic()

Protected Methods

odouble getLastEventTime() const


Inherited from Devs:

Public Methods

ovirtual Network<X> * typeIsNetwork()
oconst Network<X> * getParent() const
oNetwork<X> * getParent()
ovoid setParent(Network<X>* parent)
ovirtual bool model_transition()


Inherited from EventListener:


Documentation

This class wraps a Network or Atomic model with interface type InternalType in an Atomic model with interface type ExternalType. Input to the ModelWrapper is passed through a user provided input translation method before being handed off to the wrapped model for processing. Output from the wrapped model is passed through a user provided output translation method before emerging as output from teh ModelWrapper. If the wrapped model is a Network, the input translation method can create inputs for any of its components. Similarly the output translation method is provided with every output produced by every component in the Network. If the wrapped model is Atomic then there is, of course, only one possible destination for incoming events and only one source of outgoing events.

You will need to implement the usual gc_output event for outputs produced by the ModelWrapper. You will also need to implement gcInputEvents method to clean up events that are created during the input translation process.

o ModelWrapper(Devs<InternalType>* model)
Create a wrapper for the specified model. The ModelWrapper takes ownership of the supplied model and will delete it when the ModelWrapper is deleted.

ovirtual void translateInput(const Bag<ExternalType>& external_input, Bag<Event<InternalType> >& internal_input) = 0
This method is used to translate incoming input objects into input objects that the wrapped model can process. The supplied internal_input bag should be filled with Events that contain the targeted internal models and the values to supply to them. The external_input bag contains the input values supplied to the wrapper's external or confluent transition function.

ovirtual void translateOutput(const Bag<Event<InternalType> >& internal_output, Bag<ExternalType>& external_output) = 0
This method is used to translate outgoing output objects into objects that the ModelWrapper can produce. The internal_output bag contains all of the output events that the were produced by the wrapped model. The external_output bag should be filled with objects of type ExternalType that will be produced as output by the ModelWrapper.

ovirtual void gc_input(Bag<Event<InternalType> >& g) = 0
This is the garbage collection method for internal input events. It will be called when the wrapper is done with a set of events that you created with the translateInput method. The supplied bag is the same one that you filled out in the translateInput method.

oDevs<InternalType> * getWrappedModel()
Get the model that is wrapped by this object

ovoid delta_int()
Atomic internal transition function

ovoid delta_ext(double e, const Bag<ExternalType>& xb)
Atomic external transition function

ovoid delta_conf(const Bag<ExternalType>& xb)
Atomic confluent transition function

ovoid output_func(Bag<ExternalType>& yb)
Atomic output function

odouble ta()
Atomic time advance function

ovoid outputEvent(Event<InternalType> y, double t)
EventListener outputEvent method

o ~ModelWrapper()
Destructor. This destroys the wrapped model too.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.