Package jsl.modeling.elements.variable
Class TimeWeighted
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.modeling.elements.variable.Aggregatable
-
- jsl.modeling.elements.variable.Variable
-
- jsl.modeling.elements.variable.ResponseVariable
-
- jsl.modeling.elements.variable.TimeWeighted
-
- All Implemented Interfaces:
AcrossReplicationStatisticIfc
,DefaultReportingOptionIfc
,GetInitialValueIfc
,GetPreviousTimeOfChangeIfc
,GetTimeOfChangeIfc
,GetWeightIfc
,InitialValueIfc
,ResponseStatisticsIfc
,SetInitialValueIfc
,SetValueIfc
,TimeWeightedIfc
,VariableIfc
,WithinReplicationStatisticIfc
,ObservableIfc
,GetNameIfc
,GetValueIfc
,IdentityIfc
,PreviousValueIfc
public class TimeWeighted extends ResponseVariable
-
-
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 inherited from class jsl.modeling.elements.variable.ResponseVariable
myAcrossIntervalResponse, myAcrossRepStats, myCountStopLimit, myDefaultReportingOption, myLastUpdateTime, myMaxResponse, myTimeOfWarmUp, myWithinIntervalStats, myWithinRepStats
-
Fields inherited from class jsl.modeling.elements.variable.Variable
myInitialValue, myLowerLimit, myNextValue, myPrevTimeOfChange, myPrevValue, myTimeOfChange, myUpperLimit, myValue, myVariableTraceTextReport, myWeight
-
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 TimeWeighted(ModelElement parent)
Creates a TimeWeighted with the given parent with initial value 0.0 over the range [Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY]TimeWeighted(ModelElement parent, double initialValue)
Creates a TimeWeighted with the given name and initial value over the range [Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY]TimeWeighted(ModelElement parent, double initialValue, double lowerLimit)
Creates a TimeWeighted with the initial value over the supplied range [lowerLimit, Double.POSITIVE_INFINITY]TimeWeighted(ModelElement parent, double initialValue, double lowerLimit, double upperLimit)
Creates a TimeWeighted with the initial value over the supplied range [lowerLimit, upperLimit]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]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]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]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]
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
collectStatistics()
void
decrement()
Decrements the value of the variable by 1 at the current time.void
decrement(double value)
Decrements the value of the variable by the amount supplied.void
increment()
Increments the value of the variable by 1 at the current time.void
increment(double value)
Increments the value of the variable by the amount supplied.protected void
initialize()
Initialize the value to the current value at this timeprotected void
replicationEnded()
Sets the value of the variable to the current value at the current time to collect state to end of replicationprotected void
setWeight()
Sets the weight, the current time - the time of the last changeprotected void
timedUpdate()
This method should be overridden by subclasses that need actions performed at each timed update event during each replication.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-
Methods inherited from class jsl.modeling.elements.variable.ResponseVariable
afterReplication, asString, beforeExperiment, beforeReplication, getAcrossIntervalResponse, getAcrossReplicationAverage, getAcrossReplicationStatistic, getCountStopLimit, getDefaultReportingOption, getValue, getWithinReplicationStatistic, removedFromModel, resetWithinReplicationStatistics, setCountBasedStopLimit, setDefaultReportingOption, setValue, turnOnAcrossReplicationMaxCollection, turnOnTimeIntervalCollection, turnOnTimeIntervalTrace, turnOnTimeIntervalTrace, turnOnTimeIntervalTrace, turnOnTimeIntervalTrace
-
Methods inherited from class jsl.modeling.elements.variable.Variable
assignInitialValue, assignValue, getInitialValue, getLowerLimit, getPreviousTimeOfChange, getPreviousValue, getSetValueUpdateNotificationFlag, getTimeOfChange, getUpperLimit, getWeight, setInitialValue, setTraceObserver, setValue, setValueUpdateNotificationFlag, turnOffTrace, turnOnTrace, turnOnTrace, turnOnTrace, turnOnTrace
-
Methods inherited from class jsl.modeling.elements.variable.Aggregatable
attachAggregate, detachAggregate, initialize_, notifyAggregatesOfInitialization, notifyAggregatesOfModelRemoval, notifyAggregatesOfValueChange, notifyAggregatesOfWarmUp, warmUp_
-
Methods inherited from class jsl.simulation.ModelElement
addObserver, addObserverToModelElements, afterExperiment, afterExperiment_, afterReplication_, beforeExperiment_, 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, 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_, 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_, toString, update, useControls, week
-
-
-
-
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 elementinitialValue
- 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 elementinitialValue
- The initial value of the variable.lowerLimit
- the lower limit on the range for the variable, must be < upperLimitname
- 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 elementinitialValue
- 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 elementinitialValue
- The initial value of the variable.lowerLimit
- the lower limit on the range for the variable, must be < upperLimitupperLimit
- 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 elementinitialValue
- The initial value of the variable. Must be within the range.lowerLimit
- the lower limit on the range for the variable, must be < upperLimitupperLimit
- the upper limit on the range for the variablename
- 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
-
collectStatistics
protected void collectStatistics()
- Overrides:
collectStatistics
in classResponseVariable
-
initialize
protected void initialize()
Initialize the value to the current value at this time- Overrides:
initialize
in classVariable
-
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 classResponseVariable
-
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 classResponseVariable
-
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 classResponseVariable
-
-