Util.Statistics
Class StatCatcher

java.lang.Object
  extended by Util.Statistics.StatCatcher

public class StatCatcher
extends java.lang.Object

Stores statistics from the population;

Author:
Blip

Field Summary
protected  java.util.ArrayList<java.util.ArrayList<java.lang.Double>> allFitness
           
protected  java.util.ArrayList<java.lang.Double> aveLength
           
protected  java.util.ArrayList<java.lang.Double> bestFitness
           
protected  java.util.ArrayList<Individual> bestIndividualOfGeneration
           
protected  java.util.ArrayList<java.lang.Integer> invalids
           
protected  java.util.ArrayList<java.lang.Integer> maxLength
           
protected  java.util.ArrayList<java.lang.Double> meanDerivationTreeDepth
           
protected  java.util.ArrayList<java.lang.Double> meanFitness
           
protected  java.util.ArrayList<java.lang.Double> meanUsedGenes
           
protected  java.util.ArrayList<java.lang.Integer> minLength
           
protected  java.util.ArrayList<java.lang.Long> time
           
protected  java.util.ArrayList<java.lang.Double> varFitness
           
protected  java.util.ArrayList<java.lang.Double> varLength
           
 
Constructor Summary
StatCatcher()
          Creates a new instance of StatCatcher
StatCatcher(int gen)
          New instance
 
Method Summary
 void addLength(java.util.ArrayList<java.lang.Integer> popLength)
          Add length data
 void addMeanDerivationTreeDepth(Fitness[] mG)
          Add mean depth of the derivation trees in the population
 void addMeanUsedGenes(Fitness[] mG)
          Add mean used genes
 void addStats(Fitness[] popFitness)
          Add stats.
 void addStatsPop(java.util.ArrayList<Individual> population)
          Add population to the statcatcher to work with.
 void addTime(java.lang.Long t)
          Add time
 void clear()
          Clear the structures in the class
 java.util.ArrayList<java.util.ArrayList<java.lang.Double>> getAllFitness()
          Get all fitness stored
 java.util.ArrayList<java.lang.Double> getAveLength()
          Get the average length
 java.util.ArrayList<java.lang.Double> getBestFitness()
          Get best fitness
 Individual getBestIndividualOfGeneration()
          Get best individual of generation
 java.util.ArrayList<Individual> getBestIndividualOfGenerations()
          Get best individuals of all generations
 double getCurrentBestFitness()
          Get the best fitness for the latest generation
 double getCurrentMean()
          Get mean for the latest generation
 double getCurrentMeanUsedGenes()
          Get the mean used genes for the latest generation
 java.util.ArrayList<java.lang.Integer> getInvalids()
          Get number of invalid individuals
 java.util.ArrayList<java.lang.Integer> getMaxLength()
          Get max length
 java.util.ArrayList<java.lang.Double> getMeanDerivationTreeDepth()
          Get the mean max depth of the derivation trees in the population
 java.util.ArrayList<java.lang.Double> getMeanFitness()
          Get mean fitness of the population
 java.util.ArrayList<java.lang.Double> getMeanUsedGenes()
          Get mean used genes
 java.util.ArrayList<java.lang.Integer> getMinLength()
          Get min length
 java.util.ArrayList<java.lang.Long> getTime()
          Get the time for execution of a generation
 java.util.ArrayList<java.lang.Double> getVarFitness()
          Get variance of the fitness in the population
 java.util.ArrayList<java.lang.Double> getVarLength()
          Get variance of the lengths in the population
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

meanFitness

protected java.util.ArrayList<java.lang.Double> meanFitness

bestFitness

protected java.util.ArrayList<java.lang.Double> bestFitness

varFitness

protected java.util.ArrayList<java.lang.Double> varFitness

minLength

protected java.util.ArrayList<java.lang.Integer> minLength

maxLength

protected java.util.ArrayList<java.lang.Integer> maxLength

aveLength

protected java.util.ArrayList<java.lang.Double> aveLength

varLength

protected java.util.ArrayList<java.lang.Double> varLength

meanUsedGenes

