Class SingleDateDetector

All Implemented Interfaces:
EventDetector, TimeShiftable<SingleDateDetector>, TimeStamped

public class SingleDateDetector extends AbstractDetector<SingleDateDetector> implements TimeStamped, TimeShiftable<SingleDateDetector>
Finder for single date detection. The event function is positive after, negative before.
Since:
14.0
Author:
Romain Serra
See Also:
  • Constructor Details

    • SingleDateDetector

      public SingleDateDetector(SingleDateEventFunction eventFunction, EventDetectionSettings detectionSettings, EventHandler eventHandler)
      Full constructor.
      Parameters:
      eventFunction - event function
      detectionSettings - event detection settings
      eventHandler - event handler
    • SingleDateDetector

      public SingleDateDetector(EventHandler eventHandler, AbsoluteDate date)
      Build a new instance with default detection settings.
      Parameters:
      eventHandler - event handler
      date - event date
    • SingleDateDetector

      public SingleDateDetector(AbsoluteDate date)
      Build a new instance with default detection settings and event handler (stop on event).
      Parameters:
      date - event date
  • Method Details

    • create

      protected SingleDateDetector create(EventDetectionSettings detectionSettings, EventHandler newHandler)
      Build a new instance.
      Specified by:
      create in class AbstractDetector<SingleDateDetector>
      Parameters:
      detectionSettings - detection settings
      newHandler - event handler to call at event occurrences
      Returns:
      a new instance of the appropriate sub-type
    • g

      public double g(SpacecraftState s)
      Compute the value of the switching function. This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.
      Specified by:
      g in interface EventDetector
      Parameters:
      s - the current state information: date, kinematics, attitude
      Returns:
      value of the switching function
    • getDate

      public AbsoluteDate getDate()
      Get the date.
      Specified by:
      getDate in interface TimeStamped
      Returns:
      date attached to the object
    • shiftedBy

      public SingleDateDetector shiftedBy(double dt)
      Get a time-shifted instance.
      Specified by:
      shiftedBy in interface TimeShiftable<SingleDateDetector>
      Parameters:
      dt - time shift in seconds
      Returns:
      a new instance, shifted with respect to instance (which is not changed)
    • withDate

      public SingleDateDetector withDate(AbsoluteDate newDate)
      Create new instance with input date.
      Parameters:
      newDate - new date to be detected
      Returns:
      new detector