Package jsl.modeling.elements.variable
Class Aggregatable
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.modeling.elements.variable.Aggregatable
-
- All Implemented Interfaces:
ObservableIfc
,GetNameIfc
,GetValueIfc
,IdentityIfc
,PreviousValueIfc
public abstract class Aggregatable extends ModelElement implements GetValueIfc, PreviousValueIfc
This class represents something that can be aggregated.
-
-
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 java.util.List<Aggregate>
myAggregates
The aggregatable's list of aggregates.-
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 Aggregatable(ModelElement parent)
Aggregatable(ModelElement parent, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
attachAggregate(Aggregate aggregate)
This method is called by Aggregate to register itself as an aggregate for this variable, when it is told to observe the variableprotected void
detachAggregate(Aggregate aggregate)
This method is called by Aggregate to unregister itself as an aggregate for this variable, when it is told to stop observing the variableprotected void
initialize_()
The initialize_ method allows model elements to be initialized to a standard reactor defined state.protected void
notifyAggregatesOfInitialization()
Notifies any aggregates that initialization has occurred.protected void
notifyAggregatesOfModelRemoval()
Notifies any aggregates that the element has been removed from the modelprotected void
notifyAggregatesOfValueChange()
Notifies any aggregates that its value has changedprotected void
notifyAggregatesOfWarmUp()
Notifies any aggregates that warm up has occurred.protected 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.protected void
warmUp_()
The warmUp_ method is called once during each replication.-
Methods inherited from class jsl.simulation.ModelElement
addObserver, addObserverToModelElements, afterExperiment, afterExperiment_, afterReplication, afterReplication_, asString, beforeExperiment, beforeExperiment_, beforeReplication, beforeReplication_, buildEventGenerator, cancelTimedUpdateEvent, cancelWarmUpEvent, changeParentModelElement, checkForAfterExperiment, checkForAfterReplication, checkForBeforeExperiment, checkForBeforeReplication, checkForConditionalActionRegistration, checkForInitialize, checkForMonteCarlo, checkForRemoveFromModel, checkForReplicationEnded, checkForTimedUpdate, checkForUpdate, checkForWarmUp, checkObserverState, checkWarmUpOption, clearModelElementObservers, contains, countObservers, createEntity, createEntity, createQObject, day, deleteObserver, deleteObserverFromModelElements, deleteObservers, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jsl.utilities.GetValueIfc
getValue
-
Methods inherited from interface jsl.utilities.PreviousValueIfc
getPreviousValue
-
-
-
-
Field Detail
-
myAggregates
protected java.util.List<Aggregate> myAggregates
The aggregatable's list of aggregates. An aggregate can be formed from aggregatables and react to changes in the aggregatables. Lazy initialization is used for this list. No list is created until the aggregatable is added to an aggregate.
-
-
Constructor Detail
-
Aggregatable
public Aggregatable(ModelElement parent)
- Parameters:
parent
-
-
Aggregatable
public Aggregatable(ModelElement parent, java.lang.String name)
- Parameters:
parent
-name
-
-
-
Method Detail
-
attachAggregate
protected void attachAggregate(Aggregate aggregate)
This method is called by Aggregate to register itself as an aggregate for this variable, when it is told to observe the variable- Parameters:
aggregate
- the aggregate to attach
-
detachAggregate
protected void detachAggregate(Aggregate aggregate)
This method is called by Aggregate to unregister itself as an aggregate for this variable, when it is told to stop observing the variable- Parameters:
aggregate
- the aggregate to detach
-
removedFromModel
protected 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.- Overrides:
removedFromModel
in classModelElement
-
notifyAggregatesOfInitialization
protected void notifyAggregatesOfInitialization()
Notifies any aggregates that initialization has occurred.
-
notifyAggregatesOfWarmUp
protected void notifyAggregatesOfWarmUp()
Notifies any aggregates that warm up has occurred.
-
notifyAggregatesOfValueChange
protected void notifyAggregatesOfValueChange()
Notifies any aggregates that its value has changed
-
notifyAggregatesOfModelRemoval
protected void notifyAggregatesOfModelRemoval()
Notifies any aggregates that the element has been removed from the model
-
initialize_
protected void initialize_()
Description copied from class:ModelElement
The initialize_ method allows model elements to be initialized to a standard reactor defined state. It is called by default before each replicationThis method ensures that each contained model element has its initialize method called and that any observers will be notified of this action
- Overrides:
initialize_
in classModelElement
-
warmUp_
protected void warmUp_()
Description copied from class:ModelElement
The warmUp_ method is called once during each replication. This method ensures that each contained model element that requires a warm up action will performs its actions.- Overrides:
warmUp_
in classModelElement
-
-