neet-0.2.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

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.

Instances

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