Class ResponseVariable

    • Field Detail

      • myCountStopLimit

        protected long myCountStopLimit
        indicates the count when the simulation should stop *
      • myDefaultReportingOption

        protected boolean myDefaultReportingOption
        Can be used by the reports to indicate whether or not the response should appear The default is true
      • myWithinRepStats

        protected WeightedStatistic myWithinRepStats
        The within replication statistics for the response variable
      • myAcrossRepStats

        protected Statistic myAcrossRepStats
        The across replication statistics for the response variable
      • myMaxResponse

        protected ResponseVariable myMaxResponse
        Used to collect across replication averages over the maximum of the response variable
      • myWithinIntervalStats

        protected WeightedStatistic myWithinIntervalStats
        The within interval statistics for the response variable
      • myAcrossIntervalResponse

        protected ResponseVariable myAcrossIntervalResponse
        For collecting across interval statistics
      • myLastUpdateTime

        protected double myLastUpdateTime
        Time of last update interval
      • myTimeOfWarmUp

        protected double myTimeOfWarmUp
        The time of the warm up if it occurs, 0.0 otherwise
    • Constructor Detail

      • ResponseVariable

        public ResponseVariable​(ModelElement parent)
        Creates a ResponseVariable with the given parent with initial value 0.0 over the range [Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY]
        Parameters:
        parent - the variable's parent model element.
      • ResponseVariable

        public ResponseVariable​(ModelElement parent,
                                double initialValue)
        Creates a ResponseVariable with the given name and initial value over the range [Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY]
        Parameters:
        parent - the variable's parent model element.
        initialValue - The initial value of the variable.
      • ResponseVariable

        public ResponseVariable​(ModelElement parent,
                                java.lang.String name)
        Creates a ResponseVariable with the given name and initial value, 0.0, over the range [Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY]
        Parameters:
        parent - the variable's parent model element.
        name - The name of the variable.
      • ResponseVariable

        public ResponseVariable​(ModelElement parent,
                                double initialValue,
                                java.lang.String name)
        Creates a ResponseVariable with the given name and initial value over the supplied range The default range is [Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY]
        Parameters:
        parent - the variable's parent model element
        initialValue - The initial value of the variable.
        name - The name of the variable.
      • ResponseVariable

        public ResponseVariable​(ModelElement parent,
                                double initialValue,
                                double lowerLimit,
                                java.lang.String name)
        Creates a ResponseVariable with the given name and initial value over the supplied range [lowerLimit, Double.POSITIVE_INFINITY]
        Parameters:
        parent - the variable's parent model element
        initialValue - The initial value of the variable.
        lowerLimit - the lower limit on the range for the variable, must be < upperLimit
        name - The name of the variable.
      • ResponseVariable

        public ResponseVariable​(ModelElement parent,
                                double initialValue,
                                double lowerLimit)
        Creates a ResponseVariable with the initial value over the supplied range [lowerLimit, Double.POSITIVE_INFINITY]
        Parameters:
        parent - the variable's parent model element
        initialValue - The initial value of the variable.
        lowerLimit - the lower limit on the range for the variable, must be < upperLimit
      • ResponseVariable

        public ResponseVariable​(ModelElement parent,
                                double initialValue,
                                double lowerLimit,
                                double upperLimit)
        Creates a ResponseVariable with the initial value over the supplied range [lowerLimit, upperLimit]
        Parameters:
        parent - the variable's parent model element
        initialValue - The initial value of the variable.
        lowerLimit - the lower limit on the range for the variable, must be < upperLimit
        upperLimit - the upper limit on the range for the variable
      • ResponseVariable

        public ResponseVariable​(ModelElement parent,
                                double initialValue,
                                double lowerLimit,
                                double upperLimit,
                                java.lang.String name)
        Creates a ResponseVariable with the given name and initial value over the supplied range [lowerLimit, upperLimit]
        Parameters:
        parent - the variable's parent model element
        initialValue - The initial value of the variable. Must be within the range.
        lowerLimit - the lower limit on the range for the variable, must be < upperLimit
        upperLimit - the upper limit on the range for the variable
        name - The name of the variable.
    • Method Detail

      • turnOnAcrossReplicationMaxCollection

        public final void turnOnAcrossReplicationMaxCollection()
        Allows for the collection of across replication statistics on the average maximum number observed
      • getAcrossIntervalResponse

        public final ResponseVariable getAcrossIntervalResponse()
        If the time interval collection is turned on a ResponseVariable is created for capturing statistics across the intervals. This returns this value or null if time interval collection has not been turned on
        Returns:
        the response or null
      • turnOnTimeIntervalCollection

        public final void turnOnTimeIntervalCollection​(double interval)
        Turns on the collection of statistics across intervals of time, defined by the interval length
        Parameters:
        interval -
      • turnOnTimeIntervalTrace

        public final void turnOnTimeIntervalTrace()
        Turns on tracing to a file of the time interval response if and only if time interval collection has been turned on
      • turnOnTimeIntervalTrace

        public final void turnOnTimeIntervalTrace​(boolean header)
        Turns on tracing to a file of the time interval response if and only if time interval collection has been turned on
        Parameters:
        header - true means include the header
      • turnOnTimeIntervalTrace

        public final void turnOnTimeIntervalTrace​(java.lang.String fileName)
        Turns on tracing to a file of the time interval response if and only if time interval collection has been turned on
        Parameters:
        fileName - the name of the file to write the trace
      • turnOnTimeIntervalTrace

        public final void turnOnTimeIntervalTrace​(java.lang.String fileName,
                                                  boolean header)
        Turns on tracing to a file of the time interval response if and only if time interval collection has been turned on
        Parameters:
        fileName - the name of the file to write the trace
        header - true means include the header
      • replicationEnded

        protected void replicationEnded()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed when the replication ends and prior to the calling of afterReplication() . It is called when each replication ends and can be used to collect data from the the model element, etc.
        Overrides:
        replicationEnded in class ModelElement
      • setDefaultReportingOption

        public void setDefaultReportingOption​(boolean flag)
        Sets the default reporting option. True means the response will appear on default reports
        Specified by:
        setDefaultReportingOption in interface DefaultReportingOptionIfc
        Parameters:
        flag -
      • getDefaultReportingOption

        public boolean getDefaultReportingOption()
        Returns the default reporting option. True means that the response should appear on the default reports
        Specified by:
        getDefaultReportingOption in interface DefaultReportingOptionIfc
        Returns:
      • getValue

        public double getValue()
        Every Variable must implement the getValue method. This method simply returns the value of the variable.
        Specified by:
        getValue in interface GetValueIfc
        Overrides:
        getValue in class Variable
        Returns:
        The value of the variable.
      • resetWithinReplicationStatistics

        public void resetWithinReplicationStatistics()
      • removedFromModel

        protected void removedFromModel()
        Description copied from class: Aggregatable
        This method should be overridden by subclasses that need actions performed when a model element is removed from a model after the replication has started.
        Overrides:
        removedFromModel in class Variable
      • setValue

        public void setValue​(double value)
        Description copied from class: Variable
        Sets the value of the variable and notifies any observers of the change
        Specified by:
        setValue in interface SetValueIfc
        Overrides:
        setValue in class Variable
        Parameters:
        value - The observation of the variable.
      • collectStatistics

        protected void collectStatistics()
      • timedUpdate

        protected void timedUpdate()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed at each timed update event during each replication. It is called for each timed update during each replication if the model element reacts to timed update actions.
        Overrides:
        timedUpdate in class ModelElement
      • setCountBasedStopLimit

        public final void setCountBasedStopLimit​(long countLimit)
        Sets the count limit for determining when the count based stopping should occur If countLimit is less than or equal to current count when set then the action will occur the next time that the variable changes
        Parameters:
        countLimit - must be >=0, zero implies no count limit
      • getCountStopLimit

        public final long getCountStopLimit()
        Gets the stopping limit based on counts, zero means no limit set
        Returns:
        the stopping limit for observations
      • beforeExperiment

        protected void beforeExperiment()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need logic to be performed prior to an experiment. The beforeExperiment method allows model elements to be setup prior to the first replication within an experiment. It is called once before any replications occur.
        Overrides:
        beforeExperiment in class Variable
      • beforeReplication

        protected void beforeReplication()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed prior to each replication. It is called prior to each replication and can be used to initialize the model element. It is called before initialize() is called.
        Overrides:
        beforeReplication in class ModelElement
      • warmUp

        protected void warmUp()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed at the warm up event during each replication. It is called once during each replication if the model element reacts to warm up actions.
        Overrides:
        warmUp in class Variable
      • afterReplication

        protected void afterReplication()
        Description copied from class: ModelElement
        This method should be overridden by subclasses that need actions performed after each replication. It is called after replicationEnded() has been called.
        Overrides:
        afterReplication in class ModelElement
      • asString

        public java.lang.String asString()
        Description copied from class: ModelElement
        Allows sub-classes to provide more detail than toString() to represent the ModelElement as a String
        Overrides:
        asString in class Variable
        Returns:
        a detailed String representation