Log Class Reference

Logging system. More...

#include <Log.hpp>

List of all members.

Public Member Functions

 Log (std::string strName, int iRuns=5, int iGenerations=100)
void logParameters (int iPopulationSize, double dCrossoverRate, double dMutationRate, int iTries, int iMinDepth, int iMaxDepth, int iTournamentSize)
void addEntry (int iRun, int iGeneration, double dBestFitness, double dAvgFitness, int iBestHits, double dAvgHits)
void logBest (std::vector< Individual * > vpindBest)


Detailed Description

Logging system.

Author:
Stephen E. Baker
Date:
2006-2007
Version:
1.0
Formats information from the genetic programming system, such as fitness values per generation and print outs of the best solutions to files where they can be analysed later.


Constructor & Destructor Documentation

Log::Log ( std::string  strName,
int  iRuns = 5,
int  iGenerations = 100 
)

Sets up a new logging system. Most of the parameters are used for formatting the data.

Parameters:
[in] strName The base name, extended to create the various files.
[in] iRuns The number of runs or trials the GP will cycle through
[in] iGenerations The number of cycles per run


Member Function Documentation

void Log::addEntry ( int  iRun,
int  iGeneration,
double  dBestFitness,
double  dAvgFitness,
int  iBestHits,
double  dAvgHits 
)

Add fitness information for a particular generation of a particular run.

Parameters:
[in] iRun The run for which the information pertains.
[in] iGeneration The generation for which the information pertains.
[in] dBestFitness The best fitness of any individual in this run and generation.
[in] dAvgFitness The average fitness of this run and generation.
[in] dBestHits The number of hits obtained by the individual with the best fitness of this run and generation.
[in] dAvgHits The average hits of this run and generation.

void Log::logBest ( std::vector< Individual * >  vpindBest  ) 

Write the best individuals to file. This list must be generated elsewhere and passed in.

Parameters:
[in] vpindBest A list of the best individual from each run in order.

void Log::logParameters ( int  iPopulationSize,
double  dCrossoverRate,
double  dMutationRate,
int  iTries,
int  iMinDepth,
int  iMaxDepth,
int  iTournamentSize 
)

Logs the parameters to a file.

Parameters:
[in] iPopulationSize Number of individuals in a population.
[in] dCrossoverRate Proportion of population to be crossed.
[in] dMutationRate Proportion of population to be mutated.
[in] iTries Number of attempts at crossover or mutation made before it is abandoned.
[in] iMinDepth Minimum distance between root and furthest leaf to be considered a valid tree.
[in] iMaxDepth Maximum distance between root and furthest leaf to be considered a valid tree.
[in] iTournamentSize Number of elements randomly selected from the population of which the one with the highest fitness is selected.


The documentation for this class was generated from the following files:
Generated on Mon Jan 15 01:21:05 2007 for Creatively Named Grammar Guided Genetic Programming System by  doxygen 1.4.7