Interface for running a genetic algorithm.
More...
#include <geneticalgorithm.h>
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.
|
Genome * | selectPreferredGenome () 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:
-
serverAddress | IP address of the server which should be used for distributed execution of the genetic algorithm. |
serverPort | Port number on which the server is listening for incoming connections. |
factoryName | Name of the module from which the genetic algorithm factory should be loaded both locally and at the server. |
populationSize | Size of the population. |
baseDir | Directory in which the module resides locally. |
pFactoryParams | Parameters which should be used in the initialization of the factory. |
pParams | Parameters 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:
-
serverAddress | IP address of the server which should be used for distributed execution of the genetic algorithm. |
serverPort | Port number on which the server is listening for incoming connections. |
factoryName | Name of the module from which the genetic algorithm factory should be loaded at the server. |
populationSize | Size of the population. |
factory | The factory which should be used. This factory has to be initialized before this function is called. |
pParams | Parameters for the genetic algorithm. |
Run a genetic algorithm.
- Parameters:
-
factory | The factory which should be used. This factory has to be initialized before this function is called. |
populationSize | Size of the population. |
pParams | Parameters 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:
-
factoryName | Name of the module from which the genetic algorithm factory should be loaded. |
populationSize | Size of the population. |
baseDir | Directory in which the module resides. |
pFactoryParams | Parameters which should be used in the initialization of the factory. |
pParams | Parameters for the genetic algorithm. |
void mogal::GeneticAlgorithm::setBestGenomes |
( |
const std::list< Genome * > & |
genomes | ) |
|
The documentation for this class was generated from the following file: