Interface SimulationDefinition

All Known Implementing Classes:
CommonModel, JSimGraphModel, JSIMModel

public interface SimulationDefinition
Created by IntelliJ IDEA. User: orsotronIII Date: 22-lug-2005 Time: 17.33.22 This interface provides methods for simulation parameters definition. Those include measures and other parameters for simulation setup, such as simulation seed or simulation maximum duration. Modified by Bertoli Marco 3-oct-2005 Modified by Francesco D'Aquino
Author:
Bertoli Marco (new measures) Modified by Ashanka (May 2010): Project: 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. Modified by Sturari Nicola (Nov 2014) Desc: Added a parameter representing the maximum simulated time (not real time) before the simulation is stopped
  • Field Details

  • Method Details

    • addMeasure

      Object addMeasure(String type, Object stationKey, Object classKey)
      Adds a new measure for specified class and station (or region)
      Parameters:
      type - : code for measure type.
      stationKey - : specified station (or region) for measure
      classKey - : specified class
      Returns:
      search key for new measure
    • addMeasure

      Object addMeasure(String type, Object stationKey, Object classKey, Double alpha, Double precision, boolean log)
      Adds a new measure for specified class and station (or region)
      Parameters:
      type - : code for measure type.
      stationKey - : specified station for measure
      classKey - : specified class
      alpha - : alpha parameter for this measure
      precision - : precision parameter for this measure
      log - : true to log the measure to CSV. False to avoid it.
      Returns:
      search key for new measure
    • removeMeasure

      void removeMeasure(Object measureKey)
      Removes a measure from list, given its search key
      Parameters:
      measureKey - : search Key for measure to be removed
    • getMeasureKeys

      Vector<Object> getMeasureKeys()
      Returns list of measure search keys
      Returns:
      Vector containing all of the measure search keys
    • getMeasureType

      String getMeasureType(Object measureKey)
      Returns type of measure, given measure search key
      Parameters:
      measureKey - : search key
      Returns:
      measure type
    • setMeasureType

      void setMeasureType(String newType, Object measureKey)
      Sets type of parameter to be measured
      Parameters:
      newType - new type for this measure
      measureKey - search key for this measure
    • getMeasureStation

      Object getMeasureStation(Object measureKey)
      Returns search key for station a certain measure refers to.
      Parameters:
      measureKey - search key for measure
      Returns:
      search key for station.
    • setMeasureStation

      void setMeasureStation(Object stationKey, Object measureKey)
      Changes reference station for specified measure, given its search key
      Parameters:
      stationKey - : search key for station this measure must be referred to.
      measureKey - : search key for measure.
    • getMeasureClass

      Object getMeasureClass(Object measureKey)
      Returns search key for class this measure refers to.
      Parameters:
      measureKey - search key for measure
      Returns:
      search key for class
    • setMeasureClass

      void setMeasureClass(Object classKey, Object measureKey)
      Changes reference class for specified measure, given its search key
      Parameters:
      classKey - new class search key
      measureKey - measure search key
    • getMeasureServerTypeKey

      Object getMeasureServerTypeKey(Object measureKey)
      Returns search key for server type this measure refers to.
      Parameters:
      measureKey - search key for measure
      Returns:
      server type key for class
    • setMeasureServerTypeKey

      void setMeasureServerTypeKey(Object serverTypeKey, Object measureKey)
      Changes server type for specified measure, given its search key
      Parameters:
      serverTypeKey - new server type key
      measureKey - measure search key
    • getServerTypeStationName

      String getServerTypeStationName(Object serverTypeKey)
      This method returns a server type name with respect to its station given its key
    • getMeasureAlpha

      Double getMeasureAlpha(Object measureKey)
      Returns value for alpha parameter of a specific measure, given its search key.
      Parameters:
      measureKey - search key for station
      Returns:
      value of alpha parameter
    • setMeasureAlpha

      void setMeasureAlpha(Double alpha, Object measureKey)
      Sets value for alpha parameter of a specific measure, given its search key.
      Parameters:
      alpha - value of alpha parameter
      measureKey - search key for station
    • getMeasurePrecision

      Double getMeasurePrecision(Object measureKey)
      Returns value for precision parameter of a specific measure, given its search key.
      Parameters:
      measureKey - search key for station
      Returns:
      value of precision parameter
    • setMeasurePrecision

      void setMeasurePrecision(Double precision, Object measureKey)
      Sets value for alpha parameter of a specific measure, given its search key.
      Parameters:
      precision - value of alpha parameter
      measureKey - search key for station
    • getMeasureLog

      boolean getMeasureLog(Object measureKey)
      Tells if a measure should be logged
      Parameters:
      measureKey - the key of the measure
      Returns:
      true if measure should be logged, false otherwise.
    • setMeasureLog

      void setMeasureLog(boolean log, Object measureKey)
      Sets if measure should be logged
      Parameters:
      log - true to log measure, false to avoid (default)
      measureKey - the key of the measure
    • isGlobalMeasure

      boolean isGlobalMeasure(String type)
      Tells if a given measure is global
      Parameters:
      type - type of given measure
      Returns:
      true if measure is global
    • isSinkMeasure

      boolean isSinkMeasure(String type)
      Tells if a given measure is for sinks only
      Parameters:
      type - type of given measure
      Returns:
      true if measure is for sinks only
    • isFCRMeasure

      boolean isFCRMeasure(String type)
      Tells if a given measure is for blocking regions only
      Parameters:
      type - type of given measure
      Returns:
      true if measure is for blocking regions only
    • isFJMeasure

      boolean isFJMeasure(String type)
      Tells if a given measure is for fork/join sections only
      Parameters:
      type - type of given measure
      Returns:
      true if measure is for fork/join sections only
    • getPreloadedJobs

      Integer getPreloadedJobs(Object stationKey, Object classKey)
      Returns number of preloaded jobs at specified station for specified class.
      Parameters:
      stationKey - station at which preloaded jobs are preloaded.
      classKey - class to which preloaded jobs belong.
      Returns:
      number of preloaded jobs.
    • setPreloadedJobs

      void setPreloadedJobs(Object stationKey, Object classKey, Integer preload)
      Sets number of preloaded jobs at specified station for specified class. For closed classes, total number of preloaded jobs for a class over all stations must be equal to class population, otherwise update is canceled.
      Parameters:
      stationKey - station at which preloaded jobs are preloaded.
      classKey - class to which preloaded jobs belong.
      preload - number of preloaded jobs.
    • getPreloadedJobsNumber

      Integer getPreloadedJobsNumber(Object classKey)
      Returns total number of preloaded jobs for specified class.
      Parameters:
      classKey - class to which preloaded jobs belong.
      Returns:
      total number of preloaded jobs.
    • manageJobs

      void manageJobs()
      This method is used to manage number of jobs for every class. If class is closed all spare jobs will be allocated to its reference source, if for some reasons more jobs are allocated than max population, they are reduced. Uses this method only when strictly necessary as it can be slow if the model is big.
    • getSimulationSeed

      Long getSimulationSeed()
      Gets seed for simulation.
      Returns:
      seed for simulation.
    • setSimulationSeed

      void setSimulationSeed(Long seed)
      Sets seed for simulation.
      Parameters:
      seed - seed for simulation.
    • getUseRandomSeed

      Boolean getUseRandomSeed()
      Tells if random seed is used.
      Returns:
      true if random seed is used, false otherwise.
    • setUseRandomSeed

      void setUseRandomSeed(Boolean useRandomSeed)
      Sets if random seed is used.
      Parameters:
      useRandomSeed - true if random seed is used, false otherwise.
    • getMaximumDuration

      Double getMaximumDuration()
      Returns maximum duration for simulation in seconds.
      Returns:
      seconds of maximum duration for simulation.
    • setMaximumDuration

      void setMaximumDuration(Double durationSeconds)
      Sets maximum duration for simulation in seconds.
      Parameters:
      durationSeconds - seconds of maximum duration for simulation.
    • getMaxSimulatedTime

      Double getMaxSimulatedTime()
      Returns maximum duration for simulation in time units.
      Returns:
      time units of maximum duration for simulation.
    • setMaxSimulatedTime

      void setMaxSimulatedTime(Double duration)
      Sets maximum duration for simulation in time units.
      Parameters:
      duration - time units of maximum duration for simulation.
    • getMaxSimulationSamples

      Integer getMaxSimulationSamples()
      Returns maximum number of simulation samples.
      Returns:
      maximum number of simulation samples.
    • setMaxSimulationSamples

      void setMaxSimulationSamples(Integer maxSamples)
      Sets maximum number of simulation samples.
      Parameters:
      maxSamples - maximum number of simulation samples.
    • getDisableStatistic

      Boolean getDisableStatistic()
      Tells if statistic check is disabled.
      Returns:
      true if statistic check is disabled, false otherwise.
    • setDisableStatistic

      void setDisableStatistic(Boolean disableStatistic)
      Sets if statistic check is disabled.
      Parameters:
      disableStatistic - true if statistic check is disabled, false otherwise.
    • getMaxSimulationEvents

      Integer getMaxSimulationEvents()
      Returns maximum number of simulation events.
      Returns:
      maximum number of simulation events.
    • setMaxSimulationEvents

      void setMaxSimulationEvents(Integer maxEvents)
      Sets maximum number of simulation events.
      Parameters:
      maxEvents - maximum number of simulation events.
    • getPollingInterval

      Double getPollingInterval()
      Returns polling interval for temporary measures.
      Returns:
      polling interval for temporary measures.
    • setPollingInterval

      void setPollingInterval(Double pollingInterval)
      Sets polling interval for temporary measures.
      Parameters:
      pollingInterval - polling interval for temporary measures.
    • getWhatIfParallelism

      Integer getWhatIfParallelism()
      Returns the number of simulations to be run in parallel during what if analysis.
      Returns:
      the number of simulations to be run in parallel during what if analysis.
    • getSimulationResults

      MeasureDefinition getSimulationResults()
      Returns last simulation results
      Returns:
      simulation results or null if no simulation was performed
    • setSimulationResults

      void setSimulationResults(MeasureDefinition results)
      Sets simulation results
      Parameters:
      results - simulation results data structure
    • containsSimulationResults

      boolean containsSimulationResults()
      Tells if current model contains simulation results
      Returns:
      true if getSimulationResults() returns a non-null object
    • isAnimationEnabled

      boolean isAnimationEnabled()
      Tells if queue animation is enabled
      Returns:
      true if the animation is enabled
    • setAnimationEnabled

      void setAnimationEnabled(boolean isEnabled)
      Enable / disable queue animation
      Parameters:
      isEnabled - - set it to true to enable queue animation
    • isParametricAnalysisEnabled

      boolean isParametricAnalysisEnabled()
      Tells if parametric analysis is enabled
      Returns:
      true if parametric analysis is enabled
    • setParametricAnalysisEnabled

      void setParametricAnalysisEnabled(boolean enabled)
      Enable / disable parametric analysis
      Parameters:
      enabled - - set it to true to enable parametric analysis
    • getParametricAnalysisModel

      ParametricAnalysisDefinition getParametricAnalysisModel()
      Returns the ParametricAnalysisModel
      Returns:
      the parametricAnalysisModel
    • setParametricAnalysisModel

      void setParametricAnalysisModel(ParametricAnalysisDefinition pad)
      Sets the ParametricAnalysisModel
      Parameters:
      pad - the parametricAnalysisModel to be set
    • setSaveChanged

      void setSaveChanged()
      Tells model that some data has been changed and need to be saved. This is used by Parametric Analysis