Copyright | (c) Leon Medvinsky, 2015 |
---|---|
License | GPL-3 |
Maintainer | lmedvinsky@hotmail.com |
Stability | experimental |
Portability | ghc |
Safe Haskell | None |
Language | Haskell2010 |
- data Population = Population {}
- newtype SpecId = SpecId Int
- data PopM a
- data PopContext
- runPopM :: PopM a -> PopContext -> (a, PopContext)
- data PopSettings = PS {}
- newPop :: Int -> PopSettings -> Population
- trainOnce :: GenScorer a -> Population -> (Population, Maybe Genome)
- trainN :: Int -> GenScorer a -> Population -> Population
- trainUntil :: Int -> GenScorer a -> Population -> (Population, Maybe (Genome, Int))
- speciesCount :: Population -> Int
- validatePopulation :: Population -> Maybe [String]
Documentation
data Population Source
A NEAT Population
Population | |
|
PopM
Custom state monad
runPopM :: PopM a -> PopContext -> (a, PopContext) Source
Construction
newPop :: Int -> PopSettings -> Population Source
Generates a starter population
Training
trainOnce :: GenScorer a -> Population -> (Population, Maybe Genome) Source
Advances the population one generation with the fitness function, possibly giving a solution.
trainN :: Int -> GenScorer a -> Population -> Population Source
Train the population n times. Values less than 1 return the original.
trainUntil :: Int -> GenScorer a -> Population -> (Population, Maybe (Genome, Int)) Source
Train until the provided goal is reached, or the max number of generations (first parameter) is reached. Possibly also returns a solution and the number of generations elapsed.
Statistics
speciesCount :: Population -> Int Source
Gets the number of species
Debugging
validatePopulation :: Population -> Maybe [String] Source
Validate a population, possibly returning a list of errors