Package jsl.modeling.elements.variable
Class AggregateTimeWeightedVariable
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.modeling.elements.variable.Aggregatable
-
- jsl.modeling.elements.variable.Aggregate
-
- jsl.modeling.elements.variable.AggregateTimeWeightedVariable
-
- All Implemented Interfaces:
DefaultReportingOptionIfc
,ObservableIfc
,GetNameIfc
,GetValueIfc
,IdentityIfc
,PreviousValueIfc
- Direct Known Subclasses:
AveragePerTimeWeightedVariable
public class AggregateTimeWeightedVariable extends Aggregate
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jsl.simulation.ModelElement
ModelElement.EventBuilderIfc<T>, ModelElement.EventScheduler<T>, ModelElement.ModelElementComparator, ModelElement.RequestBuilder, ModelElement.RequestDurationIfc, ModelElement.RequestTimeIfc, ModelElement.RequestUsingIfc, ModelElement.TimedUpdateEventAction, ModelElement.TimeUnitIfc<T>, ModelElement.WarmUpEventAction
-
-
Field Summary
Fields Modifier and Type Field Description protected TimeWeighted
myAggTW
This is used to remember the aggregate value when any of its aggregatable's change-
Fields inherited from class jsl.modeling.elements.variable.Aggregate
myNumInitialized, myNumWarmedUp, myVariables
-
Fields inherited from class jsl.modeling.elements.variable.Aggregatable
myAggregates
-
Fields inherited from class jsl.simulation.ModelElement
AFTER_EXPERIMENT, AFTER_REPLICATION, BEFORE_EXPERIMENT, BEFORE_REPLICATION, CONDITIONAL_ACTION_REGISTRATION, DEFAULT_TIMED_EVENT_PRIORITY, INITIALIZED, MONTE_CARLO, myAfterExperimentOption, myAfterReplicationOption, myBeforeExperimentOption, myBeforeReplicationOption, myInitializationOption, myLengthOfWarmUp, myModelElements, myMonteCarloOption, myObservableComponent, myReplicationEndedOption, myTimedUpdateActionListener, myTimedUpdateEvent, myTimedUpdateInterval, myTimedUpdateOption, myTimedUpdatePriority, myWarmUpActionListener, myWarmUpEvent, myWarmUpIndicator, myWarmUpOption, myWarmUpPriority, NONE, REMOVED_FROM_MODEL, REPLICATION_ENDED, TIME_UNIT_DAY, TIME_UNIT_HOUR, TIME_UNIT_MILLISECOND, TIME_UNIT_MINUTE, TIME_UNIT_SECOND, TIME_UNIT_WEEK, TIMED_UPDATE, UPDATE, WARMUP
-
-
Constructor Summary
Constructors Constructor Description AggregateTimeWeightedVariable(ModelElement parent)
AggregateTimeWeightedVariable(ModelElement parent, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addObserver(ObserverIfc observer)
Allows the adding (attaching) of an observer to the observableint
countObservers()
Returns how many observers are currently observing the observablevoid
deleteObserver(ObserverIfc observer)
Allows the deletion (removing) of an observer from the observablevoid
deleteObservers()
Deletes all the observers from the observableboolean
getDefaultReportingOption()
Returns the default reporting option.double
getInitialValue()
double
getPreviousValue()
Gets the previous number from the sequence of valuesdouble
getValue()
This method simply returns the value.WeightedStatisticIfc
getWithinReplicationStatistic()
protected void
initializeAggregate()
Sub-classes must implement this method to properly initialize the aggregate after all its variables have been initializedprotected void
removedFromModel()
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.void
setDefaultReportingOption(boolean flag)
Sets the default reporting option.void
turnOffTrace()
void
turnOnTrace()
void
turnOnTrace(boolean header)
void
turnOnTrace(java.lang.String fileName)
void
turnOnTrace(java.lang.String name, boolean header)
protected 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 aggregationprotected 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 aggregationprotected void
variableAddedBeforeReplication(Aggregatable variable)
Sub-classes must implement this method to properly react to the subscription of a new variable to the aggregate.protected void
variableAddedDuringReplication(Aggregatable variable)
Sub-classes must implement this method to properly react to the subscription of a new variable to the aggregate.protected void
variableRemovedBeforeReplication(Aggregatable variable)
Sub-classes must implement this method to properly react to the removal of a variable from the aggregate.protected void
variableRemovedDuringReplication(Aggregatable variable)
Sub-classes must implement this method to properly react to the removal of a variable from the aggregate.protected void
warmUpAggregate()
Sub-classes must implement this method to properly warm up the aggregate after all its variables have been warmed up-
Methods inherited from class jsl.modeling.elements.variable.Aggregate
afterReplication, avgValues, beforeExperiment, countNumToInitialize, countNumToWarmUp, initialized, removedFromModel, subscribeTo, sumValues, unsubscribeFrom, warmedUp
-
Methods inherited from class jsl.modeling.elements.variable.Aggregatable
attachAggregate, detachAggregate, initialize_, notifyAggregatesOfInitialization, notifyAggregatesOfModelRemoval, notifyAggregatesOfValueChange, notifyAggregatesOfWarmUp, warmUp_
-
Methods inherited from class jsl.simulation.ModelElement
addObserverToModelElements, afterExperiment, afterExperiment_, afterReplication_, asString, beforeExperiment_, beforeReplication, beforeReplication_, buildEventGenerator, cancelTimedUpdateEvent, cancelWarmUpEvent, changeParentModelElement, checkForAfterExperiment, checkForAfterReplication, checkForBeforeExperiment, checkForBeforeReplication, checkForConditionalActionRegistration, checkForInitialize, checkForMonteCarlo, checkForRemoveFromModel, checkForReplicationEnded, checkForTimedUpdate, checkForUpdate, checkForWarmUp, checkObserverState, checkWarmUpOption, clearModelElementObservers, contains, createEntity, createEntity, createQObject, day, deleteObserverFromModelElements, findModelElementWithWarmUpEvent, getAfterExperimentOption, getAfterReplicationOption, getAllCounters, getAllModelElements, getAllRandomElements, getAllResponseVariables, getAllVariables, getBeforeExperimentOption, getBeforeReplicationOption, getChildModelElementIterator, getCurrentReplicationNumber, getDefaultEntityType, getExecutive, getExperiment, getId, getInitializationOption, getInitializationOrderAsString, getLeftPreOrderTraversalCount, getLengthOfWarmUp, getModel, getModelElementCompartor, getModelElementsAsString, getModelElementsAsString, getModelElementsAsString, getMonteCarloOption, getName, getNumberOfModelElements, getObserverState, getParentModelElement, getPreviousObserverState, getReplicationEndedOption, getRightPreOrderTraversalCount, getSimulation, getSpatialModel, getStringLabel, getThisElementsCounters, getThisElementsModelElements, getThisElementsRandomVariables, getThisElementsResponseVariables, getThisElementsVariables, getTime, getTimedUpdateInterval, getTimedUpdateOption, getUpdateNotificationFlag, getVariable, getWarmUpEventTime, getWarmUpOption, hour, indent, initialize, isTimedUpdateEventScheduled, isWarmedUp, isWarmUpEventScheduled, isWarmUpScheduled, millisecond, minute, montecarlo, montecarlo_, notifyAfterExperimentObservers, notifyAfterReplicationObservers, notifyBeforeExperimentObservers, notifyBeforeReplicationObservers, notifyConditionalActionRegistrationObservers, notifyInitializationObservers, notifyMonteCarloObservers, notifyObservers, notifyObservers, notifyRemovingFromModelObservers, notifyReplicationEndedObservers, notifyTimedUpdateObservers, notifyUpdateObservers, notifyWarmUpObservers, registerConditionalActions, registerConditionalActions_, removeFromModel, replicationEnded, replicationEnded_, schedule, second, seize, setAfterExperimentOption, setAfterExperimentOptionForModelElements, setAfterReplicationOption, setAfterReplicationOptionForModelElements, setBeforeExperimentOption, setBeforeExperimentOptionForModelElements, setBeforeReplicationOption, setBeforeReplicationOptionForModelElements, setInitializationOption, setInitializationOptionForModelElements, setLengthOfWarmUp, setModel, setMonteCarloOption, setMonteCarloOptionForModelElements, setName, setObserverState, setParentModelElement, setReplicationEndedOption, setReplicationEndedOptionForModelElements, setSpatialModel, setStringLabel, setTimedUpdateInterval, setTimedUpdateOption, setTimedUpdateOptionForModelElements, setUpdateNotificationFlag, setWarmUpOption, setWarmUpOptionForModelElements, stopExecutive, stopExecutive, timedUpdate, timedUpdate_, toString, update, useControls, warmUp, week
-
-
-
-
Field Detail
-
myAggTW
protected TimeWeighted myAggTW
This is used to remember the aggregate value when any of its aggregatable's change
-
-
Constructor Detail
-
AggregateTimeWeightedVariable
public AggregateTimeWeightedVariable(ModelElement parent)
- Parameters:
parent
-
-
AggregateTimeWeightedVariable
public AggregateTimeWeightedVariable(ModelElement parent, java.lang.String name)
- Parameters:
parent
-name
-
-
-
Method Detail
-
addObserver
public void addObserver(ObserverIfc observer)
Description copied from interface:ObservableIfc
Allows the adding (attaching) of an observer to the observable- Specified by:
addObserver
in interfaceObservableIfc
- Overrides:
addObserver
in classModelElement
- Parameters:
observer
- the observer to attach
-
deleteObserver
public void deleteObserver(ObserverIfc observer)
Description copied from interface:ObservableIfc
Allows the deletion (removing) of an observer from the observable- Specified by:
deleteObserver
in interfaceObservableIfc
- Overrides:
deleteObserver
in classModelElement
- Parameters:
observer
- the observer to delete
-
deleteObservers
public void deleteObservers()
Description copied from interface:ObservableIfc
Deletes all the observers from the observable- Specified by:
deleteObservers
in interfaceObservableIfc
- Overrides:
deleteObservers
in classModelElement
-
countObservers
public int countObservers()
Description copied from interface:ObservableIfc
Returns how many observers are currently observing the observable- Specified by:
countObservers
in interfaceObservableIfc
- Overrides:
countObservers
in classModelElement
- Returns:
- number of observers
-
getDefaultReportingOption
public boolean getDefaultReportingOption()
Description copied from interface:DefaultReportingOptionIfc
Returns the default reporting option. True means that the response should appear on the default reports- Returns:
- See Also:
ResponseVariable.getDefaultReportingOption()
-
setDefaultReportingOption
public void setDefaultReportingOption(boolean flag)
Description copied from interface:DefaultReportingOptionIfc
Sets the default reporting option. True means the response will appear on default reports- Parameters:
flag
-- See Also:
ResponseVariable.setDefaultReportingOption(boolean)
-
getInitialValue
public final double getInitialValue()
-
getPreviousValue
public double getPreviousValue()
Description copied from interface:PreviousValueIfc
Gets the previous number from the sequence of values- Returns:
- See Also:
PreviousValueIfc.getPreviousValue()
-
getValue
public double getValue()
Description copied from interface:GetValueIfc
This method simply returns the value.- Returns:
- See Also:
ResponseVariable.getValue()
-
turnOnTrace
public final void turnOnTrace()
-
turnOnTrace
public final void turnOnTrace(boolean header)
-
turnOnTrace
public final void turnOnTrace(java.lang.String fileName)
-
turnOnTrace
public final void turnOnTrace(java.lang.String name, boolean header)
-
turnOffTrace
public final void turnOffTrace()
-
variableAddedBeforeReplication
protected void variableAddedBeforeReplication(Aggregatable variable)
Description copied from class:Aggregate
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- Specified by:
variableAddedBeforeReplication
in classAggregate
- Parameters:
variable
- The variable that has been added to the aggregate
-
variableAddedDuringReplication
protected void variableAddedDuringReplication(Aggregatable variable)
Description copied from class:Aggregate
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- Specified by:
variableAddedDuringReplication
in classAggregate
- Parameters:
variable
- The variable that has been added to the aggregate
-
variableRemovedBeforeReplication
protected void variableRemovedBeforeReplication(Aggregatable variable)
Description copied from class:Aggregate
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- Specified by:
variableRemovedBeforeReplication
in classAggregate
- Parameters:
variable
- The variable that has been removed from the aggregate
-
variableRemovedDuringReplication
protected void variableRemovedDuringReplication(Aggregatable variable)
Description copied from class:Aggregate
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- Specified by:
variableRemovedDuringReplication
in classAggregate
- Parameters:
variable
- The variable that has been removed from the aggregate
-
valueChangedBeforeReplication
protected void valueChangedBeforeReplication(Aggregatable variable)
Description copied from class:Aggregate
Sub-classes must implement this method to properly react to a change in the variable with respect to its form of aggregation- Specified by:
valueChangedBeforeReplication
in classAggregate
- Parameters:
variable
- The variable that has just changed
-
valueChangedDuringReplication
protected void valueChangedDuringReplication(Aggregatable variable)
Description copied from class:Aggregate
Sub-classes must implement this method to properly react to a change in the variable with respect to its form of aggregation- Specified by:
valueChangedDuringReplication
in classAggregate
- Parameters:
variable
- The variable that has just changed
-
initializeAggregate
protected void initializeAggregate()
Description copied from class:Aggregate
Sub-classes must implement this method to properly initialize the aggregate after all its variables have been initialized- Specified by:
initializeAggregate
in classAggregate
-
warmUpAggregate
protected void warmUpAggregate()
Description copied from class:Aggregate
Sub-classes must implement this method to properly warm up the aggregate after all its variables have been warmed up- Specified by:
warmUpAggregate
in classAggregate
-
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 classAggregatable
-
getWithinReplicationStatistic
public WeightedStatisticIfc getWithinReplicationStatistic()
-
-