public class ParameterDriver extends Object
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,
or a bridge between a finite differences algorithm and an
internal parameter in a physical model that needs to be slightly
offset. 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. Each time the value is set, the physical model
will be notified as it will register a ParameterObserver
for this purpose.
This design has two major goals. First, it allows an external algorithm to drive internal parameters almost anonymously, 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.
ParameterObserver
Constructor and Description |
---|
ParameterDriver(String name,
double referenceValue,
double scale,
double minValue,
double maxValue)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addObserver(ParameterObserver observer)
Add an observer for this driver.
|
double |
getMaxValue()
Get maximum parameter value.
|
double |
getMinValue()
Get minimum parameter value.
|
String |
getName()
Get name.
|
double |
getNormalizedValue()
Get normalized value.
|
AbsoluteDate |
getReferenceDate()
Get current reference date.
|
double |
getReferenceValue()
Get reference parameter value.
|
double |
getScale()
Get scale.
|
double |
getValue()
Get current parameter value.
|
boolean |
isSelected()
Check if parameter is selected.
|
void |
setName(String name)
Change the name of this parameter driver.
|
void |
setNormalizedValue(double normalized)
Set normalized value.
|
void |
setReferenceDate(AbsoluteDate newReferenceDate)
Set reference date.
|
void |
setSelected(boolean selected)
Configure a parameter selection status.
|
void |
setValue(double newValue)
Set parameter value.
|
String |
toString()
Get a text representation of the parameter.
|
public ParameterDriver(String name, double referenceValue, double scale, double minValue, double maxValue) throws OrekitException
At construction, the parameter is configured as not selected,
the reference date is set to null
and the value is set to the
referenceValue
.
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 valuemaxValue
- maximum valueOrekitException
- if scale is too close to zeropublic void addObserver(ParameterObserver observer) throws OrekitException
The observer valueChanged
method is called once automatically when the
observer is added, and then called at each value change.
observer
- observer to addOrekitException
- if the observer triggers one
while being updatedpublic void setName(String name)
name
- new namepublic String getName()
public double getReferenceValue()
public double getMinValue()
public double getMaxValue()
public double getScale()
public double getNormalizedValue()
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
.
public void setNormalizedValue(double normalized) throws OrekitException
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
.
normalized
- valueOrekitException
- if an observer throws onepublic AbsoluteDate getReferenceDate()
public void setReferenceDate(AbsoluteDate newReferenceDate)
newReferenceDate
- new reference datepublic double getValue()
public void setValue(double newValue) throws OrekitException
If newValue
is below getMinValue()
, it will
be silently to getMinValue()
. If newValue
is
above getMaxValue()
, it will be silently to getMaxValue()
.
newValue
- new valueOrekitException
- if an observer throws onepublic void setSelected(boolean selected)
Selection is used for estimated parameters in orbit determination, or to compute the Jacobian matrix in partial derivatives computation.
selected
- if true the parameter is selected,
otherwise it will be fixedpublic boolean isSelected()
Selection is used for estimated parameters in orbit determination, or to compute the Jacobian matrix in partial derivatives computation.
Copyright © 2002-2017 CS Systèmes d'information. All rights reserved.