heukarya-0.1.0.1: A genetic programming based on tree structure.

Safe HaskellNone

AI.Heukarya.Center

Description

control center for external using

Synopsis

Documentation

data EcoConfig Source

configuration of ecosystem

Constructors

EcoConfig 

Fields

num :: Int

the number of Heukarya contained in EcoSystem

depth :: Int

depth of Heukaryas' tree structure

maxWinProb :: Double

probability of Eukarya who has bigger fitness win the game

mutateProb :: Double

probability of mutating

crossProb :: Double

probability of pairing crossover

outType :: Text

Heukaryas' root's type, represented by Text

data EcoUnWritable g d Source

storing the data which are not writable to file

Constructors

EcoUnWritable 

Fields

rndGen :: g

Random Generator

genes :: [d]

genes for constructing Heukarya

data EcoSystem g d rep Source

EcoSystem consists of ecosystem's configuration and Jungle. `Tree rep` is sometimes used for repsentation of Heukarya by `Tree String`

Constructors

EcoSystem 

initGeneration :: (RandomGen g, HeukaryaGene rep) => EcoUnWritable g rep -> EcoConfig -> EcoSystem g rep repSource

initial a EcoSystem

nextGeneration :: (Ord n, RandomGen g, HeukaryaGene rep) => EcoSystem g rep rep -> Seq n -> EcoSystem g rep repSource

evolve a EcoSystem one step Parameters: EcoSystem , fitness function

evolveGeneration :: (Ord a, Ord n, RandomGen g, HeukaryaGene rep) => a -> EcoSystem g rep rep -> (Seq (Tree rep) -> Bool) -> (Tree rep -> n) -> a -> EcoSystem g rep repSource

evolving until condiction suffered or max number of Generations hitted Parameters : max number of generations, EcoSystem, stop evolving's Condiction , fitness function, generation counter(placed by zero when used)

evolveCheckGeneration :: (Integral a, Ord n, RandomGen g, HeukaryaGene rep) => a -> FilePath -> a -> EcoSystem g rep rep -> (Seq (Tree rep) -> Bool) -> (Tree rep -> n) -> a -> IO (EcoSystem g rep rep)Source

evolving until condiction suffered or max number of Generations hitted save checkpoint per period Parameters : max number of generations, checkpoint's file path, save checkpoint per x generations, EcoSystem, stop evolving's Condiction , fitness function, generation counter(placed by zero when used)

readEcoSystem :: Show rep => FilePath -> EcoUnWritable g rep -> IO (EcoSystem g rep rep)Source

read a EcoSystem from file and addon UnWritable data Parameters : filepath for reading, UnWritable data

writeEcoSystem :: Show a => FilePath -> EcoSystem t t1 a -> IO ()Source

write a EcoSystem into file without UnWritable data Parameters : filepath for saving, EcoSystem saved