Пример #1
0
  /**
   * Update state by adding all additional states.
   *
   * @param original original state
   * @return updated state, with all additional states included
   * @exception PropagationException if one of the providers throws one
   * @see #addAdditionalStateProvider(AdditionalStateProvider)
   */
  protected SpacecraftState updateAdditionalStates(final SpacecraftState original)
      throws PropagationException {

    // start with original state,
    // which may already contain additional states, for example in interpolated ephemerides
    SpacecraftState updated = original;

    if (initialState != null) {
      // there is an initial state
      // (null initial states occur for example in interpolated ephemerides)
      // copy the additional states present in initialState but otherwise not managed
      for (final Map.Entry<String, double[]> initial :
          initialState.getAdditionalStates().entrySet()) {
        if (!isAdditionalStateManaged(initial.getKey())) {
          // this additional state was in the initial state, but is unknown to the propagator
          // we simply copy its initial value as is
          updated = updated.addAdditionalState(initial.getKey(), initial.getValue());
        }
      }
    }

    // update the additional states managed by providers
    for (final AdditionalStateProvider provider : additionalStateProviders) {
      updated =
          updated.addAdditionalState(provider.getName(), provider.getAdditionalState(updated));
    }

    return updated;
  }
Пример #2
0
 /** {@inheritDoc} */
 public void resetInitialState(final SpacecraftState state) throws PropagationException {
   initialState = state;
   setStartDate(state.getDate());
 }
Пример #3
0
 /** {@inheritDoc} */
 public Frame getFrame() {
   return initialState.getFrame();
 }