Tutorials 4.0 Events : Différence entre versions
(Page créée avec « == What is an Event ? == An [{{PathCurrentJavaDoc}}/fr/cnes/sirius/patrius/propagation/events/EventDetector.html EventDetector] corresponds to an object that will allow t... ») |
|||
Ligne 38 : | Ligne 38 : | ||
'''Code example:''' [[EventUsingEventDetector|Event using EventDetector interface]] | '''Code example:''' [[EventUsingEventDetector|Event using EventDetector interface]] | ||
+ | |||
+ | [[Category:Tutorials]] |
Version du 15 février 2018 à 12:47
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