Class TimeWeighted

    • Constructor Detail

      • TimeWeighted

        public TimeWeighted​(ModelElement parent)
        Creates a TimeWeighted 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.
      • TimeWeighted

        public TimeWeighted​(ModelElement parent,
                            double initialValue)
        Creates a TimeWeighted 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.
      • TimeWeighted

        public TimeWeighted​(ModelElement parent,
                            java.lang.String name)
        Creates a TimeWeighted 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.
      • TimeWeighted

        public TimeWeighted​(ModelElement parent,
                            double initialValue,
                            java.lang.String name)
        Creates a TimeWeighted 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.
      • TimeWeighted

        public TimeWeighted​(ModelElement parent,
                            double initialValue,
                            double lowerLimit,
                            java.lang.String name)
        Creates a TimeWeighted 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.
      • TimeWeighted

        public TimeWeighted​(ModelElement parent,
                            double initialValue,
                            double lowerLimit)
        Creates a TimeWeighted 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
      • TimeWeighted

        public TimeWeighted​(ModelElement parent,
                            double initialValue,
                            double lowerLimit,
                            double upperLimit)
        Creates a TimeWeighted 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
      • TimeWeighted

        public TimeWeighted​(ModelElement parent,
                            double initialValue,
                            double lowerLimit,
                            double upperLimit,
                            java.lang.String name)
        Creates a TimeWeighted 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

      • increment

        public final void increment()
        Increments the value of the variable by 1 at the current time.
      • increment

        public final void increment​(double value)
        Increments the value of the variable by the amount supplied. Throws an IllegalArgumentException if the value is negative.
        Parameters:
        value - The amount to increment by. Must be non-negative.
      • decrement

        public final void decrement()
        Decrements the value of the variable by 1 at the current time.
      • decrement

        public final void decrement​(double value)
        Decrements the value of the variable by the amount supplied. Throws an IllegalArgumentException if the value is negative.
        Parameters:
        value - The amount to decrement by. Must be non-negative.
      • setWeight

        protected final void setWeight()
        Sets the weight, the current time - the time of the last change
        Overrides:
        setWeight in class Variable
      • initialize

        protected void initialize()
        Initialize the value to the current value at this time
        Overrides:
        initialize in class Variable
      • 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 ResponseVariable
      • warmUp

        protected void warmUp()
        Schedules the batch events for after the warm up period Sets the value of the variable to the current value at the current time Resets the time of last change to the current time
        Overrides:
        warmUp in class ResponseVariable
      • replicationEnded

        protected void replicationEnded()
        Sets the value of the variable to the current value at the current time to collect state to end of replication
        Overrides:
        replicationEnded in class ResponseVariable