Class ScoreKeeper

java.lang.Object
  extended by ScoreKeeper

public class ScoreKeeper
extends java.lang.Object

This class keeps track of scoring for the run. The score is the average (per time step) of:

  sum over all router table entries, everywhere of
    entries that correctly indicate a next hop that leads to the dest
    plus entries that say don't forward and no path exists
    minus entries that say forward but don't lead to the destination
    minus entries that say don't forward but a path exists
    minus (#update packets sent / (N*(N-1))
 
where N is the number of nodes in the network.

It also keeps track of 'reachability,' defined as the fraction of all (src,dst) pairs for which a path exists in the actual network that are reachable using the router tables. (That is, if a (src,dst) pair isn't reachable in the network, it doesn't count against this measure.)

Finally, it keeps track of 'availability,' which is simply the fraction of all (src,dst) pairs that are reachable through the routing tables. (This measure vaguely reflects the user experience - how much trouble is caused by the combination of actual network partitions plus the fact that routing tables are inaccurate.)


Method Summary
 double getAvailableFraction()
          Get average fration of N*(N-1) pairs that can communicate.
 double getReachableFraction()
          Get average fraction of reachable pairs reachable through routing tables.
 double getScore()
          Get current score.
static ScoreKeeper getScoreKeeper()
          There can be only one ScoreKeeper object in a run.
 void reachabilitySample(int numReachable, int actualNumReachable, int nCorrect, int nActiveSamples)
          Inform scorekeeper about reachability of a time step.
 void reset()
          Reset all acculated statistics to zero.
 void sentUpdate()
          Inform scorekeeper that an update packet is being sent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getScoreKeeper

public static ScoreKeeper getScoreKeeper()
There can be only one ScoreKeeper object in a run. Get it...


reset

public void reset()
           throws java.io.IOException
Reset all acculated statistics to zero.

An exception will occur if this method is called before the Network object has been created!

Throws:
java.io.IOException

sentUpdate

public void sentUpdate()
Inform scorekeeper that an update packet is being sent.


reachabilitySample

public void reachabilitySample(int numReachable,
                               int actualNumReachable,
                               int nCorrect,
                               int nActiveSamples)
                        throws java.io.IOException
Inform scorekeeper about reachability of a time step.

Throws:
java.io.IOException

getScore

public double getScore()
Get current score. The score is (simplifying slightly)
   (fraction correct) - (fraction incorrect) - OVERHEAD_WEIGHT*(update packets per timestep / (N*(N-1))
 
where N is the number of nodes.


getReachableFraction

public double getReachableFraction()
Get average fraction of reachable pairs reachable through routing tables.


getAvailableFraction

public double getAvailableFraction()
Get average fration of N*(N-1) pairs that can communicate.