MOGAL
Public Member Functions

mogal::GeneticAlgorithm Class Reference

Interface for running a genetic algorithm. More...

#include <geneticalgorithm.h>

Inheritance diagram for mogal::GeneticAlgorithm:
Inheritance graph
[legend]
Collaboration diagram for mogal::GeneticAlgorithm:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool run (GAFactory &factory, size_t populationSize, const GeneticAlgorithmParams *pParams=0)
 Run a genetic algorithm.
bool run (const std::string &factoryName, size_t populationSize, const std::string &baseDir, const GAFactoryParams *pFactoryParams, const GeneticAlgorithmParams *pParams=0)
 Run a genetic algorithm.
bool run (const nut::NetworkLayerAddress &serverAddress, uint16_t serverPort, const std::string &factoryName, size_t populationSize, GAFactory &factory, const GeneticAlgorithmParams *pParams=0)
 Run a genetic algorithm.
bool run (const nut::NetworkLayerAddress &serverAddress, uint16_t serverPort, const std::string &factoryName, size_t populationSize, const std::string &baseDir, const GAFactoryParams *pFactoryParams, const GeneticAlgorithmParams *pParams=0)
 Run a genetic algorithm.
void getBestGenomes (std::list< Genome * > &genomes) const
 Stores the current best genomes in genomes (these should not be deleted).
void getBestGenomes (std::vector< Genome * > &genomes) const
 Stores the current best genomes in genomes (these should not be deleted).
size_t getNumberOfBestGenomes () const
 Returns the current number of best genomes.
void setBestGenomes (const std::list< Genome * > &genomes)
 Copies the genomes in genomes and sets these as the current set of best genomes.
GenomeselectPreferredGenome () const
 This function selects the preferred genome from the current set of best genomes, according to the preferences in the current factory.
void clearBestGenomes ()
 Clears the current set of best genomes.
int getCurrentGeneration () const
 Returns the current generation number.

Detailed Description


Member Function Documentation

void mogal::GeneticAlgorithm::clearBestGenomes ( )
void mogal::GeneticAlgorithm::getBestGenomes ( std::list< Genome * > &  genomes) const
void mogal::GeneticAlgorithm::getBestGenomes ( std::vector< Genome * > &  genomes) const
int mogal::GeneticAlgorithm::getCurrentGeneration ( ) const [inline]
size_t mogal::GeneticAlgorithm::getNumberOfBestGenomes ( ) const [inline]
bool mogal::GeneticAlgorithm::run ( const nut::NetworkLayerAddress &  serverAddress,
uint16_t  serverPort,
const std::string &  factoryName,
size_t  populationSize,
const std::string &  baseDir,
const GAFactoryParams pFactoryParams,
const GeneticAlgorithmParams pParams = 0 
)

Run a genetic algorithm.

Parameters:
serverAddressIP address of the server which should be used for distributed execution of the genetic algorithm.
serverPortPort number on which the server is listening for incoming connections.
factoryNameName of the module from which the genetic algorithm factory should be loaded both locally and at the server.
populationSizeSize of the population.
baseDirDirectory in which the module resides locally.
pFactoryParamsParameters which should be used in the initialization of the factory.
pParamsParameters for the genetic algorithm.
bool mogal::GeneticAlgorithm::run ( const nut::NetworkLayerAddress &  serverAddress,
uint16_t  serverPort,
const std::string &  factoryName,
size_t  populationSize,
GAFactory factory,
const GeneticAlgorithmParams pParams = 0 
)

Run a genetic algorithm.

Parameters:
serverAddressIP address of the server which should be used for distributed execution of the genetic algorithm.
serverPortPort number on which the server is listening for incoming connections.
factoryNameName of the module from which the genetic algorithm factory should be loaded at the server.
populationSizeSize of the population.
factoryThe factory which should be used. This factory has to be initialized before this function is called.
pParamsParameters for the genetic algorithm.
bool mogal::GeneticAlgorithm::run ( GAFactory factory,
size_t  populationSize,
const GeneticAlgorithmParams pParams = 0 
)

Run a genetic algorithm.

Parameters:
factoryThe factory which should be used. This factory has to be initialized before this function is called.
populationSizeSize of the population.
pParamsParameters for the genetic algorithm.
bool mogal::GeneticAlgorithm::run ( const std::string &  factoryName,
size_t  populationSize,
const std::string &  baseDir,
const GAFactoryParams pFactoryParams,
const GeneticAlgorithmParams pParams = 0 
)

Run a genetic algorithm.

Parameters:
factoryNameName of the module from which the genetic algorithm factory should be loaded.
populationSizeSize of the population.
baseDirDirectory in which the module resides.
pFactoryParamsParameters which should be used in the initialization of the factory.
pParamsParameters for the genetic algorithm.
void mogal::GeneticAlgorithm::setBestGenomes ( const std::list< Genome * > &  genomes)

The documentation for this class was generated from the following file: