Class MSASmoothing
- java.lang.Object
-
- org.goplanit.component.PlanitComponent<Smoothing>
-
- org.goplanit.sdinteraction.smoothing.Smoothing
-
- org.goplanit.sdinteraction.smoothing.MSASmoothing
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,EventListener
,PlanitComponentListener
,EventListener
,ExternalIdAble
,IdAble
public class MSASmoothing extends Smoothing
MSA smoothing object- Author:
- markr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_INITIAL_STEP_SIZE
The default initial step size to useprotected double
stepSize
Step size
-
Constructor Summary
Constructors Constructor Description MSASmoothing(MSASmoothing other, boolean deepCopy)
Copy constructorMSASmoothing(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
collectSettingsAsKeyValueMap()
Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entityMSASmoothing
deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possibledouble[]
execute(double[] previousValues, double[] proposedValues, int numberOfValues)
Apply smoothing based on the current step sizedouble
execute(double previousValue, double proposedValue)
Apply smoothing based on the current step sizevoid
reset()
All components should be able to reset going back to some representative initial stateMSASmoothing
shallowClone()
Create a shallow copy of this entityvoid
updateStep(int iterationIndex)
Update stepSize to 1/iterationIndex-
Methods inherited from class org.goplanit.component.PlanitComponent
equals, getComponentType, getExternalId, getId, getIdGroupingToken, getKnownSupportedEventTypes, getXmlId, hashCode, onPlanitComponentEvent, setExternalId, setXmlId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.event.EventListener
hasKnownSupportedEventTypes
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, hasExternalId, hasXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, idEquals, idHashCode
-
-
-
-
Field Detail
-
stepSize
protected double stepSize
Step size
-
DEFAULT_INITIAL_STEP_SIZE
public static final double DEFAULT_INITIAL_STEP_SIZE
The default initial step size to use- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MSASmoothing
public MSASmoothing(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- contiguous id generation within this group for instances of this class
-
MSASmoothing
public MSASmoothing(MSASmoothing other, boolean deepCopy)
Copy constructor- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
updateStep
public void updateStep(int iterationIndex)
Update stepSize to 1/iterationIndex- Specified by:
updateStep
in classSmoothing
- Parameters:
iterationIndex
- index of current iteration- See Also:
Smoothing.updateStep(int)
-
execute
public double execute(double previousValue, double proposedValue)
Apply smoothing based on the current step size
-
execute
public double[] execute(double[] previousValues, double[] proposedValues, int numberOfValues)
Apply smoothing based on the current step size
-
shallowClone
public MSASmoothing shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in classSmoothing
- Returns:
- shallow copy of entity
-
deepClone
public MSASmoothing deepClone()
deep clone on planit component should attempt to also update internal dependencies between deep cloned containers where possible
-
reset
public void reset()
All components should be able to reset going back to some representative initial state- Specified by:
reset
in classPlanitComponent<Smoothing>
-
collectSettingsAsKeyValueMap
public Map<String,String> collectSettingsAsKeyValueMap()
Provide all the settings of this particular component by name and value, where each value is a string representation of the underlying entity- Specified by:
collectSettingsAsKeyValueMap
in classPlanitComponent<Smoothing>
- Returns:
- name-value map of all (user configurable) settings
-
-