AttitudesSequence.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.attitudes;

  18. import java.util.ArrayList;
  19. import java.util.Arrays;
  20. import java.util.List;

  21. import org.hipparchus.CalculusFieldElement;
  22. import org.hipparchus.Field;
  23. import org.hipparchus.ode.events.Action;
  24. import org.orekit.errors.OrekitException;
  25. import org.orekit.errors.OrekitMessages;
  26. import org.orekit.frames.Frame;
  27. import org.orekit.orbits.Orbit;
  28. import org.orekit.propagation.FieldPropagator;
  29. import org.orekit.propagation.FieldSpacecraftState;
  30. import org.orekit.propagation.Propagator;
  31. import org.orekit.propagation.SpacecraftState;
  32. import org.orekit.propagation.events.EventDetector;
  33. import org.orekit.propagation.events.FieldEventDetector;
  34. import org.orekit.time.AbsoluteDate;
  35. import org.orekit.time.FieldAbsoluteDate;
  36. import org.orekit.utils.AngularDerivativesFilter;
  37. import org.orekit.utils.DoubleArrayDictionary;
  38. import org.orekit.utils.FieldPVCoordinatesProvider;
  39. import org.orekit.utils.PVCoordinatesProvider;
  40. import org.orekit.utils.TimeSpanMap;
  41. import org.orekit.utils.TimeStampedAngularCoordinates;
  42. import org.orekit.utils.TimeStampedFieldAngularCoordinates;

  43. /** This classes manages a sequence of different attitude providers that are activated
  44.  * in turn according to switching events.
  45.  * <p>Only one attitude provider in the sequence is in an active state. When one of
  46.  * the switch event associated with the active provider occurs, the active provider becomes
  47.  * the one specified with the event. A simple example is a provider for the sun lighted part
  48.  * of the orbit and another provider for the eclipse time. When the sun lighted provider is active,
  49.  * the eclipse entry event is checked and when it occurs the eclipse provider is activated.
  50.  * When the eclipse provider is active, the eclipse exit event is checked and when it occurs
  51.  * the sun lighted provider is activated again. This sequence is a simple loop.</p>
  52.  * <p>An active attitude provider may have several switch events and next provider settings, leading
  53.  * to different activation patterns depending on which events are triggered first. An example
  54.  * of this feature is handling switches to safe mode if some contingency condition is met, in
  55.  * addition to the nominal switches that correspond to proper operations. Another example
  56.  * is handling of maneuver mode.
  57.  * <p>
  58.  * Note that this attitude provider is stateful, it keeps in memory the sequence of active
  59.  * underlying providers with their switch dates and the transitions from one provider to
  60.  * the other. This implies that this provider should <em>not</em> be shared among different
  61.  * propagators at the same time, each propagator should use its own instance of this provider.
  62.  * <p>
  63.  * The sequence kept in memory is reset when {@link #resetActiveProvider(AttitudeProvider)}
  64.  * is called, and only the specify provider is kept. The sequence is also partially
  65.  * reset each time a propagation starts. If a new propagation is started after a first
  66.  * propagation has been run, all the already computed switches that occur after propagation
  67.  * start for forward propagation or before propagation start for backward propagation will
  68.  * be erased. New switches will be computed and applied properly according to the new
  69.  * propagation settings. The already computed switches that are not in covered are kept
  70.  * in memory. This implies that if a propagation is interrupted and restarted in the
  71.  * same direction, then attitude switches will remain in place, ensuring that even if the
  72.  * interruption occurred in the middle of an attitude transition the second propagation will
  73.  * properly complete the transition that was started by the first propagator.
  74.  * </p>
  75.  * @author Luc Maisonobe
  76.  * @since 5.1
  77.  */
  78. public class AttitudesSequence implements AttitudeProvider {

  79.     /** Providers that have been activated. */
  80.     private transient TimeSpanMap<AttitudeProvider> activated;

  81.     /** Switching events list. */
  82.     private final List<Switch<?>> switches;

  83.     /** Constructor for an initially empty sequence.
  84.      */
  85.     public AttitudesSequence() {
  86.         activated = null;
  87.         switches  = new ArrayList<Switch<?>>();
  88.     }

  89.     /** Reset the active provider.
  90.      * <p>
  91.      * Calling this method clears all already seen switch history,
  92.      * so it should <em>not</em> be used during the propagation itself,
  93.      * it is intended to be used only at start
  94.      * </p>
  95.      * @param provider provider to activate
  96.      */
  97.     public void resetActiveProvider(final AttitudeProvider provider) {
  98.         activated = new TimeSpanMap<AttitudeProvider>(provider);
  99.     }

  100.     /** Register all wrapped switch events to the propagator.
  101.      * <p>
  102.      * This method must be called once before propagation, after the
  103.      * switching conditions have been set up by calls to {@link
  104.      * #addSwitchingCondition(AttitudeProvider, AttitudeProvider, EventDetector,
  105.      * boolean, boolean, double, AngularDerivativesFilter, SwitchHandler)
  106.      * addSwitchingCondition}.
  107.      * </p>
  108.      * @param propagator propagator that will handle the events
  109.      */
  110.     public void registerSwitchEvents(final Propagator propagator) {
  111.         for (final Switch<?> s : switches) {
  112.             propagator.addEventDetector(s);
  113.         }
  114.     }

  115.     /** Register all wrapped switch events to the propagator.
  116.      * <p>
  117.      * This method must be called once before propagation, after the
  118.      * switching conditions have been set up by calls to {@link
  119.      * #addSwitchingCondition(AttitudeProvider, AttitudeProvider, EventDetector,
  120.      * boolean, boolean, double, AngularDerivativesFilter, SwitchHandler)
  121.      * addSwitchingCondition}.
  122.      * </p>
  123.      * @param field field to which the elements belong
  124.      * @param propagator propagator that will handle the events
  125.      * @param <T> type of the field elements
  126.      */
  127.     public <T extends CalculusFieldElement<T>> void registerSwitchEvents(final Field<T> field, final FieldPropagator<T> propagator) {
  128.         for (final Switch<?> sw : switches) {
  129.             propagator.addEventDetector(new FieldEventDetector<T>() {

  130.                 /** {@inheritDoc} */
  131.                 @Override
  132.                 public void init(final FieldSpacecraftState<T> s0,
  133.                                  final FieldAbsoluteDate<T> t) {
  134.                     sw.init(s0.toSpacecraftState(), t.toAbsoluteDate());
  135.                 }

  136.                 /** {@inheritDoc} */
  137.                 @Override
  138.                 public T g(final FieldSpacecraftState<T> s) {
  139.                     return field.getZero().add(sw.g(s.toSpacecraftState()));
  140.                 }

  141.                 /** {@inheritDoc} */
  142.                 @Override
  143.                 public T getThreshold() {
  144.                     return field.getZero().add(sw.getThreshold());
  145.                 }

  146.                 /** {@inheritDoc} */
  147.                 @Override
  148.                 public T getMaxCheckInterval() {
  149.                     return field.getZero().add(sw.getMaxCheckInterval());
  150.                 }

  151.                 /** {@inheritDoc} */
  152.                 @Override
  153.                 public int getMaxIterationCount() {
  154.                     return sw.getMaxIterationCount();
  155.                 }

  156.                 /** {@inheritDoc} */
  157.                 @Override
  158.                 public Action eventOccurred(final FieldSpacecraftState<T> s, final boolean increasing) {
  159.                     return sw.eventOccurred(s.toSpacecraftState(), increasing);
  160.                 }

  161.                 /** {@inheritDoc} */
  162.                 @Override
  163.                 public FieldSpacecraftState<T> resetState(final FieldSpacecraftState<T> oldState) {
  164.                     return new FieldSpacecraftState<>(field, sw.resetState(oldState.toSpacecraftState()));
  165.                 }

  166.             });
  167.         }
  168.     }

  169.     /** Add a switching condition between two attitude providers.
  170.      * <p>
  171.      * The {@code past} and {@code future} attitude providers are defined with regard
  172.      * to the natural flow of time. This means that if the propagation is forward, the
  173.      * propagator will switch from {@code past} provider to {@code future} provider at
  174.      * event occurrence, but if the propagation is backward, the propagator will switch
  175.      * from {@code future} provider to {@code past} provider at event occurrence. The
  176.      * transition between the two attitude laws is not instantaneous, the switch event
  177.      * defines the start of the transition (i.e. when leaving the {@code past} attitude
  178.      * law and entering the interpolated transition law). The end of the transition
  179.      * (i.e. when leaving the interpolating transition law and entering the {@code future}
  180.      * attitude law) occurs at switch time plus {@code transitionTime}.
  181.      * </p>
  182.      * <p>
  183.      * An attitude provider may have several different switch events associated to
  184.      * it. Depending on which event is triggered, the appropriate provider is
  185.      * switched to.
  186.      * </p>
  187.      * <p>
  188.      * The switch events specified here must <em>not</em> be registered to the
  189.      * propagator directly. The proper way to register these events is to
  190.      * call {@link #registerSwitchEvents(Propagator)} once after all switching
  191.      * conditions have been set up. The reason for this is that the events will
  192.      * be wrapped before being registered.
  193.      * </p>
  194.      * <p>
  195.      * If the underlying detector has an event handler associated to it, this handler
  196.      * will be triggered (i.e. its {@link org.orekit.propagation.events.handlers.EventHandler#eventOccurred(SpacecraftState,
  197.      * EventDetector, boolean) eventOccurred} method will be called), <em>regardless</em>
  198.      * of the event really triggering an attitude switch or not. As an example, if an
  199.      * eclipse detector is used to switch from day to night attitude mode when entering
  200.      * eclipse, with {@code switchOnIncrease} set to {@code false} and {@code switchOnDecrease}
  201.      * set to {@code true}. Then a handler set directly at eclipse detector level would
  202.      * be triggered at both eclipse entry and eclipse exit, but attitude switch would
  203.      * occur <em>only</em> at eclipse entry. Note that for the sake of symmetry, the
  204.      * transition start and end dates should match for both forward and backward propagation.
  205.      * This implies that for backward propagation, we have to compensate for the {@code
  206.      * transitionTime} when looking for the event. An unfortunate consequence is that the
  207.      * {@link org.orekit.propagation.events.handlers.EventHandler#eventOccurred(SpacecraftState, EventDetector, boolean)
  208.      * eventOccurred} method may appear to be called out of sync with respect to the
  209.      * propagation (it will be called when propagator reaches transition end, despite it
  210.      * refers to transition start, as per {@code transitionTime} compensation), and if the
  211.      * method returns {@link Action#STOP}, it will stop at the end of the
  212.      * transition instead of at the start. For these reasons, it is not recommended to
  213.      * set up an event handler for events that are used to switch attitude. If an event
  214.      * handler is needed for other purposes, a second handler should be registered to
  215.      * the propagator rather than relying on the side effects of attitude switches.
  216.      * </p>
  217.      * <p>
  218.      * The smoothness of the transition between past and future attitude laws can be tuned
  219.      * using the {@code transitionTime} and {@code transitionFilter} parameters. The {@code
  220.      * transitionTime} parameter specifies how much time is spent to switch from one law to
  221.      * the other law. It should be larger than the event {@link EventDetector#getThreshold()
  222.      * convergence threshold} in order to ensure attitude continuity. The {@code
  223.      * transitionFilter} parameter specifies the attitude time derivatives that should match
  224.      * at the boundaries between past attitude law and transition law on one side, and
  225.      * between transition law and future law on the other side.
  226.      * {@link AngularDerivativesFilter#USE_R} means only the rotation should be identical,
  227.      * {@link AngularDerivativesFilter#USE_RR} means both rotation and rotation rate
  228.      * should be identical, {@link AngularDerivativesFilter#USE_RRA} means both rotation,
  229.      * rotation rate and rotation acceleration should be identical. During the transition,
  230.      * the attitude law is computed by interpolating between past attitude law at switch time
  231.      * and future attitude law at current intermediate time.
  232.      * </p>
  233.      * @param past attitude provider applicable for times in the switch event occurrence past
  234.      * @param future attitude provider applicable for times in the switch event occurrence future
  235.      * @param switchEvent event triggering the attitude providers switch
  236.      * @param switchOnIncrease if true, switch is triggered on increasing event
  237.      * @param switchOnDecrease if true, switch is triggered on decreasing event
  238.      * @param transitionTime duration of the transition between the past and future attitude laws
  239.      * @param transitionFilter specification of transition law time derivatives that
  240.      * should match past and future attitude laws
  241.      * @param handler handler to call for notifying when switch occurs (may be null)
  242.      * @param <T> class type for the switch event
  243.      * @since 7.1
  244.      */
  245.     public <T extends EventDetector> void addSwitchingCondition(final AttitudeProvider past,
  246.                                                                 final AttitudeProvider future,
  247.                                                                 final T switchEvent,
  248.                                                                 final boolean switchOnIncrease,
  249.                                                                 final boolean switchOnDecrease,
  250.                                                                 final double transitionTime,
  251.                                                                 final AngularDerivativesFilter transitionFilter,
  252.                                                                 final SwitchHandler handler) {

  253.         // safety check, for ensuring attitude continuity
  254.         if (transitionTime < switchEvent.getThreshold()) {
  255.             throw new OrekitException(OrekitMessages.TOO_SHORT_TRANSITION_TIME_FOR_ATTITUDES_SWITCH,
  256.                                       transitionTime, switchEvent.getThreshold());
  257.         }

  258.         // if it is the first switching condition, assume first active law is the past one
  259.         if (activated == null) {
  260.             resetActiveProvider(past);
  261.         }

  262.         // add the switching condition
  263.         switches.add(new Switch<T>(switchEvent, switchOnIncrease, switchOnDecrease,
  264.                                    past, future, transitionTime, transitionFilter, handler));

  265.     }

  266.     /** {@inheritDoc} */
  267.     public Attitude getAttitude(final PVCoordinatesProvider pvProv,
  268.                                 final AbsoluteDate date, final Frame frame) {
  269.         return activated.get(date).getAttitude(pvProv, date, frame);
  270.     }

  271.     /** {@inheritDoc} */
  272.     public <T extends CalculusFieldElement<T>> FieldAttitude<T> getAttitude(final FieldPVCoordinatesProvider<T> pvProv,
  273.                                                                         final FieldAbsoluteDate<T> date,
  274.                                                                         final Frame frame) {
  275.         return activated.get(date.toAbsoluteDate()).getAttitude(pvProv, date, frame);
  276.     }

  277.     /** Switch specification.
  278.      * @param <T> class type for the generic version
  279.      */
  280.     private class Switch<T extends EventDetector> implements EventDetector {

  281.         /** Event. */
  282.         private final T event;

  283.         /** Event direction triggering the switch. */
  284.         private final boolean switchOnIncrease;

  285.         /** Event direction triggering the switch. */
  286.         private final boolean switchOnDecrease;

  287.         /** Attitude provider applicable for times in the switch event occurrence past. */
  288.         private final AttitudeProvider past;

  289.         /** Attitude provider applicable for times in the switch event occurrence future. */
  290.         private final AttitudeProvider future;

  291.         /** Duration of the transition between the past and future attitude laws. */
  292.         private final double transitionTime;

  293.         /** Order at which the transition law time derivatives should match past and future attitude laws. */
  294.         private final AngularDerivativesFilter transitionFilter;

  295.         /** Handler to call for notifying when switch occurs (may be null). */
  296.         private final SwitchHandler switchHandler;

  297.         /** Propagation direction. */
  298.         private boolean forward;

  299.         /** Simple constructor.
  300.          * @param event event
  301.          * @param switchOnIncrease if true, switch is triggered on increasing event
  302.          * @param switchOnDecrease if true, switch is triggered on decreasing event
  303.          * otherwise switch is triggered on decreasing event
  304.          * @param past attitude provider applicable for times in the switch event occurrence past
  305.          * @param future attitude provider applicable for times in the switch event occurrence future
  306.          * @param transitionTime duration of the transition between the past and future attitude laws
  307.          * @param transitionFilter order at which the transition law time derivatives
  308.          * should match past and future attitude laws
  309.          * @param switchHandler handler to call for notifying when switch occurs (may be null)
  310.          */
  311.         Switch(final T event,
  312.                final boolean switchOnIncrease, final boolean switchOnDecrease,
  313.                final AttitudeProvider past, final AttitudeProvider future,
  314.                final double transitionTime, final AngularDerivativesFilter transitionFilter,
  315.                final SwitchHandler switchHandler) {
  316.             this.event            = event;
  317.             this.switchOnIncrease = switchOnIncrease;
  318.             this.switchOnDecrease = switchOnDecrease;
  319.             this.past             = past;
  320.             this.future           = future;
  321.             this.transitionTime   = transitionTime;
  322.             this.transitionFilter = transitionFilter;
  323.             this.switchHandler    = switchHandler;
  324.         }

  325.         /** {@inheritDoc} */
  326.         @Override
  327.         public double getThreshold() {
  328.             return event.getThreshold();
  329.         }

  330.         /** {@inheritDoc} */
  331.         @Override
  332.         public double getMaxCheckInterval() {
  333.             return event.getMaxCheckInterval();
  334.         }

  335.         /** {@inheritDoc} */
  336.         @Override
  337.         public int getMaxIterationCount() {
  338.             return event.getMaxIterationCount();
  339.         }

  340.         /** {@inheritDoc} */
  341.         public void init(final SpacecraftState s0,
  342.                          final AbsoluteDate t) {

  343.             // reset the transition parameters (this will be done once for each switch,
  344.             //  despite doing it only once would have sufficient; its not really a problem)
  345.             forward = t.durationFrom(s0.getDate()) >= 0.0;
  346.             if (activated.getSpansNumber() > 1) {
  347.                 // remove transitions that will be overridden during upcoming propagation
  348.                 if (forward) {
  349.                     activated = activated.extractRange(AbsoluteDate.PAST_INFINITY, s0.getDate().shiftedBy(transitionTime));
  350.                 } else {
  351.                     activated = activated.extractRange(s0.getDate().shiftedBy(-transitionTime), AbsoluteDate.FUTURE_INFINITY);
  352.                 }
  353.             }

  354.             // initialize the underlying event
  355.             event.init(s0, t);

  356.         }

  357.         /** {@inheritDoc} */
  358.         public double g(final SpacecraftState s) {
  359.             return event.g(forward ? s : s.shiftedBy(-transitionTime));
  360.         }

  361.         /** {@inheritDoc} */
  362.         public Action eventOccurred(final SpacecraftState s, final boolean increasing) {

  363.             final AbsoluteDate date = s.getDate();
  364.             if (activated.get(date) == (forward ? past : future) &&
  365.                 (increasing && switchOnIncrease || !increasing && switchOnDecrease)) {

  366.                 if (forward) {

  367.                     // prepare transition
  368.                     final AbsoluteDate transitionEnd = date.shiftedBy(transitionTime);
  369.                     activated.addValidAfter(new TransitionProvider(s.getAttitude(), transitionEnd), date, false);

  370.                     // prepare future law after transition
  371.                     activated.addValidAfter(future, transitionEnd, false);

  372.                     // notify about the switch
  373.                     if (switchHandler != null) {
  374.                         switchHandler.switchOccurred(past, future, s);
  375.                     }

  376.                     return event.eventOccurred(s, increasing);

  377.                 } else {

  378.                     // estimate state at transition start, according to the past attitude law
  379.                     final Orbit     sOrbit    = s.getOrbit().shiftedBy(-transitionTime);
  380.                     final Attitude  sAttitude = past.getAttitude(sOrbit, sOrbit.getDate(), sOrbit.getFrame());
  381.                     SpacecraftState sState    = new SpacecraftState(sOrbit, sAttitude, s.getMass());
  382.                     for (final DoubleArrayDictionary.Entry entry : s.getAdditionalStatesValues().getData()) {
  383.                         sState = sState.addAdditionalState(entry.getKey(), entry.getValue());
  384.                     }

  385.                     // prepare transition
  386.                     activated.addValidBefore(new TransitionProvider(sAttitude, date), date, false);

  387.                     // prepare past law before transition
  388.                     activated.addValidBefore(past, sOrbit.getDate(), false);

  389.                     // notify about the switch
  390.                     if (switchHandler != null) {
  391.                         switchHandler.switchOccurred(future, past, sState);
  392.                     }

  393.                     return event.eventOccurred(sState, increasing);

  394.                 }

  395.             } else {
  396.                 // trigger the underlying event despite no attitude switch occurred
  397.                 return event.eventOccurred(s, increasing);
  398.             }

  399.         }

  400.         /** {@inheritDoc} */
  401.         @Override
  402.         public SpacecraftState resetState(final SpacecraftState oldState) {
  403.             // delegate to underlying event
  404.             return event.resetState(oldState);
  405.         }

  406.         /** Provider for transition phases.
  407.          * @since 9.2
  408.          */
  409.         private class TransitionProvider implements AttitudeProvider {

  410.             /** Attitude at preceding transition. */
  411.             private final Attitude transitionPreceding;

  412.             /** Date of final switch to following attitude law. */
  413.             private final AbsoluteDate transitionEnd;

  414.             /** Simple constructor.
  415.              * @param transitionPreceding attitude at preceding transition
  416.              * @param transitionEnd date of final switch to following attitude law
  417.              */
  418.             TransitionProvider(final Attitude transitionPreceding, final AbsoluteDate transitionEnd) {
  419.                 this.transitionPreceding = transitionPreceding;
  420.                 this.transitionEnd       = transitionEnd;
  421.             }

  422.             /** {@inheritDoc} */
  423.             public Attitude getAttitude(final PVCoordinatesProvider pvProv,
  424.                                         final AbsoluteDate date, final Frame frame) {

  425.                 // interpolate between the two boundary attitudes
  426.                 final TimeStampedAngularCoordinates start =
  427.                                 transitionPreceding.withReferenceFrame(frame).getOrientation();
  428.                 final TimeStampedAngularCoordinates end =
  429.                                 future.getAttitude(pvProv, transitionEnd, frame).getOrientation();
  430.                 final TimeStampedAngularCoordinates interpolated =
  431.                                 TimeStampedAngularCoordinates.interpolate(date, transitionFilter,
  432.                                                                           Arrays.asList(start, end));

  433.                 return new Attitude(frame, interpolated);

  434.             }

  435.             /** {@inheritDoc} */
  436.             public <S extends CalculusFieldElement<S>> FieldAttitude<S> getAttitude(final FieldPVCoordinatesProvider<S> pvProv,
  437.                                                                                 final FieldAbsoluteDate<S> date,
  438.                                                                                 final Frame frame) {

  439.                 // interpolate between the two boundary attitudes
  440.                 final TimeStampedFieldAngularCoordinates<S> start =
  441.                                 new TimeStampedFieldAngularCoordinates<>(date.getField(),
  442.                                                                          transitionPreceding.withReferenceFrame(frame).getOrientation());
  443.                 final TimeStampedFieldAngularCoordinates<S> end =
  444.                                 future.getAttitude(pvProv,
  445.                                                    new FieldAbsoluteDate<>(date.getField(), transitionEnd),
  446.                                                    frame).getOrientation();
  447.                 final TimeStampedFieldAngularCoordinates<S> interpolated =
  448.                                 TimeStampedFieldAngularCoordinates.interpolate(date, transitionFilter,
  449.                                                                                Arrays.asList(start, end));

  450.                 return new FieldAttitude<>(frame, interpolated);
  451.             }

  452.         }

  453.     }

  454.     /** Interface for attitude switch notifications.
  455.      * <p>
  456.      * This interface is intended to be implemented by users who want to be
  457.      * notified when an attitude switch occurs.
  458.      * </p>
  459.      * @since 7.1
  460.      */
  461.     public interface SwitchHandler {

  462.         /** Method called when attitude is switched from one law to another law.
  463.          * @param preceding attitude law used preceding the switch (i.e. in the past
  464.          * of the switch event for a forward propagation, or in the future
  465.          * of the switch event for a backward propagation)
  466.          * @param following attitude law used following the switch (i.e. in the future
  467.          * of the switch event for a forward propagation, or in the past
  468.          * of the switch event for a backward propagation)
  469.          * @param state state at switch time (with attitude computed using the {@code preceding} law)
  470.          */
  471.         void switchOccurred(AttitudeProvider preceding, AttitudeProvider following, SpacecraftState state);

  472.     }

  473. }