|
|
|
Description |
Genetic Algorithms
|
|
Synopsis |
|
|
|
Documentation |
|
|
Constructors | Config | | cConfig :: ChromosomeConfig c p | The config for the chromosome model
| pConfig :: PopulationConfig c p | The config for the population model
| newPopulation :: p -> GAState c p p | The function that transforms a population into the next generation
| maxFitness :: Maybe Double | The fitness at which to stop the GA
| maxGeneration :: Maybe Int | The generation at which to stop the GA
| currentGeneration :: Int | The number of generations elapsed. defaultConfig sets this to 0
| gen :: StdGen | The random number generator
|
|
|
|
|
data PopulationConfig c p | Source |
|
Constructors | PopulationConfig | | bestChromosomePop :: p -> GAState c p c | | roulettePop :: p -> GAState c p p | | tournamentPop :: p -> GAState c p p | | applyCrossoverPop :: p -> GAState c p p | | applyMutationPop :: p -> GAState c p p | |
|
|
|
|
data ChromosomeConfig c p | Source |
|
Constructors | ChromosomeConfig | | fitness :: c -> Double | The fitness function for the chromosome model
| mutate :: c -> GAState c p c | The mutation operator for the chromosome model
| cross :: c -> c -> GAState c p (c, c) | The crossover operator for the chromosome model
|
|
|
|
|
|
defaultConfig acts as a blank slate for genetic algorithms.
cConfig, pConfig, gen, and maxFitness or maxGeneration must be defined
|
|
|
|
|
Wrapper function which returns the best chromosome of a population
|
|
|
Generates a random number which updating the random number generator for the config
|
|
|
Runs the specified GA config until the termination condition is reached
|
|
|
A wrapper function for use in newPopulation for roulette selection
|
|
|
A wrapper function for use in newPopulation for mutating the population
|
|
|
A wrapper function for use in newPopulation for applying crossover to the population
|
|
|
A wrapper function for use in newPopulation for tournament selection
|
|
|
Returns true if the given population satisfies the termination condition for the GA config
|
|
Produced by Haddock version 2.4.2 |