Package jsl.observers.variable
Class CounterObserver
- java.lang.Object
-
- jsl.observers.ModelElementObserver
-
- jsl.observers.variable.CounterObserver
-
- All Implemented Interfaces:
ObserverIfc,GetNameIfc,IdentityIfc
public class CounterObserver extends ModelElementObserver
-
-
Field Summary
Fields Modifier and Type Field Description protected StatisticmyAcrossRepStatStatistic used to collect the across replication statistics on the final value of the counter during each replicationprotected StatisticmyAcrossRepTimedUpdateStatisticIf the timed update statistics are collected during a replication This Statistic will be used to collect the average across the averages over the update intervalsprotected StatisticmyAcrossTimedUpdateStatisticA Counter can have a timed update action during a replication This Statistic collects the average of the total count during each timed update interval.protected CountermyCounterThe Counter that is being observedprotected ModelmyModelThe Model that holds the Counter being observed-
Fields inherited from class jsl.observers.ModelElementObserver
myName
-
-
Constructor Summary
Constructors Constructor Description CounterObserver()CounterObserver(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterExperiment(ModelElement m, java.lang.Object arg)protected voidafterReplication(ModelElement m, java.lang.Object arg)protected voidbeforeExperiment(ModelElement m, java.lang.Object arg)protected voidbeforeReplication(ModelElement m, java.lang.Object arg)StatisticAccessorIfcgetAcrossReplicationStatistic()Gets the statistics that have been accumulated across all replications for this counter.StatisticAccessorIfcgetAcrossRepTimedUpdateStatistic()Returns a StatisticAccessorIfc for the statistics collected across timed update intervals across the replicationsStatisticAccessorIfcgetAcrossTimedUpdateStatistic()Returns a StatisticAccessorIfc for the statistics collected across timed update intervals within a replication.protected voidinitialize(ModelElement m, java.lang.Object arg)protected voidremovedFromModel(ModelElement m, java.lang.Object arg)voidresetTimedUpdateStatistics()Resets any statistics collected across the timed update intervals for within a replicationvoidsetAcrossReplicationStatisticName(java.lang.String name)A convenience method to set the name of the underlying Statistic for tabulating across replication statisticsprotected voidtimedUpdate(ModelElement m, java.lang.Object arg)java.lang.StringtoString()protected voidwarmUp(ModelElement m, java.lang.Object arg)-
Methods inherited from class jsl.observers.ModelElementObserver
getId, getModelElement, getName, montecarlo, replicationEnded, setModelElement, setName, update, update
-
-
-
-
Field Detail
-
myCounter
protected Counter myCounter
The Counter that is being observed
-
myModel
protected Model myModel
The Model that holds the Counter being observed
-
myAcrossRepStat
protected Statistic myAcrossRepStat
Statistic used to collect the across replication statistics on the final value of the counter during each replication
-
myAcrossTimedUpdateStatistic
protected Statistic myAcrossTimedUpdateStatistic
A Counter can have a timed update action during a replication This Statistic collects the average of the total count during each timed update interval. For example, a timed update interval of 1 hour can be set. Each hour this statistic will observe the count for that hour and collect averages across the timede update intervals
-
myAcrossRepTimedUpdateStatistic
protected Statistic myAcrossRepTimedUpdateStatistic
If the timed update statistics are collected during a replication This Statistic will be used to collect the average across the averages over the update intervals
-
-
Method Detail
-
resetTimedUpdateStatistics
public final void resetTimedUpdateStatistics()
Resets any statistics collected across the timed update intervals for within a replication
-
getAcrossTimedUpdateStatistic
public final StatisticAccessorIfc getAcrossTimedUpdateStatistic()
Returns a StatisticAccessorIfc for the statistics collected across timed update intervals within a replication.- Returns:
- Returns the statistic
-
getAcrossRepTimedUpdateStatistic
public final StatisticAccessorIfc getAcrossRepTimedUpdateStatistic()
Returns a StatisticAccessorIfc for the statistics collected across timed update intervals across the replications- Returns:
- Returns the statistic
-
getAcrossReplicationStatistic
public final StatisticAccessorIfc getAcrossReplicationStatistic()
Gets the statistics that have been accumulated across all replications for this counter.- Returns:
- A StatisticAccessorIfc representing the across replication statistics.
-
setAcrossReplicationStatisticName
public void setAcrossReplicationStatisticName(java.lang.String name)
A convenience method to set the name of the underlying Statistic for tabulating across replication statistics- Parameters:
name- the name
-
toString
public java.lang.String toString()
- Overrides:
toStringin classModelElementObserver
-
beforeExperiment
protected void beforeExperiment(ModelElement m, java.lang.Object arg)
- Overrides:
beforeExperimentin classModelElementObserver
-
beforeReplication
protected void beforeReplication(ModelElement m, java.lang.Object arg)
- Overrides:
beforeReplicationin classModelElementObserver
-
initialize
protected void initialize(ModelElement m, java.lang.Object arg)
- Overrides:
initializein classModelElementObserver
-
warmUp
protected void warmUp(ModelElement m, java.lang.Object arg)
- Overrides:
warmUpin classModelElementObserver
-
timedUpdate
protected void timedUpdate(ModelElement m, java.lang.Object arg)
- Overrides:
timedUpdatein classModelElementObserver
-
afterReplication
protected void afterReplication(ModelElement m, java.lang.Object arg)
- Overrides:
afterReplicationin classModelElementObserver
-
afterExperiment
protected void afterExperiment(ModelElement m, java.lang.Object arg)
- Overrides:
afterExperimentin classModelElementObserver
-
removedFromModel
protected void removedFromModel(ModelElement m, java.lang.Object arg)
- Overrides:
removedFromModelin classModelElementObserver
-
-