AbstractIntegratedPropagatorBuilder.java

  1. /* Copyright 2022-2025 Romain Serra
  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.conversion;

  18. import org.orekit.attitudes.AttitudeProvider;
  19. import org.orekit.orbits.Orbit;
  20. import org.orekit.orbits.PositionAngleType;
  21. import org.orekit.propagation.PropagationType;
  22. import org.orekit.propagation.integration.AbstractIntegratedPropagator;

  23. /**
  24.  * Abstract class for builders for integrator-based propagators.
  25.  * @param <T> field type
  26.  * @since 13.0
  27.  * @author Romain Serra
  28.  */
  29. public abstract class AbstractIntegratedPropagatorBuilder<T extends AbstractIntegratedPropagator>
  30.         extends AbstractPropagatorBuilder<T> {

  31.     /** First order integrator builder for propagation. */
  32.     private final ODEIntegratorBuilder builder;

  33.     /** Type of the orbit used for the propagation.*/
  34.     private final PropagationType propagationType;

  35.     /** Build a new instance.
  36.      * @param templateOrbit reference orbit from which real orbits will be built
  37.      * @param builder integrator builder
  38.      * @param positionAngleType position angle type
  39.      * @param positionScale scaling factor used for orbital parameters normalization
  40.      * (typically set to the expected standard deviation of the position)
  41.      * @param propagationType type of the orbit used for the propagation (mean or osculating)
  42.      * @param attitudeProvider attitude law.
  43.      * @param mass initial mass
  44.      */
  45.     protected AbstractIntegratedPropagatorBuilder(final Orbit templateOrbit, final ODEIntegratorBuilder builder,
  46.                                                   final PositionAngleType positionAngleType, final double positionScale,
  47.                                                   final PropagationType propagationType,
  48.                                                   final AttitudeProvider attitudeProvider, final double mass) {
  49.         super(templateOrbit, positionAngleType, positionScale, true, attitudeProvider, mass);
  50.         this.builder = builder;
  51.         this.propagationType = propagationType;
  52.     }

  53.     /**
  54.      * Getter for integrator builder.
  55.      * @return builder
  56.      */
  57.     public ODEIntegratorBuilder getIntegratorBuilder() {
  58.         return builder;
  59.     }

  60.     /**
  61.      * Getter for the propagation type.
  62.      * @return propagation type
  63.      */
  64.     public PropagationType getPropagationType() {
  65.         return propagationType;
  66.     }

  67.     /** {@inheritDoc} */
  68.     @Override
  69.     public abstract T buildPropagator(double[] normalizedParameters);

  70.     /** {@inheritDoc} */
  71.     @Override
  72.     public T buildPropagator() {
  73.         return buildPropagator(getSelectedNormalizedParameters());
  74.     }

  75. }