Petri.Chromosome protocol (petri v0.2.0)

Copy Markdown View Source

Protocol for chromosome representations. Implementations provide length/1, genes/1, and valid?/1.

Summary

Types

t()

All the types that implement this protocol.

Functions

Returns the chromosome's gene list.

Returns the number of genes in the chromosome.

Returns true if the chromosome satisfies its representation's invariants (e.g. a permutation has no duplicate genes).

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

genes(chromosome)

Returns the chromosome's gene list.

length(chromosome)

Returns the number of genes in the chromosome.

valid?(chromosome)

Returns true if the chromosome satisfies its representation's invariants (e.g. a permutation has no duplicate genes).