Class ParameterDriver
- Direct Known Subclasses:
AmbiguityDriver,DateDriver,ParameterDriversList.DelegatingDriver
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 registering a parameter observer 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 Summary
ConstructorsConstructorDescriptionParameterDriver(String name, double referenceValue, double scale, double minValue, double maxValue, TimeInterval validity) Simple constructor. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet normalized value.Get current reference date.doubleGet reference parameter value.doublegetValue()Get current parameter value.Get the value as a gradient.voidsetMaxValue(double maxValue) Set maximum parameter value.voidsetMinValue(double minValue) Set minimum parameter value.voidsetNormalizedValue(double normalized) Set normalized value.voidsetReferenceDate(AbsoluteDate newReferenceDate) Set reference date.voidsetReferenceValue(double referenceValue) Set reference parameter value.voidsetValue(double newValue) Set parameter value.toString()Get a text representation of the parameter.Methods inherited from class org.orekit.utils.drivers.BaseParameterDriver
addObserver, getMaxValue, getMinValue, getName, getObservers, getScale, getValidity, isSelected, removeObserver, replaceObserver, setName, setScale, setSelected, setValidity
-
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 thereferenceValue.- Parameters:
name- name of the parameterreferenceValue- reference value of the parameterscale- scaling factor to convert the parameters value to non-dimensional (typically set to the expected standard deviation of the parameter), it must be non-zerominValue- minimum value allowedmaxValue- maximum value allowedvalidity- validity interval
-
-
Method Details
-
getReferenceDate
Get current reference date.- Returns:
- current reference date (null if it was never set)
- Since:
- 9.0
-
setReferenceDate
Set reference date.- Parameters:
newReferenceDate- new reference date- Since:
- 9.0
-
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
-
getValue
public double getValue()Get current parameter value.- Returns:
- current parameter value
-
getValue
Get the value as a gradient.- Parameters:
freeParameters- total number of free parameters in the gradientindices- 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
newValueis belowBaseParameterDriver.getMinValue(), it will be silently set toBaseParameterDriver.getMinValue(). IfnewValueis aboveBaseParameterDriver.getMaxValue(), it will be silently set toBaseParameterDriver.getMaxValue().- Parameters:
newValue- new value to set
-
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
-
setMinValue
public void setMinValue(double minValue) Set minimum parameter value.- Overrides:
setMinValuein classBaseParameterDriver<ParameterDriver,ParameterObserver> - Parameters:
minValue- the minimum value to set.- Since:
- 9.3
-
setMaxValue
public void setMaxValue(double maxValue) Set maximum parameter value.- Overrides:
setMaxValuein classBaseParameterDriver<ParameterDriver,ParameterObserver> - Parameters:
maxValue- the maximum value to set.- Since:
- 9.3
-
toString
Get a text representation of the parameter.
-