|
MATES 3.0-rc2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mates.sim.Experiment
org.mates.plugins.StatisticsPlugin
A plugin experiment for keeping track of statistics (mostly about the topology).
Field Summary |
Fields inherited from class org.mates.sim.Experiment |
parent, simulator |
Constructor Summary | |
StatisticsPlugin(Experiment parent)
|
Method Summary | |
int[] |
getAverageDegreeDistribution()
Returns the average degree distribution of the topology. |
double |
getAverageHostDegree()
Returns the average neighborhood size of each host thus far in the simulation. |
double |
getAverageTopologyDensity()
Returns the average density of the topology. |
double |
getAverageTopologyDiameter()
Returns the average neighborhood size of each host thus far in the simulation. |
java.awt.Component |
getGUI()
Returns the GUI component associated with this experiment. |
protected void |
handleInitialize()
Callback function for initializing the experiment. |
protected void |
handleIterate()
Callback function for iterating the experiment. |
protected void |
handleReset()
Callback function for resetting the experiment. |
void |
paintAverageDegreeDistribution(java.awt.Graphics graphics,
int width,
int height)
Draws the current topology's average degree distribution as a bar graph. |
void |
paintDegreeDistribution(java.awt.Graphics graphics,
int width,
int height)
Draws the current topology's degree distribution as a bar graph. |
static void |
paintDegreeDistribution(java.awt.Graphics graphics,
int width,
int height,
Topology topology)
Draws a topology's degree distribution as a bar graph. |
static void |
paintDistribution(java.awt.Graphics graphics,
int width,
int height,
int[] dist)
Draws a distribution as a bar graph. |
void |
resetAverageDegreeDistribution()
Resets the average degree distribution. |
void |
resetAverageHostDegree()
Resets the average host degree statistic counters. |
void |
resetAverageTopologyDensity()
Resets the average topology density statistic counters. |
void |
resetAverageTopologyDiameter()
Resets the average topology diameter statistic counters. |
boolean |
saveAverageDegreeDistribution(java.io.File file,
int width,
int height)
Saves the current topology's average degree distribution to an image file. |
boolean |
saveDegreeDistribution(java.io.File file,
int width,
int height)
Saves the current topology's degree distribution to an image file. |
static boolean |
saveDegreeDistribution(java.io.File file,
int width,
int height,
Topology topology)
Saves a topology's degree distribution to an image file. |
Methods inherited from class org.mates.sim.Experiment |
complete, getMenuItems, getParentExperiment, getSimulator, getSubExperiments, handleMenuAction, initialize, iterate, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StatisticsPlugin(Experiment parent)
Method Detail |
protected void handleInitialize()
Experiment
super.handleInitialize()
need not be called from
re-implementations of this function.
handleInitialize
in class Experiment
protected void handleIterate()
Experiment
super.handleIterate()
need not be called from
re-implementations of this function.
handleIterate
in class Experiment
protected void handleReset()
Experiment
super.handleReset()
need not be called from
re-implementations of this function.
handleReset
in class Experiment
public boolean saveAverageDegreeDistribution(java.io.File file, int width, int height) throws java.io.IOException, java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
- when writing to an EPS file and
org.jibble.epsgraphics.EpsGraphics2D
cannot be found.
java.io.IOException
- on error writing to file
.Screenshot.saveScreenshot(Object, int, int, java.io.File)
public boolean saveDegreeDistribution(java.io.File file, int width, int height) throws java.io.IOException, java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
- when writing to an EPS file and
org.jibble.epsgraphics.EpsGraphics2D
cannot be found.
java.io.IOException
- on error writing to file
.Screenshot.saveScreenshot(Object, int, int, java.io.File)
public static boolean saveDegreeDistribution(java.io.File file, int width, int height, Topology topology) throws java.io.IOException, java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
- when writing to an EPS file and
org.jibble.epsgraphics.EpsGraphics2D
cannot be found.
java.io.IOException
- on error writing to file
.Screenshot.saveScreenshot(Object, int, int, java.io.File)
public void paintAverageDegreeDistribution(java.awt.Graphics graphics, int width, int height)
public void paintDegreeDistribution(java.awt.Graphics graphics, int width, int height)
public static void paintDegreeDistribution(java.awt.Graphics graphics, int width, int height, Topology topology)
public static void paintDistribution(java.awt.Graphics graphics, int width, int height, int[] dist)
public void resetAverageHostDegree()
public void resetAverageTopologyDensity()
public void resetAverageTopologyDiameter()
public void resetAverageDegreeDistribution()
public double getAverageTopologyDensity()
[0, 1]
.
public double getAverageTopologyDiameter()
public double getAverageHostDegree()
public int[] getAverageDegreeDistribution()
null
.
Topology.getDegreeDistribution()
public java.awt.Component getGUI()
Experiment
GraphicalUserInterface
is used.
This function defaults to return null
.
getGUI()
is intended for child classes that extend
Experiment
to re-implement this function and
return a GUI object.
getGUI
in class Experiment
|
MATES 3.0-rc2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |