- 3.0.2 core module.
ct::core::EventHandler< STATE_DIM, SCALAR > Class Template Referenceabstract

Interface for an event handler for an Integrator. More...

#include <EventHandler.h>

Inheritance diagram for ct::core::EventHandler< STATE_DIM, SCALAR >:
ct::core::SubstepRecorder< STATE_DIM, CONTROL_DIM, SCALAR >

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...
 

Detailed Description

template<size_t STATE_DIM, typename SCALAR = double>
class ct::core::EventHandler< STATE_DIM, SCALAR >

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.

Template Parameters
STATE_DIMdimensionality of the state vector

Constructor & Destructor Documentation

◆ EventHandler()

template<size_t STATE_DIM, typename SCALAR = double>
ct::core::EventHandler< STATE_DIM, SCALAR >::EventHandler ( )
inline

Default constructor.

◆ ~EventHandler()

template<size_t STATE_DIM, typename SCALAR = double>
virtual ct::core::EventHandler< STATE_DIM, SCALAR >::~EventHandler ( )
inlinevirtual

destructor

Member Function Documentation

◆ callOnSubsteps()

template<size_t STATE_DIM, typename SCALAR = double>
virtual bool ct::core::EventHandler< STATE_DIM, SCALAR >::callOnSubsteps ( )
pure virtual

◆ reset()

template<size_t STATE_DIM, typename SCALAR = double>
virtual void ct::core::EventHandler< STATE_DIM, SCALAR >::reset ( )
pure virtual

◆ checkEvent()

template<size_t STATE_DIM, typename SCALAR = double>
virtual bool ct::core::EventHandler< STATE_DIM, SCALAR >::checkEvent ( const StateVector< STATE_DIM, SCALAR > &  state,
const SCALAR t 
)
pure virtual

check if an event has happened

checks if an event has happened and whether handleEvent() needs to be called

Parameters
statecurrent state of the system
tcurrent time
Returns
true if an event has happened

Referenced by ct::core::EventHandler< STATE_DIM >::~EventHandler().

◆ handleEvent()

template<size_t STATE_DIM, typename SCALAR = double>
virtual void ct::core::EventHandler< STATE_DIM, SCALAR >::handleEvent ( const StateVector< STATE_DIM, SCALAR > &  state,
const SCALAR t 
)
pure virtual

handle the event

does something with an event that just occurred

Parameters
statecurrent state of the system
tcurrent time

Referenced by ct::core::EventHandler< STATE_DIM >::~EventHandler().


The documentation for this class was generated from the following file: