public class StatKeeper extends java.lang.Object implements java.lang.Comparable<StatKeeper>
Constructor and Description |
---|
StatKeeper() |
StatKeeper(boolean recordValues,
java.lang.String statName,
java.lang.String valuename,
boolean isDisplayed)
Creates a new StatKeeper object.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double x) |
void |
clear()
Removes all data from this StatKeeper
|
int |
compareTo(StatKeeper o) |
int |
elementNumber()
Returns the number of elements
|
double |
getElement(int e)
Returns the given element from the series
|
double |
getMax() |
double |
getMin() |
java.lang.String |
getStatName() |
java.util.ArrayList<java.lang.Double> |
getValues() |
java.lang.String |
getValuesName() |
boolean |
isDisplayed()
Returns true if this statistics should be displayed.
|
double |
mean()
Returns the mean value of the contained data.
|
java.lang.String |
result(boolean wHitrate) |
static void |
saveNotableStats(java.lang.String filename,
java.util.ArrayList<StatKeeper> statList) |
static void |
saveNotableStats(java.lang.String filename,
java.util.ArrayList<StatKeeper> statList,
boolean addStatColumns) |
static void |
saveRboxFile(java.lang.String filename,
java.util.ArrayList<StatKeeper> statList,
int step)
Creates a text file in a format to be read by the statistical program R
the stat with the generation count is omitted
|
void |
saveResults(java.lang.String intendedFilename)
Saves the current statistic into a file
|
double |
sdev()
Returns the standard deviation of the contained data.
|
static void |
showValuation()
Calculates the valuation of a simulation (which may consist of more than
one run) and outputs it on the console.
|
public StatKeeper()
public StatKeeper(boolean recordValues, java.lang.String statName, java.lang.String valuename, boolean isDisplayed)
recordValues
- defines if values should be recorded, otherwise just a
statistic of min, max, mean, sdev is keptstatName
- gives the value a name which is used for labeling the columns
in the exported csvisDisplayed
- if true, this stat is added to a list of notable stats which
can be exported to a csv togetherpublic int elementNumber()
public double getElement(int e)
public void add(double x)
public double mean()
public double sdev()
public void clear()
public java.lang.String result(boolean wHitrate)
public void saveResults(java.lang.String intendedFilename)
intendedFilename
- , the filename might be changed if the file is busypublic static void saveNotableStats(java.lang.String filename, java.util.ArrayList<StatKeeper> statList)
public static void saveNotableStats(java.lang.String filename, java.util.ArrayList<StatKeeper> statList, boolean addStatColumns)
public static void saveRboxFile(java.lang.String filename, java.util.ArrayList<StatKeeper> statList, int step)
filename
- filename and path of the file to be createdstatList
- an ArrayList of statkeeper objectsstep
- only every step-th generation is saved, this is useful to keep
a comprehensible boxplotpublic static void showValuation()
public int compareTo(StatKeeper o)
compareTo
in interface java.lang.Comparable<StatKeeper>
public java.lang.String getStatName()
public java.lang.String getValuesName()
public double getMin()
public double getMax()
public boolean isDisplayed()
public java.util.ArrayList<java.lang.Double> getValues()