Tutorials 4.4 Events : Différence entre versions

De Wiki
Aller à : navigation, rechercher
(Page créée avec « == What is an Event ? == An [{{JavaDoc4.4}}/fr/cnes/sirius/patrius/propagation/events/EventDetector.html EventDetector] corresponds to an object that will allow to a prop... »)
 
(What is an Event ?)
 
Ligne 8 : Ligne 8 :
 
* the fact that the event will be checked several time or not.
 
* the fact that the event will be checked several time or not.
  
The following code example shows how to define an <font color=#FF8C00 title="Argument Of Latitude">AOL</font> detector with all these possibilities.
+
The following code example shows how to define an anomaly detector with all these possibilities.
  
'''Code example:''' [[AOLEvent_4.4|AOL event detector]]
+
'''Code example:''' [[AnomalyEvent_4.4|Anomaly event detector]]
  
 
== Using AbstractDetector class ==
 
== Using AbstractDetector class ==

Version actuelle en date du 3 octobre 2019 à 12:03

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 anomaly detector with all these possibilities.

Code example: Anomaly 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