Package jsl.simulation
Class StatisticalBatchingElement
- java.lang.Object
-
- jsl.simulation.ModelElement
-
- jsl.simulation.StatisticalBatchingElement
-
- All Implemented Interfaces:
ObservableIfc
,GetNameIfc
,IdentityIfc
public class StatisticalBatchingElement extends ModelElement
When added to a Model, this class will cause batch statistics to be collected for ResponseVariables and TimeWeighted variables. It uses the TWBatchingElement and the ResponseVariableBatchingElement to perform this functionality. Time weighted variables are first discretized using a supplied batch interval. Then, observation based batching is applied to the discretized batches. Response variables are batched by observation number.
-
-
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.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 StatisticalBatchingElement(Model model)
Creates a StatisticalBatchingElement using the default discretizing interval defined in TWBatchingElementStatisticalBatchingElement(Model model, double batchInterval)
Creates a StatisticalBatchingElementStatisticalBatchingElement(Model model, double batchInterval, java.lang.String name)
Creates a StatisticalBatchingElement
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString()
Allows sub-classes to provide more detail than toString() to represent the ModelElement as a Stringprotected void
beforeExperiment()
This method should be overridden by subclasses that need logic to be performed prior to an experiment.java.util.List<BatchStatistic>
getAllBatchStatistcs()
Returns a list of summary statistics on all ResponseVariable variables The list is a copy of originals.java.util.Map<ResponseVariable,BatchStatistic>
getAllResponseVariableBatchStatisticsAsMap()
java.util.List<StatisticAccessorIfc>
getAllStatistics()
Returns a list of the batch statistics in the form of StatisticAccessorIfcjava.util.Map<TimeWeighted,BatchStatistic>
getAllTimeWeightedBatchStatisticsAsMap()
BatchStatistic
getBatchStatistic(ResponseVariable r)
Returns a statistical summary BatchStatistic on the ResponseVariable variable across the observed batches This returns a copy of the summary statistics.BatchStatisticObserver
getBatchStatisticObserver(ResponseVariable key)
Look up the BatchStatisticObserver for the ResponseVariableStatisticReporter
getStatisticReporter()
Returns a StatisticReporter for reporting the statistics across the batches.void
remove(ResponseVariable r)
Removes the supplied ResponseVariable variable from the batchingvoid
removeAll()
Removes all previously added ResponseVariable from the batching-
Methods inherited from class jsl.simulation.ModelElement
addObserver, addObserverToModelElements, afterExperiment, afterExperiment_, afterReplication, afterReplication_, 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, 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_, removedFromModel, 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, warmUp_, week
-
-
-
-
Constructor Detail
-
StatisticalBatchingElement
public StatisticalBatchingElement(Model model)
Creates a StatisticalBatchingElement using the default discretizing interval defined in TWBatchingElement- Parameters:
model
- the model for the batching
-
StatisticalBatchingElement
public StatisticalBatchingElement(Model model, double batchInterval)
Creates a StatisticalBatchingElement- Parameters:
model
- the model for the batchingbatchInterval
- the discretizing interval for TimeWeighted variables
-
StatisticalBatchingElement
public StatisticalBatchingElement(Model model, double batchInterval, java.lang.String name)
Creates a StatisticalBatchingElement- Parameters:
model
- the model for the batchingbatchInterval
- the discretizing interval for TimeWeighted variablesname
- the name of the model element
-
-
Method Detail
-
getAllResponseVariableBatchStatisticsAsMap
public final java.util.Map<ResponseVariable,BatchStatistic> getAllResponseVariableBatchStatisticsAsMap()
- Returns:
- a map of all batch statistics with the ResponseVariable variable as the key
-
getAllTimeWeightedBatchStatisticsAsMap
public final java.util.Map<TimeWeighted,BatchStatistic> getAllTimeWeightedBatchStatisticsAsMap()
- Returns:
- a map of all batch statistics with the TimeWeighted variable as the key
-
getBatchStatisticObserver
public final BatchStatisticObserver getBatchStatisticObserver(ResponseVariable key)
Look up the BatchStatisticObserver for the ResponseVariable- Parameters:
key
- the ResponseVariable to look up- Returns:
- the BatchStatisticObserver
-
remove
public final void remove(ResponseVariable r)
Removes the supplied ResponseVariable variable from the batching- Parameters:
r
- the ResponseVariable to be removed
-
removeAll
public final void removeAll()
Removes all previously added ResponseVariable from the batching
-
getBatchStatistic
public final BatchStatistic getBatchStatistic(ResponseVariable r)
Returns a statistical summary BatchStatistic on the ResponseVariable variable across the observed batches This returns a copy of the summary statistics.- Parameters:
r
- the ResponseVariable to look up- Returns:
- the returned BatchStatistic
-
getAllBatchStatistcs
public final java.util.List<BatchStatistic> getAllBatchStatistcs()
Returns a list of summary statistics on all ResponseVariable variables The list is a copy of originals.- Returns:
- the filled up list
-
getAllStatistics
public final java.util.List<StatisticAccessorIfc> getAllStatistics()
Returns a list of the batch statistics in the form of StatisticAccessorIfc- Returns:
- the list
-
getStatisticReporter
public final StatisticReporter getStatisticReporter()
Returns a StatisticReporter for reporting the statistics across the batches.- Returns:
- the reporter
-
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 classModelElement
-
asString
public java.lang.String asString()
Description copied from class:ModelElement
Allows sub-classes to provide more detail than toString() to represent the ModelElement as a String- Overrides:
asString
in classModelElement
- Returns:
- a detailed String representation
-
-