Syntax:
CLRSTAT;It is used to reset to zero the variables in which the statistics are accumulated. Thus the statistics are counted since the last time in which a procedure of this type is executed. That time is recorded in the standard statistics.
This procedure can be used in nodes of any type.
Examples:
PassTrans (A) :: IT := 1000; IF ABS(Qma - MEDL(EL_Tell)) / (0.5 * (Qma + MEDL(EL_Tell))) < 0.03 THEN BEGIN Stable := TRUE; CLRSTAT; BLOCK(PassTrans) END ELSE BEGIN Qma := MEDL(EL_Tell); CLRSTAT; END; ------------------------------------------------- INIT TSIM := 24000; ACT(PassTrans, 200); Qma := 0; Stable := FALSE;At intervals of 1000 time units, the queue
EL_Tell
is examined.
The previous mean length Qma
is compared with the mean length
in the last 1000 time units. This is given by the GLIDER function
MEDL. If the difference, compared with the mean of the two values,
is less than 3%, the queue is considered stable, a new count of
statistics begin, and the node is blocked. Otherwise, the last
value of the mean is saved in Qma
, and a new statistical count
is initialized for the next 1000 time units. Statistics at the
end of the run are counted since the beginning of the stable situation.
This procedure tries to avoid the influence on statistics of the
transient produced when starting with a void queue.