Class ResultsModel

java.lang.Object
common.definitions.ResultsModel
All Implemented Interfaces:
MeasureDefinition

public class ResultsModel extends Object implements MeasureDefinition

Title: Result's Model data structure

Description: This class will collect temporary results from simulation at specified time intervals, and final results. It will not read simulator's generated XML as it provides only final results but will rely on TempMeasure data structures provided by DispatcherJSIMschema.

Author:
Bertoli Marco Date: 23-set-2005 Time: 15.57.43 Modified by Ashanka (May 2010): Patch: Multi-Sink Perf. Index Description: Added new Performance index for capturing 1. global response time (ResponseTime per Sink) 2. global throughput (Throughput per Sink) each sink per class.
  • Constructor Details

    • ResultsModel

      public ResultsModel(double pollingInterval, String logCsvDelimiter, String logDecimalSeparator)
      Constructs a new ResultsModel
      Parameters:
      pollingInterval - measure polling interval
  • Method Details

    • setTempMeasures

      public void setTempMeasures(TempMeasure[] measures, double progress, long elapsedTime)
      Sets this data structure, provided an array of TempMeasures
      Parameters:
      measures - array of TempMeasures, as returned by DispatcherJSIMschema.getTempMeasures()
      progress - Progress of simulation
      elapsedTime - Elapsed time of simulation
    • refresh

      public void refresh(double progress, long elapsedTime)
      Refresh stored tempMeasures. PRECONDITION: refresh method MUST HAVE BEEN called on every TempMeasure before calling this method. So simply this method is designed to be called after every DispatcherJSIMschema.refreshTempMeasures() call.
      Parameters:
      progress - Progress of simulation
      elapsedTime - Elapsed time of simulation
    • addMeasureListener

      public void addMeasureListener(int measureIndex, MeasureDefinition.MeasureListener listener)
      Adds a MeasureListener to listen to measure change events for given measure. Each measure can have ONLY one MeasureListener to avoid unnecessary computational efforts to manage a pool of listeners.
      Specified by:
      addMeasureListener in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure that this listener should listen
      listener - listener to add or null to remove old one
    • getMeasureNumber

      public int getMeasureNumber()
      Returns the total number of measures
      Specified by:
      getMeasureNumber in interface MeasureDefinition
      Returns:
      total number of measures
    • getName

      public String getName(int measureIndex)
      Returns the name of a given measure
      Specified by:
      getName in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      name of the measure
    • getStationName

      public String getStationName(int measureIndex)
      Returns the station name of a given measure
      Specified by:
      getStationName in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      station name
    • getClassName

      public String getClassName(int measureIndex)
      Returns the class name of a given measure
      Specified by:
      getClassName in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      class name
    • getAlpha

      public double getAlpha(int measureIndex)
      Returns the alpha of a given measure
      Specified by:
      getAlpha in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      alpha
    • getPrecision

      public double getPrecision(int measureIndex)
      Returns the precision of a given measure
      Specified by:
      getPrecision in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      precision
    • getAnalyzedSamples

      public int getAnalyzedSamples(int measureIndex)
      Returns the number of analyzed samples for a given measure
      Specified by:
      getAnalyzedSamples in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      number of analyzed samples
    • getDiscardedSamples

      public int getDiscardedSamples(int measureIndex)
      Returns the number of discarded samples for a given measure
      Specified by:
      getDiscardedSamples in interface MeasureDefinition
      Parameters:
      measureIndex - the measure index
      Returns:
      number of discarded samples
    • getMeasureState

      public int getMeasureState(int measureIndex)
      Returns the state of a given measure
      Specified by:
      getMeasureState in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      measure state
    • getMeasureType

      public String getMeasureType(int measureIndex)
      Returns the type of a given measure
      Specified by:
      getMeasureType in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      measure type
    • getNodeType

      public String getNodeType(int measureIndex)
      Returns the node type of a given measure
      Specified by:
      getNodeType in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      node type
    • getLogFileName

      public String getLogFileName(int measureIndex)
      Returns the log file name where a verbose measure was stored
      Specified by:
      getLogFileName in interface MeasureDefinition
      Parameters:
      measureIndex - corresponding to a measure
      Returns:
      full path of the log file including the measure
    • getValues

      public Vector<MeasureValue> getValues(int measureIndex)
      Returns the vector of Temporary values of a given measure. Each element of the vector is an instance of Value interface.
      Specified by:
      getValues in interface MeasureDefinition
      Parameters:
      measureIndex - index of the measure
      Returns:
      vector of temporary values until now
    • getQueueLengthMeasures

      public int[] getQueueLengthMeasures()
      Returns an array with the measureIndex of every queue length measure
      Specified by:
      getQueueLengthMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getQueueTimeMeasures

      public int[] getQueueTimeMeasures()
      Returns an array with the measureIndex of every queue time measure
      Specified by:
      getQueueTimeMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getResponseTimeMeasures

      public int[] getResponseTimeMeasures()
      Returns an array with the measureIndex of every response time measure
      Specified by:
      getResponseTimeMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getResidenceTimeMeasures

      public int[] getResidenceTimeMeasures()
      Returns an array with the measureIndex of every residence time measure
      Specified by:
      getResidenceTimeMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getArrivalRateMeasures

      public int[] getArrivalRateMeasures()
      Returns an array with the measureIndex of every arrival rate measure
      Specified by:
      getArrivalRateMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getThroughputMeasures

      public int[] getThroughputMeasures()
      Returns an array with the measureIndex of every throughput measure
      Specified by:
      getThroughputMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getUtilizationMeasures

      public int[] getUtilizationMeasures()
      Returns an array with the measureIndex of every utilization measure
      Specified by:
      getUtilizationMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getTardinessMeasures

      public int[] getTardinessMeasures()
      Description copied from interface: MeasureDefinition
      Returns an array with the measureIndex of every tardiness measure
      Specified by:
      getTardinessMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getEarlinessMeasures

      public int[] getEarlinessMeasures()
      Description copied from interface: MeasureDefinition
      Returns an array with the measureIndex of every earliness measure
      Specified by:
      getEarlinessMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getLatenessMeasures

      public int[] getLatenessMeasures()
      Description copied from interface: MeasureDefinition
      Returns an array with the measureIndex of every lateness measure
      Specified by:
      getLatenessMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getEffectiveUtilizationMeasures

      public int[] getEffectiveUtilizationMeasures()
      Returns an array with the measureIndex of every utilization measure
      Specified by:
      getEffectiveUtilizationMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getDropRateMeasures

      public int[] getDropRateMeasures()
      Returns an array with the measureIndex of every drop rate measure
      Specified by:
      getDropRateMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getBalkingRateMeasures

      public int[] getBalkingRateMeasures()
      Returns an array with the measureIndex of every balking rate measure
      Specified by:
      getBalkingRateMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getRenegingRateMeasures

      public int[] getRenegingRateMeasures()
      Returns an array with the measureIndex of every reneging rate measure
      Specified by:
      getRenegingRateMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getRetrialAttemptsRateMeasures

      public int[] getRetrialAttemptsRateMeasures()
      Returns an array with the measureIndex of every retrial attempts rate measure
      Specified by:
      getRetrialAttemptsRateMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getRetrialOrbitSizeMeasures

      public int[] getRetrialOrbitSizeMeasures()
      Returns an array with the measureIndex of every retrial orbit size measure
      Specified by:
      getRetrialOrbitSizeMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getRetrialOrbitTimeMeasures

      public int[] getRetrialOrbitTimeMeasures()
      Returns an array with the measureIndex of every retrial orbit time measure
      Specified by:
      getRetrialOrbitTimeMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemCustomerNumberMeasures

      public int[] getSystemCustomerNumberMeasures()
      Returns an array with the measureIndex of every system customer number measure
      Specified by:
      getSystemCustomerNumberMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemResponseTimeMeasures

      public int[] getSystemResponseTimeMeasures()
      Returns an array with the measureIndex of every system response time measure
      Specified by:
      getSystemResponseTimeMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemThroughputMeasures

      public int[] getSystemThroughputMeasures()
      Returns an array with the measureIndex of every system throughput measure
      Specified by:
      getSystemThroughputMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemDropRateMeasures

      public int[] getSystemDropRateMeasures()
      Returns an array with the measureIndex of every system drop rate measure
      Specified by:
      getSystemDropRateMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemBalkingRateMeasures

      public int[] getSystemBalkingRateMeasures()
      Returns an array with the measureIndex of every system reneging rate measure
      Specified by:
      getSystemBalkingRateMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemRenegingRateMeasures

      public int[] getSystemRenegingRateMeasures()
      Returns an array with the measureIndex of every system reneging rate measure
      Specified by:
      getSystemRenegingRateMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemRetrialAttemptsRateMeasures

      public int[] getSystemRetrialAttemptsRateMeasures()
      Returns an array with the measureIndex of every system retrial attempts rate measure
      Specified by:
      getSystemRetrialAttemptsRateMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemPowerMeasures

      public int[] getSystemPowerMeasures()
      Returns an array with the measureIndex of every system power measure
      Specified by:
      getSystemPowerMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemTardinessMeasures

      public int[] getSystemTardinessMeasures()
      Description copied from interface: MeasureDefinition
      Returns an array with the measureIndex of every system tardiness measure
      Specified by:
      getSystemTardinessMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemEarlinessMeasures

      public int[] getSystemEarlinessMeasures()
      Description copied from interface: MeasureDefinition
      Returns an array with the measureIndex of every system earliness measure
      Specified by:
      getSystemEarlinessMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getSystemLatenessMeasures

      public int[] getSystemLatenessMeasures()
      Description copied from interface: MeasureDefinition
      Returns an array with the measureIndex of every system lateness measure
      Specified by:
      getSystemLatenessMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getResponsetimePerSinkMeasures

      public int[] getResponsetimePerSinkMeasures()
      Returns an array with the measureIndex of every response time per sink measure
      Specified by:
      getResponsetimePerSinkMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getThroughputPerSinkMeasures

      public int[] getThroughputPerSinkMeasures()
      Returns an array with the measureIndex of every throughput per sink measure
      Specified by:
      getThroughputPerSinkMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getFCRTotalWeightMeasures

      public int[] getFCRTotalWeightMeasures()
      Returns an array with the measureIndex of every FCR total weight measure
      Specified by:
      getFCRTotalWeightMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getFCRMemoryOccupationMeasures

      public int[] getFCRMemoryOccupationMeasures()
      Returns an array with the measureIndex of every FCR memory occupation measure
      Specified by:
      getFCRMemoryOccupationMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getFJCustomerNumberMeasures

      public int[] getFJCustomerNumberMeasures()
      Returns an array with the measureIndex of every FJ customer number measure
      Specified by:
      getFJCustomerNumberMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getFJResponseTimeMeasures

      public int[] getFJResponseTimeMeasures()
      Returns an array with the measureIndex of every FJ response time measure
      Specified by:
      getFJResponseTimeMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getFiringThroughputMeasures

      public int[] getFiringThroughputMeasures()
      Returns an array with the measureIndex of every firing throughput measure
      Specified by:
      getFiringThroughputMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getNumberOfActiveServersMeasures

      public int[] getNumberOfActiveServersMeasures()
      Description copied from interface: MeasureDefinition
      Returns an array with the measureIndex of every firing throughput measure
      Specified by:
      getNumberOfActiveServersMeasures in interface MeasureDefinition
      Returns:
      an array with measures' index
    • getPollingInterval

      public double getPollingInterval()
      Returns simulation polling interval in seconds
      Specified by:
      getPollingInterval in interface MeasureDefinition
      Returns:
      simulation polling interval in seconds
    • setProgressListener

      public void setProgressListener(MeasureDefinition.ProgressListener listener)
      Sets a ProgressListener to listen to progress change events. This is unique.
      Specified by:
      setProgressListener in interface MeasureDefinition
      Parameters:
      listener - listener to be set or null to reset previous one
    • setMalformedReplayerFileListener

      public void setMalformedReplayerFileListener(MeasureDefinition.MalformedReplayerFileListener listener)
      Specified by:
      setMalformedReplayerFileListener in interface MeasureDefinition
    • detectedMalformedReplayerFile

      public void detectedMalformedReplayerFile(String msg)
      Specified by:
      detectedMalformedReplayerFile in interface MeasureDefinition
    • getProgress

      public double getProgress()
      Returns current simulation progress
      Specified by:
      getProgress in interface MeasureDefinition
      Returns:
      current simulation progress
    • getElapsedTime

      public long getElapsedTime()
      Returns simulation elapsed time in milliseconds
      Specified by:
      getElapsedTime in interface MeasureDefinition
      Returns:
      simulation elapsed time in milliseconds
    • isSimulationFinished

      public boolean isSimulationFinished()
      Returns if simulation has finished, so results are fixed
      Specified by:
      isSimulationFinished in interface MeasureDefinition
      Returns:
      true iff simulation has finished
    • getLogDecimalSeparator

      public String getLogDecimalSeparator()
      Returns the decimal separator used in log files
      Specified by:
      getLogDecimalSeparator in interface MeasureDefinition
      Returns:
      the decimal separator used in log files
    • getLogCsvDelimiter

      public String getLogCsvDelimiter()
      Returns the CSV delimiter used in log files
      Specified by:
      getLogCsvDelimiter in interface MeasureDefinition
      Returns:
      the CSV delimiter used in log files