#include <adevs_hybrid.h>
Public Member Functions | |
Hybrid (ode_system< X > *sys, ode_solver< X > *solver, event_locator< X > *event_finder) | |
double | getState (int k) const |
Get the value of the kth continuous state variable. | |
const double * | getState () const |
Get the array of state variables. | |
ode_system< X > * | getSystem () |
Get the system that this solver is operating on. | |
bool | eventHappened () const |
Did a discrete event occur at the last state transition? | |
void | delta_int () |
void | delta_ext (T e, const Bag< X > &xb) |
void | delta_conf (const Bag< X > &xb) |
T | ta () |
Do not override. | |
void | output_func (Bag< X > &yb) |
Do not override. Invokes the ode_system output function as needed. | |
void | gc_output (Bag< X > &gb) |
Do not override. Invokes the ode_system gc_output method as needed. | |
virtual | ~Hybrid () |
Destructor deletes everything. |
This Atomic model encapsulates an ode_system and numerical solvers for it. Output from the Hybrid model is produced by the output_func method of the ode_system whenever a state event or time event occurs. Internal, external, and confluent events for the Hybrid model are computed with the corresponding methods of the ode_system. The time advance of the Hybrid class ensures that its internal events coincide with state and time events in the ode_system.
adevs::Hybrid< X, T >::Hybrid | ( | ode_system< X > * | sys, | |
ode_solver< X > * | solver, | |||
event_locator< X > * | event_finder | |||
) | [inline] |
Create and initialize a simulator for the system. All objects are adopted by the Hybrid object and are deleted when it is.
References adevs::ode_system< X >::init(), adevs::ode_system< X >::numEvents(), and adevs::ode_system< X >::numVars().
void adevs::Hybrid< X, T >::delta_conf | ( | const Bag< X > & | xb | ) | [inline, virtual] |
Do not override. This method invokes the ode_system method for confluent events as needed.
Implements adevs::Atomic< X, T >.
References adevs::Bag< T >::clear(), adevs::Bag< T >::empty(), and adevs::Hybrid< X, T >::ta().
void adevs::Hybrid< X, T >::delta_ext | ( | T | e, | |
const Bag< X > & | xb | |||
) | [inline, virtual] |
Do not override this method. It performs numerical integration and invokes the ode_system for external events as needed.
Implements adevs::Atomic< X, T >.
References adevs::Hybrid< X, T >::output_func().
void adevs::Hybrid< X, T >::delta_int | ( | ) | [inline, virtual] |
Do not override this method. It performs numerical integration and invokes the ode_system method for internal events as needed.
Implements adevs::Atomic< X, T >.
References adevs::Bag< T >::clear(), adevs::Bag< T >::empty(), and adevs::Hybrid< X, T >::ta().