creatur-2.0.12: Framework for artificial life experiments.

Portabilityportable
Stabilityexperimental
Maintaineramy@nualeargais.ie
Safe HaskellNone

ALife.Creatur.Genetics.Reproduction.Asexual

Description

A reproduction method for artificial lifeforms where: * Each agent has a single strand of genetic information. * Each child has two parents. * Each parent contributes approximately half of its genetic information to the offspring.

Synopsis

Documentation

class Reproductive a whereSource

A species that reproduces, transmitting genetic information to its offspring. Minimal complete definition: all except mate.

Associated Types

type Base a Source

The basic unit of hereditary information for an agent. The type signature for the agent's genome is [Base a].

Methods

recombine :: RandomGen r => a -> a -> Rand r [Base a]Source

Recombines the genetic information from two parents, creating genetic information for potential offspring. Typically this involves the following steps: 1. Recombine the two strands of genetic information (one from each parent) to obtain two new strands. 2. Discard one strand, and return the remaining one.

build :: AgentId -> [Base a] -> Maybe aSource

Builds an agent based on the genome provided, if it is possible to do so.

makeOffspring :: RandomGen r => a -> a -> AgentId -> Rand r (Maybe a)Source