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 Statistic
myAcrossRepStat
Statistic used to collect the across replication statistics on the final value of the counter during each replicationprotected 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 intervalsprotected 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.protected Counter
myCounter
The Counter that is being observedprotected Model
myModel
The 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 void
afterExperiment(ModelElement m, java.lang.Object arg)
protected void
afterReplication(ModelElement m, java.lang.Object arg)
protected void
beforeExperiment(ModelElement m, java.lang.Object arg)
protected void
beforeReplication(ModelElement m, java.lang.Object arg)
StatisticAccessorIfc
getAcrossReplicationStatistic()
Gets the statistics that have been accumulated across all replications for this counter.StatisticAccessorIfc
getAcrossRepTimedUpdateStatistic()
Returns a StatisticAccessorIfc for the statistics collected across timed update intervals across the replicationsStatisticAccessorIfc
getAcrossTimedUpdateStatistic()
Returns a StatisticAccessorIfc for the statistics collected across timed update intervals within a replication.protected void
initialize(ModelElement m, java.lang.Object arg)
protected void
removedFromModel(ModelElement m, java.lang.Object arg)
void
resetTimedUpdateStatistics()
Resets any statistics collected across the timed update intervals for within a replicationvoid
setAcrossReplicationStatisticName(java.lang.String name)
A convenience method to set the name of the underlying Statistic for tabulating across replication statisticsprotected void
timedUpdate(ModelElement m, java.lang.Object arg)
java.lang.String
toString()
protected void
warmUp(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:
toString
in classModelElementObserver
-
beforeExperiment
protected void beforeExperiment(ModelElement m, java.lang.Object arg)
- Overrides:
beforeExperiment
in classModelElementObserver
-
beforeReplication
protected void beforeReplication(ModelElement m, java.lang.Object arg)
- Overrides:
beforeReplication
in classModelElementObserver
-
initialize
protected void initialize(ModelElement m, java.lang.Object arg)
- Overrides:
initialize
in classModelElementObserver
-
warmUp
protected void warmUp(ModelElement m, java.lang.Object arg)
- Overrides:
warmUp
in classModelElementObserver
-
timedUpdate
protected void timedUpdate(ModelElement m, java.lang.Object arg)
- Overrides:
timedUpdate
in classModelElementObserver
-
afterReplication
protected void afterReplication(ModelElement m, java.lang.Object arg)
- Overrides:
afterReplication
in classModelElementObserver
-
afterExperiment
protected void afterExperiment(ModelElement m, java.lang.Object arg)
- Overrides:
afterExperiment
in classModelElementObserver
-
removedFromModel
protected void removedFromModel(ModelElement m, java.lang.Object arg)
- Overrides:
removedFromModel
in classModelElementObserver
-
-