neet-0.4.0.0: A NEAT library for Haskell

Copyright(c) Leon Medvinsky, 2015
LicenseGPL-3
Maintainerlmedvinsky@hotmail.com
Stabilityexperimental
Portabilityghc
Safe HaskellNone
LanguageHaskell2010

Neet.Population

Contents

Description

 

Synopsis

Documentation

data Population Source

A NEAT Population

Constructors

Population 

Fields

popSize :: Int

Size of the population

popSpecs :: !(Map SpecId Species)

The species

popBScore :: !Double

Best score so far

popBOrg :: !Genome

Best genome so far

popBSpec :: !SpecId

Id of the species that hosted the best score

popCont :: !PopContext

Tracking state and fresh values

nextSpec :: !SpecId

The next species ID

popParams :: Parameters

Parameters for large species

popStrat :: SearchStrat
 
popPhase :: PhaseState
 
popGen :: Int

Current generation

Instances

newtype SpecId Source

Constructors

SpecId Int 

Instances

PopM

Construction

data PopSettings Source

Settings for creating a new population

Constructors

PS 

Fields

psSize :: Int

How big the population should be

psInputs :: Int

Number of inputs

psOutputs :: Int

Number of outputs

psParams :: Parameters

Parameters for large species

sparse :: Maybe Int

If Just n, will be sparse with n connections. Otherwise fully connected.

psStrategy :: Maybe PhaseParams
 

Instances

newPop :: Int -> PopSettings -> Population Source

Generates a starter population

Training

newtype TrainMethod f Source

Describes how to handle each species or genome when processing fitness, allowing the addition of additional effects

Constructors

TrainMethod 

Fields

tmGen :: forall t. Traversable t => t Genome -> f (t Double)

How to process each Genome of a species into a score.

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