1   /* Copyright 2022-2025 Luc Maisonobe
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.propagation.sampling;
18  
19  import java.util.List;
20  
21  import org.orekit.propagation.SpacecraftState;
22  import org.orekit.time.AbsoluteDate;
23  
24  /** This interface is a space-dynamics aware fixed step handler for {@link
25   * org.orekit.propagation.PropagatorsParallelizer multi-sat propagation}.
26   *
27   * <p>It is a multi-satellite version of the {@link OrekitFixedStepHandler}.</p>
28   * @author Luc Maisonobe
29   * @since 12.0
30   */
31  public interface MultiSatFixedStepHandler {
32  
33      /** Initialize step handler at the start of a propagation.
34       * <p>
35       * This method is called once at the start of the propagation. It
36       * may be used by the step handler to initialize some internal data
37       * if needed.
38       * </p>
39       * <p>
40       * The default method does nothing
41       * </p>
42       * @param states0 initial states, one for each satellite in the same order
43       * used to {@link org.orekit.propagation.PropagatorsParallelizer#PropagatorsParallelizer(List,
44       * double, MultiSatFixedStepHandler) build} the {@link org.orekit.propagation.PropagatorsParallelizer
45       * multi-sat propagator}.
46       * @param t target time for the integration
47       * @param step the duration in seconds of the fixed step. This value is
48       *             positive even if propagation is backwards.
49       */
50      default void init(final List<SpacecraftState> states0, final AbsoluteDate t, final double step) {
51          // nothing by default
52      }
53  
54      /** Handle the current step.
55       * <p>
56       * When called by {@link org.orekit.propagation.PropagatorsParallelizer PropagatorsParallelizer},
57       * all states have the same date.
58       * </p>
59       * @param states states in the same order
60       * used to {@link org.orekit.propagation.PropagatorsParallelizer#PropagatorsParallelizer(List,
61       * double, MultiSatFixedStepHandler) build} the {@link org.orekit.propagation.PropagatorsParallelizer
62       * multi-sat propagator}
63       */
64      void handleStep(List<SpacecraftState> states);
65  
66      /**
67       * Finalize propagation.
68       * @param finalStates states at propagation end
69       */
70      default void finish(final List<SpacecraftState> finalStates) {
71          // nothing by default
72      }
73  
74  }