|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectScoreKeeper
public class ScoreKeeper
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 |
---|
public static ScoreKeeper getScoreKeeper()
public void reset() throws java.io.IOException
An exception will occur if this method is called before the Network object has been created!
java.io.IOException
public void sentUpdate()
public void reachabilitySample(int numReachable, int actualNumReachable, int nCorrect, int nActiveSamples) throws java.io.IOException
java.io.IOException
public double getScore()
(fraction correct) - (fraction incorrect) - OVERHEAD_WEIGHT*(update packets per timestep / (N*(N-1))where N is the number of nodes.
public double getReachableFraction()
public double getAvailableFraction()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |