public class FieldEventsLogger<T extends CalculusFieldElement<T>> extends Object
As events detectors
are triggered during
orbit propagation, an event specific eventOccurred
method is called. This class can be used to add a global logging
feature registering all events with their corresponding states in
a chronological sequence (or reverse-chronological if propagation
occurs backward).
This class works by wrapping user-provided events detectors
before they are registered to the propagator. The
wrapper monitor the calls to eventOccurred
and store the corresponding events as FieldEventsLogger.FieldLoggedEvent
instances.
After propagation is complete, the user can retrieve all the events
that have occurred at once by calling method getLoggedEvents()
.
Modifier and Type | Class and Description |
---|---|
static class |
FieldEventsLogger.FieldLoggedEvent<T extends CalculusFieldElement<T>>
Class for logged events entries.
|
Constructor and Description |
---|
FieldEventsLogger()
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clearLoggedEvents()
Clear the logged events.
|
List<FieldEventsLogger.FieldLoggedEvent<T>> |
getLoggedEvents()
Get an immutable copy of the logged events.
|
<D extends FieldEventDetector<T>> |
monitorDetector(D monitoredDetector)
Monitor an event detector.
|
public FieldEventsLogger()
Build an empty logger for events detectors.
public <D extends FieldEventDetector<T>> FieldEventDetector<T> monitorDetector(D monitoredDetector)
In order to monitor an event detector, it must be wrapped thanks to this method as follows:
Propagator propagator = new XyzPropagator(...); EventsLogger logger = new EventsLogger(); FieldEventDetector<T> detector = new UvwDetector(...); propagator.addEventDetector(logger.monitorDetector(detector));
Note that the event detector returned by the getEventDetector
method in
FieldLoggedEvent
instances returned by getLoggedEvents()
are the monitoredDetector
instances
themselves, not the wrapping detector returned by this method.
D
- class type for the generic versionmonitoredDetector
- event detector to monitorpublic void clearLoggedEvents()
public List<FieldEventsLogger.FieldLoggedEvent<T>> getLoggedEvents()
The copy is independent of the logger. It is preserved
event if the clearLoggedEvents
method
is called and the logger reused in another propagation.
Copyright © 2002-2023 CS GROUP. All rights reserved.