The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Algorithm::Genetic::Diploid::Base - base class for core objects

METHODS

new

Base constructor for everyone, takes named arguments

logger

The logger is a singleton object so there's no point in having each object carrying around its own object reference. Hence, we just return a static reference here to the Algorithm::Genetic::Diploid::Logger object.

experiment

We don't want there to be circular references from each object to the experiment and back because it will create recursive YAML serializations and interfere with object cloning. Hence this is a static method to access the Algorithm::Genetic::Diploid::Experiment object.

id

Accessor for the numerical ID, which is generated when the object is instantiated

dump

Write the object to a YAML string

load

Read an object from a YAML string (static method)

clone

Clone an object by writing, then reading