Class Aggregate

    • Field Detail

      • myNumInitialized

        protected int myNumInitialized
        counts the number of observed variables that have been initialized
      • myNumWarmedUp

        protected int myNumWarmedUp
        counts the number of observed variables that have been warmed up
      • myVariables

        protected java.util.List<Aggregatable> myVariables
        Holds the variables that this aggregate is observing for the purposes of aggregation
    • Constructor Detail

      • Aggregate

        public Aggregate​(ModelElement parent)
        Parameters:
        parent -
      • Aggregate

        public Aggregate​(ModelElement parent,
                         java.lang.String name)
        Parameters:
        parent -
        name -
    • Method Detail

      • subscribeTo

        public final void subscribeTo​(Aggregatable variable)
        Tells the Aggregate to observe the provided Variable for the purpose of aggregating
        Parameters:
        variable -
      • unsubscribeFrom

        public final void unsubscribeFrom​(Aggregatable variable)
        Tells the aggregate to stop observing the provided Variable
        Parameters:
        variable -
      • sumValues

        public final double sumValues()
        Computes and returns the sum of the aggregated variables
        Returns:
      • avgValues

        public final double avgValues()
        Computes and returns the average of the aggregated variables
        Returns:
      • countNumToInitialize

        public final int countNumToInitialize()
        Counts and returns the number of aggregated variables that have their initialization option on
        Returns:
      • countNumToWarmUp

        public final int countNumToWarmUp()
        Counts and returns the number of aggregated variables that have their warm up option on
        Returns:
      • variableAddedBeforeReplication

        protected abstract void variableAddedBeforeReplication​(Aggregatable variable)
        Sub-classes must implement this method to properly react to the subscription of a new variable to the aggregate. Note that the variable is already in the aggregate's list of variables when this method is invoked
        Parameters:
        variable - The variable that has been added to the aggregate
      • variableAddedDuringReplication

        protected abstract void variableAddedDuringReplication​(Aggregatable variable)
        Sub-classes must implement this method to properly react to the subscription of a new variable to the aggregate. Note that the variable is already in the aggregate's list of variables when this method is invoked
        Parameters:
        variable - The variable that has been added to the aggregate
      • variableRemovedBeforeReplication

        protected abstract void variableRemovedBeforeReplication​(Aggregatable variable)
        Sub-classes must implement this method to properly react to the removal of a variable from the aggregate. Note that the variable is no longer in the aggregate's list of variables when this method is invoked
        Parameters:
        variable - The variable that has been removed from the aggregate
      • variableRemovedDuringReplication

        protected abstract void variableRemovedDuringReplication​(Aggregatable variable)
        Sub-classes must implement this method to properly react to the removal of a variable from the aggregate. Note that the variable is no longer in the aggregate's list of variables when this method is invoked
        Parameters:
        variable - The variable that has been removed from the aggregate
      • valueChangedBeforeReplication

        protected abstract void valueChangedBeforeReplication​(Aggregatable variable)
        Sub-classes must implement this method to properly react to a change in the variable with respect to its form of aggregation
        Parameters:
        variable - The variable that has just changed
      • valueChangedDuringReplication

        protected abstract void valueChangedDuringReplication​(Aggregatable variable)
        Sub-classes must implement this method to properly react to a change in the variable with respect to its form of aggregation
        Parameters:
        variable - The variable that has just changed
      • initializeAggregate

        protected abstract void initializeAggregate()
        Sub-classes must implement this method to properly initialize the aggregate after all its variables have been initialized
      • warmUpAggregate

        protected abstract void warmUpAggregate()
        Sub-classes must implement this method to properly warm up the aggregate after all its variables have been warmed up
      • removedFromModel

        protected void removedFromModel​(Aggregatable variable)
        Sub-classes can implement this method to properly react to the removal from the model of the variable with respect to its form of aggregation.
        Parameters:
        variable - The variable that has just been removed from the model
      • initialized

        protected void initialized​(Aggregatable variable)
        Aggregatables to which the Aggregate is subscribed call this method when they are initialized
        Parameters:
        variable - The variable that has just been initialized
      • warmedUp

        protected void warmedUp​(Aggregatable variable)
        Aggregatables to which the Aggregate is subscribed call this method when they are warmed up
        Parameters:
        variable - The variable that has just been warmed up
      • 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 ModelElement
      • 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