Class AbstractVariationParameter
- java.lang.Object
-
- cern.accsoft.steering.aloha.calc.variation.AbstractVariationParameter
-
- All Implemented Interfaces:
VariationParameter
- Direct Known Subclasses:
KnobVariationParameter
public abstract class AbstractVariationParameter extends java.lang.Object implements VariationParameter
-
-
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_DELTAthe value which is used as default variation for a parameterdoublelastOffset
-
Constructor Summary
Constructors Constructor Description AbstractVariationParameter(java.lang.String key, double initialOffset)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddDelta()adds the delta-value to the parameter.voidaddValueScaled(double value)adds the given value to the parameter.protected abstract voidapply()to be overridden by subclass: must transport the actual value to the desired targetsdoublegetActualOffset()doublegetDelta()get the delta, which is used by a Calculator to vary the parameter in order to calculate the differential quotient.doublegetError()doublegetInitialOffset()java.lang.StringgetKey()returns the key, for storage in an HashMapjava.lang.StringgetName()doublegetSensitivity()doublegetUpdateFactor()protected voidinit()voidreset()resets the actual value to the initial one.voidsetActualOffset(double actualOffset)set the actual offset to the initial valuevoidsetDelta(double delta)sets the deltavoidsetError(double error)set the error for the parameter from the last calculationvoidsetInitialOffset(double initialValue)sets the initial valuevoidsetSensitivity(double sensitivity)The sensitivity of the parameter during the last fit-iteration.voidsetUpdateFactor(double factor)sets the factor which is applied when updating the data for this parameter.voidundo()reverts the actual value to the last one.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cern.accsoft.steering.aloha.calc.variation.VariationParameter
getActiveMeasurementAbsoluteValue, getActiveMeasurementInitialValue, getActiveMeasurementRelativeChange, getOffsetChange
-
-
-
-
Field Detail
-
DEFAULT_DELTA
public static final double DEFAULT_DELTA
the value which is used as default variation for a parameter- See Also:
- Constant Field Values
-
lastOffset
public double lastOffset
-
-
Method Detail
-
init
protected final void init()
-
apply
protected abstract void apply()
to be overridden by subclass: must transport the actual value to the desired targets
-
getKey
public final java.lang.String getKey()
Description copied from interface:VariationParameterreturns the key, for storage in an HashMap- Specified by:
getKeyin interfaceVariationParameter- Returns:
- the key for this parameter
-
getName
public final java.lang.String getName()
- Specified by:
getNamein interfaceVariationParameter- Returns:
- the name
-
getInitialOffset
public final double getInitialOffset()
- Specified by:
getInitialOffsetin interfaceVariationParameter- Returns:
- the initial value for this parameter
-
setInitialOffset
public final void setInitialOffset(double initialValue)
Description copied from interface:VariationParametersets the initial value- Specified by:
setInitialOffsetin interfaceVariationParameter- Parameters:
initialValue- the value to set
-
getDelta
public final double getDelta()
Description copied from interface:VariationParameterget the delta, which is used by a Calculator to vary the parameter in order to calculate the differential quotient.- Specified by:
getDeltain interfaceVariationParameter- Returns:
- the delta
-
setDelta
public final void setDelta(double delta)
Description copied from interface:VariationParametersets the delta- Specified by:
setDeltain interfaceVariationParameter- Parameters:
delta- the new delta- See Also:
VariationParameter.getDelta()
-
getSensitivity
public final double getSensitivity()
- Specified by:
getSensitivityin interfaceVariationParameter- Returns:
- the sensitivity of the parameter
-
setSensitivity
public final void setSensitivity(double sensitivity)
Description copied from interface:VariationParameterThe sensitivity of the parameter during the last fit-iteration.- Specified by:
setSensitivityin interfaceVariationParameter- Parameters:
sensitivity- the sensitivity to set
-
reset
public final void reset()
Description copied from interface:VariationParameterresets the actual value to the initial one.- Specified by:
resetin interfaceVariationParameter
-
undo
public final void undo()
Description copied from interface:VariationParameterreverts the actual value to the last one. this only works once!- Specified by:
undoin interfaceVariationParameter
-
getActualOffset
public final double getActualOffset()
- Specified by:
getActualOffsetin interfaceVariationParameter- Returns:
- the actual value
-
setActualOffset
public final void setActualOffset(double actualOffset)
Description copied from interface:VariationParameterset the actual offset to the initial value- Specified by:
setActualOffsetin interfaceVariationParameter- Parameters:
actualOffset- the value to set
-
setUpdateFactor
public final void setUpdateFactor(double factor)
Description copied from interface:VariationParametersets the factor which is applied when updating the data for this parameter. A lower factor means slower convergence. a factor 1 means applying the whole calculated value.- Specified by:
setUpdateFactorin interfaceVariationParameter
-
getUpdateFactor
public final double getUpdateFactor()
- Specified by:
getUpdateFactorin interfaceVariationParameter- Returns:
- the update factor
-
addValueScaled
public final void addValueScaled(double value)
adds the given value to the parameter. (may be scaled internally)- Specified by:
addValueScaledin interfaceVariationParameter- Parameters:
value- value that shall be added
-
addDelta
public void addDelta()
Description copied from interface:VariationParameteradds the delta-value to the parameter. This is used, when calculating the gradient. It has to be used together with undo().- Specified by:
addDeltain interfaceVariationParameter
-
getError
public double getError()
- Specified by:
getErrorin interfaceVariationParameter- Returns:
- the error resulting from the last fit iteration
-
setError
public void setError(double error)
Description copied from interface:VariationParameterset the error for the parameter from the last calculation- Specified by:
setErrorin interfaceVariationParameter- Parameters:
error- the error from the last calculation
-
-