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 {
- psSize :: Int
- psInputs :: Int
- psOutputs :: Int
- psParams :: Parameters
- sparse :: Maybe Int
- psStrategy :: Maybe PhaseParams
- newPop :: Int -> PopSettings -> Population
- trainOnce :: Applicative f => TrainMethod f -> Population -> f Population
- newtype TrainMethod f = TrainMethod {
- tmGen :: forall t. Traversable t => t Genome -> f (t Double)
- pureTrain :: GenScorer a -> TrainMethod Identity
- winTrain :: GenScorer a -> TrainMethod ((,) (First Genome))
- trainN :: (Applicative f, Monad f) => TrainMethod f -> Int -> Population -> f Population
- trainUntil :: Int -> GenScorer a -> Population -> (Population, Maybe (Genome, Int))
- trainPure :: GenScorer a -> Population -> Population
- 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
data PopSettings Source
Settings for creating a new population
PS | |
|
newPop :: Int -> PopSettings -> Population Source
Generates a starter population
Training
trainOnce :: Applicative f => TrainMethod f -> Population -> f Population Source
newtype TrainMethod f Source
Describes how to handle each species or genome when processing fitness, allowing the addition of additional effects
TrainMethod | |
|
TrainMethods
pureTrain :: GenScorer a -> TrainMethod Identity Source
Train method without any additional effects
winTrain :: GenScorer a -> TrainMethod ((,) (First Genome)) Source
Train method that possibly returns a solution
Convenience
trainN :: (Applicative f, Monad f) => TrainMethod f -> Int -> Population -> f 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.
trainPure :: GenScorer a -> Population -> Population Source
Train without effects
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