devolve



alias  Tree = devolve.tree.generator.BaseNode(T);

Convenience alias


class  TreeGA(T, uint PopSize, uint depth, alias fitness, alias selector = top!(to!uint(popSize * 0.1), fitness), alias crossover = singlePoint!T, alias mutator = randomBranch!T, alias comp = "a > b") if (PopSize > 0 && depth > 0): BaseGA!(BaseNode!T, PopSize, comp);

Genetic algorithm for genomes in the form of a tree. Particularly well suited for growing algorithms.

Parameters
T Type of the tree. Should be the return type and parameter type of the functions composing the tree
PopSize The size of the population
depth Maximum depth of the tree
fitness User defined fitness function. Must return double
selector Selection method used to pick parents of next generation.
crossover Used to crossover individuals to create the new generation.
mutator Used to alter the population.
comp Used to determine whether a larger or smaller fitness is better.

this(TreeGenerator!T gen);

Create a tree GA with the given generator.


bool  autoGenerateGraph(bool generate);
const bool  autoGenerateGraph();

Whether to generate a graph of the tree after 'evolution' completes


const void  generateGraph(const(BaseNode!T) node, string filename = "output.dot", string description = "");

Generate a a Graphviz dot file named filename with additional description 'description' using node


void  generation();

Add initial population using generator


void  crossingOver();

Preform add new members by crossing-over the population left after selection, keeping 'crossoverRate' precent in the population.


void  mutation();

Preform  mutation on members of the population