31 #ifndef __adevs_wrapper_h_
32 #define __adevs_wrapper_h_
33 #include "adevs_models.h"
54 template <
typename ExternalType,
typename InternalType,
class T =
double>
class ModelWrapper:
55 public Atomic<ExternalType,T>,
110 ModelWrapper(
const ModelWrapper&){}
111 void operator=(
const ModelWrapper&){}
113 Bag<Event<InternalType,T> > input;
115 Bag<Event<InternalType,T> > output;
117 Devs<InternalType,T>* model;
119 Simulator<InternalType,T>* sim;
124 template <
typename ExternalType,
typename InternalType,
class T>
135 template <
typename ExternalType,
typename InternalType,
class T>
139 tL = sim->nextEventTime();
141 sim->execNextEvent();
144 template <
typename ExternalType,
typename InternalType,
class T>
150 translateInput(xb,input);
152 sim->computeNextState(input,tL);
158 template <
typename ExternalType,
typename InternalType,
class T>
162 tL = sim->nextEventTime();
164 translateInput(xb,input);
166 sim->computeNextState(input,tL);
172 template <
typename ExternalType,
typename InternalType,
class T>
175 if (sim->nextEventTime() < adevs_inf<T>())
return sim->nextEventTime()-tL;
176 else return adevs_inf<T>();
179 template <
typename ExternalType,
typename InternalType,
class T>
183 sim->computeNextOutput();
185 translateOutput(output,yb);
191 template <
typename ExternalType,
typename InternalType,
class T>
198 template <
typename ExternalType,
typename InternalType,
class T>