protected java.util.ArrayList<java.lang.Double> meanUsedGenes

meanDerivationTreeDepth

protected java.util.ArrayList<java.lang.Double> meanDerivationTreeDepth

time

protected java.util.ArrayList<java.lang.Long> time

invalids

protected java.util.ArrayList<java.lang.Integer> invalids

allFitness

protected java.util.ArrayList<java.util.ArrayList<java.lang.Double>> allFitness

bestIndividualOfGeneration

protected java.util.ArrayList<Individual> bestIndividualOfGeneration
Constructor Detail

StatCatcher

public StatCatcher()
Creates a new instance of StatCatcher


StatCatcher

public StatCatcher(int gen)
New instance

Parameters:
gen - number of generations
Method Detail

clear

public void clear()
Clear the structures in the class


addTime

public void addTime(java.lang.Long t)
Add time

Parameters:
t - time

addStats

public void addStats(Fitness[] popFitness)
Add stats. Extracts information from the fitness of the population.

Parameters:
popFitness - fitness of the population

addLength

public void addLength(java.util.ArrayList<java.lang.Integer> popLength)
Add length data

Parameters:
popLength - population length

addMeanDerivationTreeDepth

public void addMeanDerivationTreeDepth(Fitness[] mG)
Add mean depth of the derivation trees in the population

Parameters:
mG - fitness

addMeanUsedGenes

public void addMeanUsedGenes(Fitness[] mG)
Add mean used genes

Parameters:
mG - fitness

addStatsPop

public void addStatsPop(java.util.ArrayList<Individual> population)
Add population to the statcatcher to work with. Calls many of the functions for adding statistics.

Parameters:
population - incoming population

getBestIndividualOfGeneration

public Individual getBestIndividualOfGeneration()
Get best individual of generation

Returns:
best individual of the latest generation

getBestIndividualOfGenerations

public java.util.ArrayList<Individual> getBestIndividualOfGenerations()
Get best individuals of all generations

Returns:
best individuals of the generations

getMeanDerivationTreeDepth

public java.util.ArrayList<java.lang.Double> getMeanDerivationTreeDepth()
Get the mean max depth of the derivation trees in the population

Returns:
ArrayList The mean max depth of the derivation trees in the population

getAllFitness

public java.util.ArrayList<java.util.ArrayList<java.lang.Double>> getAllFitness()
Get all fitness stored

Returns:
all fitness stored

getMeanUsedGenes

public java.util.ArrayList<java.lang.Double> getMeanUsedGenes()
Get mean used genes

Returns:
mean used genes

getCurrentMeanUsedGenes

public double getCurrentMeanUsedGenes()
Get the mean used genes for the latest generation

Returns:
current mean used genes

getCurrentMean

public double getCurrentMean()
Get mean for the latest generation

Returns:
current mean

getInvalids

public java.util.ArrayList<java.lang.Integer> getInvalids()
Get number of invalid individuals

Returns:
invalids

getCurrentBestFitness

public double getCurrentBestFitness()
Get the best fitness for the latest generation

Returns:
current best fitness

getBestFitness

public java.util.ArrayList<java.lang.Double> getBestFitness()
Get best fitness

Returns:
best fitness

getVarFitness

public java.util.ArrayList<java.lang.Double> getVarFitness()
Get variance of the fitness in the population

Returns:
variance of fitness

getMeanFitness

public java.util.ArrayList<java.lang.Double> getMeanFitness()
Get mean fitness of the population

Returns:
mean fitness

getAveLength

public java.util.ArrayList<java.lang.Double> getAveLength()
Get the average length

Returns:
average length

getMaxLength

public java.util.ArrayList<java.lang.Integer> getMaxLength()
Get max length

Returns:
max length

getMinLength

public java.util.ArrayList<java.lang.Integer> getMinLength()
Get min length

Returns:
min length

getVarLength

public java.util.ArrayList<java.lang.Double> getVarLength()
Get variance of the lengths in the population

Returns:
variance of the lengths

getTime

public java.util.ArrayList<java.lang.Long> getTime()
Get the time for execution of a generation

Returns:
time