Class MSASmoothing

  • All Implemented Interfaces:
    Serializable, org.djutils.event.EventProducerInterface

    public class MSASmoothing
    extends Smoothing
    MSA smoothing object
    Author:
    markr
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double stepSize
      Step size
      • Fields inherited from class org.planit.sdinteraction.smoothing.Smoothing

        MSA
      • Fields inherited from class org.djutils.event.EventProducer

        listeners
      • Fields inherited from interface org.djutils.event.EventProducerInterface

        FIRST_POSITION, LAST_POSITION
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double[] applySmoothing​(double[] previousValues, double[] proposedValues, int numberOfValues)
      #Apply smoothing based on the current step size
      double applySmoothing​(double previousValue, double proposedValue)
      #Apply smoothing based on the current step size
      void update​(int iterationIndex)
      Update stepSize to 1/iterationIndex
      • Methods inherited from class org.djutils.event.EventProducer

        addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, getEventTypesWithListeners, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
    • Field Detail

      • stepSize

        protected double stepSize
        Step size
    • Constructor Detail

      • MSASmoothing

        public MSASmoothing​(IdGroupingToken groupId)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
    • Method Detail

      • update

        public void update​(int iterationIndex)
        Update stepSize to 1/iterationIndex
        Specified by:
        update in class Smoothing
        Parameters:
        iterationIndex - index of current iteration
        See Also:
        Smoothing.update(int)
      • applySmoothing

        public double applySmoothing​(double previousValue,
                                     double proposedValue)
        #Apply smoothing based on the current step size
        Specified by:
        applySmoothing in class Smoothing
        Parameters:
        previousValue - previous value
        proposedValue - proposed value
        Returns:
        smoothedValue smoothed value
      • applySmoothing

        public double[] applySmoothing​(double[] previousValues,
                                       double[] proposedValues,
                                       int numberOfValues)
        #Apply smoothing based on the current step size
        Specified by:
        applySmoothing in class Smoothing
        Parameters:
        previousValues - array of previous values
        proposedValues - array of proposed values
        numberOfValues - number of proposed values
        Returns:
        smoothedValues array of smoothed values