Fairness
Class NodeMonitor

java.lang.Object
  extended by Fairness.NodeMonitor

public class NodeMonitor
extends java.lang.Object

NodeMonitor contains methods to measure statistical information in the simulation.


Nested Class Summary
static class NodeMonitor.Mark
          A Mark represents collected statistics from a period of a NodeMonitor's collection.
 
Constructor Summary
NodeMonitor()
          Creates an unnamed NodeMonitor.
NodeMonitor(java.lang.String name)
          Creates a NodeMonitor with a given name.
 
Method Summary
 java.util.List<NodeMonitor.Mark> getMarks()
          Returns a list of all marks created by mark().
 java.lang.String getName()
          Returns this monitor's name
 void mark()
          Saves currently accumulated statistics in a Mark and resets current statistics.
 void reportLost()
          Reports to the monitor that a packet was lost.
 void reportReceived()
          Reports to the monitor that a packet was received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeMonitor

public NodeMonitor()
Creates an unnamed NodeMonitor. Used only for testing.


NodeMonitor

public NodeMonitor(java.lang.String name)
Creates a NodeMonitor with a given name.

Parameters:
name - non-null String
Method Detail

getName

public java.lang.String getName()
Returns this monitor's name


reportReceived

public void reportReceived()
Reports to the monitor that a packet was received.


reportLost

public void reportLost()
Reports to the monitor that a packet was lost.


mark

public void mark()
Saves currently accumulated statistics in a Mark and resets current statistics.


getMarks

public java.util.List<NodeMonitor.Mark> getMarks()
Returns a list of all marks created by mark().

Returns:
non-null List of 0 or more NodeMonitor.Mark.