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 doubleDEFAULT_INITIAL_STEP_SIZEThe default initial step size to useprotected doublestepSizeStep 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 entityMSASmoothingdeepClone()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 sizedoubleexecute(double previousValue, double proposedValue)Apply smoothing based on the current step sizevoidreset()All components should be able to reset going back to some representative initial stateMSASmoothingshallowClone()Create a shallow copy of this entityvoidupdateStep(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:
updateStepin 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:
shallowClonein interfaceIdAble- Specified by:
shallowClonein 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:
resetin 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:
collectSettingsAsKeyValueMapin classPlanitComponent<Smoothing>- Returns:
- name-value map of all (user configurable) settings
-
-