Class RoutingProbabilitiesParametricAnalysis

java.lang.Object
common.definitions.parametric.ParametricAnalysisDefinition
common.definitions.parametric.RoutingProbabilitiesParametricAnalysis
All Implemented Interfaces:
ParametricAnalysis

public class RoutingProbabilitiesParametricAnalysis extends ParametricAnalysisDefinition

Title: RoutingProbabilitiesParametricAnalysis

Description: this class is used to describe a parametric analysis where the varied parameter is the value of routing probabilities of a class inside a station. It adds the classKey, stationKey, and destinationStationKey fields, used to keep the key of the Job-Class and the key of the station whose routing probabilities will be varied, and a boolean value singleClass used to choose the type of routing probability growth (single or all class).

Author:
Xinyu gao Date: 11-Aug-2023
  • Constructor Details

  • Method Details

    • isSingleClass

      public boolean isSingleClass()
      Returns true if only the routign probability of one class will be increased
      Returns:
      true if only the routign probability of one class will be increased
    • setSingleClass

      public void setSingleClass(boolean isSingleClass)
      Sets the type of population increase. If isSingleClass param is true only the routign probability of one class will be increased
      Parameters:
      isSingleClass -
    • setDefaultInitialValue

      public void setDefaultInitialValue()
      Sets the default initial Value
    • setDefaultFinalValue

      public void setDefaultFinalValue()
      Sets default final value
    • getReferenceClass

      public Object getReferenceClass()
      Gets the class key of the job class whose routign probability will be increased. If the simulation is not single class, the null value will be returned
      Specified by:
      getReferenceClass in class ParametricAnalysisDefinition
      Returns:
      the key of the class whose routign probability will be increased if the parametric analysis is single class, null otherwise.
    • getReferenceClassName

      public String getReferenceClassName()
      Get the reference class name
      Specified by:
      getReferenceClassName in class ParametricAnalysisDefinition
      Returns:
      the name of the class
    • getProperties

      public Map<String,String> getProperties()
      Gets a TreeMap containing for each property its value. The supported properties are defined as constants inside this class.
      Specified by:
      getProperties in class ParametricAnalysisDefinition
      Returns:
      a TreeMap containing the value for each property
    • setProperty

      public void setProperty(String propertyName, String value)
      Sets the value for the specified property. The supported properties are:
      - FROM_PROPERTY
      - TO_PROPERTY
      - STEPS_PROPERTY
      - IS_SINGLE_CLASS_PROPERTY
      - REFERENCE_STATION_PROPERTY
      - REFERENCE_CLASS_PROPERTY
      - REFERENCE_DEST_STATION_PROPERTY
      Specified by:
      setProperty in class ParametricAnalysisDefinition
      Parameters:
      propertyName - the name of the property to be set
      value - the value to be set
    • setReferenceClass

      public void setReferenceClass(Object classKey)
      Sets the class whose routing probability will be increased. If singleClass value is not true nothing will be done
      Parameters:
      classKey - the key of the class whose routing probability will be increased
    • getReferenceStation

      public Object getReferenceStation()
      Gets the station key whose routing probability will be varied
      Returns:
      the key of the station whose service times will be varied
    • getReferenceStationName

      public String getReferenceStationName()
      Gets name of the source station whose routing probability will be varied
      Returns:
      the key of the source station whose routing probability will be varied
    • setReferenceStation

      public void setReferenceStation(Object stationKey)
      Sets the source station whose routing probability will be varied
      Parameters:
      stationKey - the source station whose routing probability will be varied
    • getDestinationStationKey

      public Object getDestinationStationKey()
      Gets the destination station key whose routing probability will be varied
      Returns:
      the key of the destination station whose service times will be varied
    • setDestinationStationKey

      public void setDestinationStationKey(Object key)
      Sets the destination station whose routing probability will be varied
      Parameters:
      key - the destination station whose routing probability will be varied
    • getDestinationStationName

      public String getDestinationStationName()
      Gets name of the destination station whose routing probability will be varied
      Returns:
      the key of the destination station whose routing probability will be varied
    • getType

      public String getType()
      Gets the type of parametric analysis
      Specified by:
      getType in class ParametricAnalysisDefinition
      Returns:
      the type of parametric analysis
    • roundDecimals

      public static double roundDecimals(double value)
      Gets the decimals retained to four decimal places
      Returns:
      the decimals retained to four decimal places
    • normalizeRoutingProbabilities

      public void normalizeRoutingProbabilities(Object stationKey, Object classKey, Map<Object,Double> values, Object changedStationKey, double newProbability)
      Redistributes the routing probabilities from the source station to stations other than the destination station
    • changeModel

      public void changeModel(int step)
      Changes the model preparing it for the next step
      Specified by:
      changeModel in class ParametricAnalysisDefinition
    • getDestStationNames

      public Object[] getDestStationNames()
      Gets the names of destination stations
      Returns:
      the names of destination stations
    • getTableData

      public Object[][] getTableData()
    • getRoutingProbabilityTable

      public Object[][] getRoutingProbabilityTable()
      Gets the routing probability table
      Returns:
      the table that contains different routing probabilities
    • searchForAvailableSteps

      public int searchForAvailableSteps()
      Gets the maximum number of steps compatible with the model definition and the type of parametric analysis.
      Specified by:
      searchForAvailableSteps in class ParametricAnalysisDefinition
      Returns:
      the maximum number of steps
    • createValuesSet

      public void createValuesSet()
      Finds the set of possible values of the parameter on which the simulation may be iterated on.
      Specified by:
      createValuesSet in class ParametricAnalysisDefinition
    • restoreOriginalValues

      public void restoreOriginalValues()
      Restore the original values of routing probabilities
      Specified by:
      restoreOriginalValues in class ParametricAnalysisDefinition
    • checkCorrectness

      public int checkCorrectness(boolean autocorrect)
      Checks if the PA model is still coherent with simulation model definition. If the autocorrect variable is set to true, if the PA model is no more valid but it can be corrected it will be changed.
      Specified by:
      checkCorrectness in class ParametricAnalysisDefinition
      Parameters:
      autocorrect - if true the PA model will be autocorrected
      Returns:
      0 - If the PA model is still valid
      1 - If the PA model is no more valid, but it will be corrected
      2 - If the PA model can be no more used
    • getParameterValues

      public Vector<Number> getParameterValues()
      Returns the values assumed by the varying parameter
      Specified by:
      getParameterValues in class ParametricAnalysisDefinition
      Returns:
      a Vector containing the values assumed by the varying parameter