public class StatisticsLogger
extends java.lang.Object
logRun()
method. The many getters
can be used to obtain statistics about the logged runs, such as success rate and average
fitness.
JCGP
uses this class to perform its logging and print out experiment data at the end.Constructor and Description |
---|
StatisticsLogger()
Create a new statistics logger, use this when resetting is necessary.
|
Modifier and Type | Method and Description |
---|---|
double |
getAverageActiveNodes()
Averages the number of active nodes in the
best chromosomes obtained across all runs.
|
double |
getAverageActiveNodesStdDev()
Calculates the standard deviation of
the number of active nodes in the best solution
in each run.
|
double |
getAverageFitness()
Averages the best fitness obtained in each run.
|
double |
getAverageFitnessStdDev()
Calculates the standard deviation of
the best fitness obtained in each run.
|
double |
getAverageGenerations()
Calculates the average generation out of all runs.
|
double |
getAverageGenerationsStdDev()
Calculates the standard deviation of
the average number of generations in
each run.
|
double |
getAverageSuccessfulGenerations()
Calculates the average generation out of successful runs only.
|
double |
getAverageSuccessfulGenerationsStdDev()
Calculates the standard deviation of
the average number of generations in
each run where a perfect solution was found.
|
double |
getHighestFitness() |
double |
getLowestFitness() |
int |
getSuccessfulRuns() |
double |
getSuccessRate()
Calculates the ratio of successful runs (runs where
a perfect solution was found) to total number of runs.
|
void |
logRun(int generation,
double fitness,
int active,
boolean successful)
Log a new run.
|
public StatisticsLogger()
public void logRun(int generation, double fitness, int active, boolean successful)
generation
- the last generation when improvement occurred.fitness
- the best fitness achieved in the run.active
- the number of active nodes in the best chromosome found.successful
- true if a perfect solution was found, false if otherwise.public double getAverageFitness()
public double getAverageFitnessStdDev()
public double getAverageActiveNodes()
public double getAverageActiveNodesStdDev()
public double getAverageGenerations()
getAverageSuccessfulGenerations
.public double getAverageGenerationsStdDev()
public double getHighestFitness()
public double getLowestFitness()
public int getSuccessfulRuns()
public double getSuccessRate()
public double getAverageSuccessfulGenerations()
public double getAverageSuccessfulGenerationsStdDev()