Genex v1.0.1-beta Genex.Support.Genealogy View Source

Implementation of a genealogy tree.

We use the Genealogy tree to model the history of the population from it's initialization to the end of the algorithm. The tree itself is a directed Graph implemented using libgraph. Genealogy is tracked in a population struct, so you can access the genealogy anytime through the current population. Any function in the libgraph library will work on a genealogy

An edge emanates from parent and is incident on child. Mutants are considered new chromosomes, so their lineage starts with a single parent.

To produce visualizations of the Genealogy of an evolution, you'll have to export the tree to a DOT file and use a third-party visualization tool.

Link to this section Summary

Functions

Exports the genealogy tree.

Creates a new Genealogy Tree.

Updates a Genealogy Tree with several vertices or one vertex.

Updates a Genealogy Tree with a vertex and it's parents.

Updates a Genealogy Tree with a vertex and it's parents.

Link to this section Functions

Exports the genealogy tree.

Returns {:ok, String}.

Parameters

  • genealogy: Reference to a Genealogy Tree.

Creates a new Genealogy Tree.

Returns Graph.

Link to this function

update(genealogy, chromosomes)

View Source

Updates a Genealogy Tree with several vertices or one vertex.

Returns Graph.

Parameters

  • genealogy: Reference to the Genealogy Tree.
  • chromosomes: List of %Chromosome{} or %Chromosome{}.
Link to this function

update(genealogy, child, parent)

View Source

Updates a Genealogy Tree with a vertex and it's parents.

Returns Graph.

# Parameters

- `genealogy`: Reference to a Genealogy Tree.
- `child`: Child `%Chromosome{}`.
- `parent`: Parent `%Chromosome{}`.
Link to this function

update(genealogy, child, parent_a, parent_b)

View Source

Updates a Genealogy Tree with a vertex and it's parents.

Returns Graph.

Parameters

  • genealogy: Reference to a Genealogy Tree.
  • child: Child %Chromosome{}.
  • parent_a: Parent A %Chromosome{}.
  • parent_b: Parent B %Chromosome{}.