anthill.antsim
Interface Stats
- All Superinterfaces:
- Clearable
- All Known Implementing Classes:
- StatsImpl
- public interface Stats
- extends Clearable
The Stats
interface enables programmers to collect
information about events occurring during a simulation. In particular,
this class may be used to count the occurrence of events. Each event
is identified by a string name chosen by the programmer and is associated
to a counter. The value of the counter may be incremented by one by
invoking method inc()
; the same value may be read by invoking
method get()
. Additionally, a counter may be incremented by a
arbitrary value using method add()
.
Method Summary |
void |
add(java.lang.String name,
float addend)
Increment the value of the counter identified by name by
value addend . |
float |
get(java.lang.String name)
Return the value of the counter identified by name |
void |
inc(java.lang.String name)
Increment by 1 the value of the counter identified by name . |
inc
public void inc(java.lang.String name)
- Increment by 1 the value of the counter identified by
name
.
add
public void add(java.lang.String name,
float addend)
- Increment the value of the counter identified by
name
by
value addend
.
get
public float get(java.lang.String name)
- Return the value of the counter identified by
name