Class ParameterDriver

java.lang.Object
org.orekit.utils.drivers.ParameterDriver
Direct Known Subclasses:
AmbiguityDriver, DateDriver, ParameterDriversList.DelegatingDriver

public class ParameterDriver extends Object
Class allowing to drive the value of a parameter.

This class is typically used as a bridge between an estimation algorithm (typically orbit determination or optimizer) and an internal parameter in a physical model that needs to be tuned. The physical model will expose to the algorithm a set of instances of this class so the algorithm can call the setValue(double) method to update the parameter value.

Any object can be notified when any of value, name, selection status… are changed. This is done by addObserver(ParameterObserver) registering} a ParameterObserver to the parameter driver.

This design has two major goals. First, it allows an external algorithm to drive internal parameters blindly, as it only needs to get a list of instances of this class, without knowing what they really drive. Second, it allows the physical model to not expose directly setters methods for its parameters. In order to be able to modify the parameter value, the algorithm must retrieve a parameter driver.

As of versions 12.X and 13.X, it was possible to set up time-dependent values within a single ParameterDriver. This feature has been replaced by ParameterDriversSequence as of 14.0, which is simpler and also allows finer selection, making it possible to select only a subset of the parameters along a timeline. Starting with version 14.0, ParameterDriver instances only hold one value, which can have a restricted validity range.

Since:
8.0
Author:
Luc Maisonobe, Melina Vanel
See Also:
  • Constructor Details

    • ParameterDriver

      public ParameterDriver(String name, double referenceValue, double scale, double minValue, double maxValue, TimeInterval validity)
      Simple constructor.

      At construction, the parameter is configured as not selected, the reference date is set to null, the value is set to the referenceValue.

      Parameters:
      name - name of the parameter
      referenceValue - reference value of the parameter
      scale - scaling factor to convert the parameters value to non-dimensional (typically set to the expected standard deviation of the parameter), it must be non-zero
      minValue - minimum value allowed
      maxValue - maximum value allowed
      validity - validity interval
  • Method Details

    • addObserver

      public void addObserver(ParameterObserver observer)
      Add an observer for this driver.

      The observer valueChanged method is called once automatically when the observer is added, and then called at each value change.

      Parameters:
      observer - observer to add
    • removeObserver

      public void removeObserver(ParameterObserver observer)
      Remove an observer.
      Parameters:
      observer - observer to remove
      Since:
      9.1
    • replaceObserver

      public void replaceObserver(ParameterObserver oldObserver, ParameterObserver newObserver)
      Replace an observer.
      Parameters:
      oldObserver - observer to replace
      newObserver - new observer to use
      Since:
      10.1
    • getObservers

      public List<ParameterObserver> getObservers()
      Get the observers for this driver.
      Returns:
      an unmodifiable view of the observers for this driver
      Since:
      9.1
    • getName

      public String getName()
      Get parameter driver general name.
      Returns:
      name
    • setName

      public void setName(String name)
      Change the general name of this parameter driver.
      Parameters:
      name - new name
    • getReferenceValue

      public double getReferenceValue()
      Get reference parameter value.
      Returns:
      reference parameter value
    • setReferenceValue

      public void setReferenceValue(double referenceValue)
      Set reference parameter value.
      Parameters:
      referenceValue - the reference value to set.
      Since:
      9.3
    • getMinValue

      public double getMinValue()
      Get minimum parameter value.
      Returns:
      minimum parameter value
    • setMinValue

      public void setMinValue(double minValue)
      Set minimum parameter value.
      Parameters:
      minValue - the minimum value to set.
      Since:
      9.3
    • getMaxValue

      public double getMaxValue()
      Get maximum parameter value.
      Returns:
      maximum parameter value
    • setMaxValue

      public void setMaxValue(double maxValue)
      Set maximum parameter value.
      Parameters:
      maxValue - the maximum value to set.
      Since:
      9.3
    • getScale

      public double getScale()
      Get scale.
      Returns:
      scale
    • setScale

      public void setScale(double scale)
      Set scale.
      Parameters:
      scale - the scale to set.
      Since:
      9.3
    • getNormalizedValue

      public double getNormalizedValue()
      Get normalized value.

      The normalized value is a non-dimensional value suitable for use as part of a vector in an optimization process. It is computed as (current - reference)/scale.

      Returns:
      normalized value
    • setNormalizedValue

      public void setNormalizedValue(double normalized)
      Set normalized value.

      The normalized value is a non-dimensional value suitable for use as part of a vector in an optimization process. It is computed as (current - reference)/scale.

      Parameters:
      normalized - value
    • getReferenceDate

      public AbsoluteDate getReferenceDate()
      Get current reference date.
      Returns:
      current reference date (null if it was never set)
      Since:
      9.0
    • setReferenceDate

      public void setReferenceDate(AbsoluteDate newReferenceDate)
      Set reference date.
      Parameters:
      newReferenceDate - new reference date
      Since:
      9.0
    • getValue

      public double getValue()
      Get current parameter value.
      Returns:
      current parameter value
    • getValue

      public Gradient getValue(int freeParameters, Map<String,Integer> indices)
      Get the value as a gradient.
      Parameters:
      freeParameters - total number of free parameters in the gradient
      indices - indices of the differentiation parameters in derivatives computations
      Returns:
      value with derivatives
      Since:
      10.2
    • setValue

      public void setValue(double newValue)
      Set parameter value.

      If newValue is below getMinValue(), it will be silently set to getMinValue(). If newValue is above getMaxValue(), it will be silently set to getMaxValue().

      Parameters:
      newValue - new value to set
    • getValidity

      public TimeInterval getValidity()
      Get the validity interval.
      Returns:
      validity interval
      Since:
      14.0
    • setValidity

      public void setValidity(TimeInterval validity)
      Set the validity interval.
      Parameters:
      validity - validity interval
      Since:
      14.0
    • setSelected

      public void setSelected(boolean selected)
      Configure a parameter selection status.

      Selection is used for estimated parameters in orbit determination, or to compute the Jacobian matrix in partial derivatives computation.

      Parameters:
      selected - if true the parameter is selected, otherwise it will be fixed
    • isSelected

      public boolean isSelected()
      Check if parameter is selected.

      Selection is used for estimated parameters in orbit determination, or to compute the Jacobian matrix in partial derivatives computation.

      Returns:
      true if parameter is selected, false if it is not
    • toString

      public String toString()
      Get a text representation of the parameter.
      Overrides:
      toString in class Object
      Returns:
      text representation of the parameter, in the form name = value.