FieldManeuverTriggersResetter.java

  1. /* Copyright 2002-2022 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.forces.maneuvers.trigger;

  18. import org.hipparchus.CalculusFieldElement;
  19. import org.orekit.propagation.FieldSpacecraftState;
  20. import org.orekit.time.FieldAbsoluteDate;

  21. /** Resetter for maneuver triggers.
  22.  * @param <T> type of the field elements
  23.  * @see AbstractManeuverTriggers
  24.  * @author Luc Maisonobe
  25.  * @since 11.1
  26.  */
  27. public interface FieldManeuverTriggersResetter<T extends CalculusFieldElement<T>> {

  28.     /** Initialization method called at propagation start.
  29.      * <p>
  30.      * The default implementation does nothing.
  31.      * </p>
  32.      * @param initialState initial spacecraft state (at the start of propagation).
  33.      * @param target date of propagation. Not equal to {@code initialState.getDate()}.
  34.      */
  35.     default void init(FieldSpacecraftState<T> initialState, FieldAbsoluteDate<T> target) {
  36.         // nothing by default
  37.     }

  38.     /** Observe a maneuver trigger.
  39.      * <p>
  40.      * The {@code start} parameter corresponds to physical flow of time
  41.      * from past to future, not to propagation direction which can be backward.
  42.      * This means that during forward propagations, the first call will have
  43.      * {@code start} set to {@code true} and the second call will have
  44.      * {@code start} set to {@code false}, whereas in backward propagation,
  45.      * the first call will have {@code start} set to {@code false} and the second
  46.      * call will have {@code start} set to {@code true}.
  47.      * </p>
  48.      * @param state spacecraft state at trigger date (before applying the maneuver)
  49.      * @param start if true, the trigger is the start of the maneuver
  50.      */
  51.     void maneuverTriggered(FieldSpacecraftState<T> state, boolean start);

  52.     /** Reset state as a maneuver triggers.
  53.      * @param state spacecraft state at trigger date
  54.      * @return reset state taking into account maneuver start/stop
  55.      */
  56.     FieldSpacecraftState<T> resetState(FieldSpacecraftState<T> state);

  57. }