Tutorials 4.0 Events : Différence entre versions
m (Admin a déplacé la page EventsTutorials vers Tutorials 4.0 Events sans laisser de redirection) |
|
(Aucune différence)
|
Version actuelle en date du 27 mars 2018 à 14:01
What is an Event ?
An EventDetector corresponds to an object that will allow to a propagator to determine when this event will occurred.
PATRIUS will already propose a great amount of predefined events (anomaly, AOL, altitude, eclipse, ...). These events may be called with "by default" values or may be customized by defining:
- its maximum check interval (in seconds)
- the threshold value below which the convergence is acquired (in seconds)
- the fact that the event will be checked several time or not.
The following code example shows how to define an AOL detector with all these possibilities.
Code example: AOL event detector
Using AbstractDetector class
If you have not found a predefined event detector into the PATRIUS list, you can build yourself you own detector using the AbstractDetector class.
In such a case, you will have to redefined:
- eventOccurred() method ; when the event has occured, this method will be called by the propagator and will return the appropriate action
- g() method ; this method will return a double value which trigger the event when it will reach zero (+/- the threshold)
- shouldBeRemoved() method
Code example: Event using AbstractDetector class
Using EventDetector interface
if you want to customize deeper your event detector, rather than to use AbstractDetector class, you may use EventDetector interface.
In such a case, you will have to redefined:
- eventOccurred() method ; when the event has occured, this method will be called by the propagator and will return the appropriate action
- getMaxCheckInterval() method ; this method will return a double value which trigger the event when it will reach zero (+/- the threshold)
- getMaxIterationCount() method
- getSlopeSelection() method
- getThreshold() method
- init() method
- resetState() method
- shouldBeRemoved() method
Code example: Event using EventDetector interface