- 3.0.2 core module.
|
Interface for an event handler for an Integrator. More...
#include <EventHandler.h>
Public Member Functions | |
EventHandler () | |
Default constructor. More... | |
virtual | ~EventHandler () |
destructor More... | |
virtual bool | callOnSubsteps ()=0 |
virtual void | reset ()=0 |
reset event handler More... | |
virtual bool | checkEvent (const StateVector< STATE_DIM, SCALAR > &state, const SCALAR &t)=0 |
check if an event has happened More... | |
virtual void | handleEvent (const StateVector< STATE_DIM, SCALAR > &state, const SCALAR &t)=0 |
handle the event More... | |
Interface for an event handler for an Integrator.
An Integrator can call an EventHandler after each integration step to check or log current states etc. This is useful for terminating integrators or checking for events such as system dynamic switches in hybrid systems.
Derive from this class to implement your custom event handler.
STATE_DIM | dimensionality of the state vector |
|
inline |
Default constructor.
|
inlinevirtual |
destructor
|
pure virtual |
|
pure virtual |
reset event handler
Implemented in ct::core::SubstepRecorder< STATE_DIM, CONTROL_DIM, SCALAR >, ct::core::KillIntegrationEventHandler< STATE_DIM >, and ct::core::MaxStepsEventHandler< STATE_DIM >.
Referenced by ct::core::EventHandler< STATE_DIM >::~EventHandler().
|
pure virtual |
check if an event has happened
checks if an event has happened and whether handleEvent() needs to be called
state | current state of the system |
t | current time |
Referenced by ct::core::EventHandler< STATE_DIM >::~EventHandler().
|
pure virtual |
handle the event
does something with an event that just occurred
state | current state of the system |
t | current time |
Referenced by ct::core::EventHandler< STATE_DIM >::~EventHandler().