Created by Scott Robert Ladd at Coyote Gulch Productions.
#include <organism.h>
Evocosm provides the freedom to define organisms as anything: bit strings, floating-point numbers, finite state machines, LISP programs, or external robots controlled via radio waves.
Genotype | - The type of genes for this organism class |
libevocosm::organism< Genotype >::organism | ( | ) | [inline] |
Creates a new organism, with default genes and zero fitness.
libevocosm::organism< Genotype >::organism | ( | const Genotype & | a_value | ) | [inline] |
libevocosm::organism< Genotype >::organism | ( | const organism< Genotype > & | a_source | ) | [inline] |
Creates a new object identical to an existing one.
a_source | - The source object |
libevocosm::organism< Genotype >::organism | ( | const organism< Genotype > & | a_parent1, | |
const organism< Genotype > & | a_parent2 | |||
) | [inline] |
Creates a new object identical to an existing one.
a_parent1 | - First parent object | |
a_parent2 | - Second parent object |
virtual libevocosm::organism< Genotype >::~organism | ( | ) | [inline, virtual] |
A virtual destructor. By default, it does nothing; this is a placeholder that identifies this class as a potential base, ensuring that objects of a derived class will have their destructors called if they are destroyed through a base-class pointer.
double libevocosm::organism< Genotype >::fitness | ( | ) | const [inline] |
Fitness is assigned by the landscape in which an organism is tested. A scaler object may alter fitness values after testing; a selector uses fitness to determine which organisms survive from one generation to the next, and a reproducer creates new organisms from parents selected by fitness.
Giving direct access to a member violates encapsulation, but it vastly simplifies the numerous functions that manipulate organisms.
References libevocosm::organism< Genotype >::m_fitness.
double& libevocosm::organism< Genotype >::fitness | ( | ) | [inline] |
Fitness is assigned by the landscape in which an organism is tested. A scaler object may alter fitness values after testing; a selector uses fitness to determine which organisms survive from one generation to the next, and a reproducer creates new organisms from parents selected by fitness.
Giving direct access to a member violates encapsulation, but it vastly simplifies the numerous functions that manipulate organisms.
References libevocosm::organism< Genotype >::m_fitness.
const Genotype& libevocosm::organism< Genotype >::genes | ( | ) | const [inline] |
Genes define an organism's behavior in a fitness landscape. An initial population usually (but not always) contains organisms with random genes; a landscape tests the behavior defined by genes to calculate the fitness of an organism. A reproducer will create children from the genes of their parents, and a mutator may make random changes in those genes.
References libevocosm::organism< Genotype >::m_genes.
Genotype& libevocosm::organism< Genotype >::genes | ( | ) | [inline] |
Genes define an organism's behavior in a fitness landscape. An initial population usually (but not always) contains organisms with random genes; a landscape tests the behavior defined by genes to calculate the fitness of an organism. A reproducer will create children from the genes of their parents, and a mutator may make random changes in those genes.
References libevocosm::organism< Genotype >::m_genes.
virtual bool libevocosm::organism< Genotype >::operator< | ( | const organism< Genotype > & | a_right | ) | const [inline, virtual] |
Many Standard C++ algorithms require a "less than" comparison operator for container elements.
a_right | - Right hand argument for less than operator |
References libevocosm::organism< Genotype >::m_fitness.
organism& libevocosm::organism< Genotype >::operator= | ( | const organism< Genotype > & | a_source | ) | [inline] |
Assigns an existing object the state of another.
a_source | - The source object |
References libevocosm::organism< Genotype >::m_fitness, and libevocosm::organism< Genotype >::m_genes.
virtual void libevocosm::organism< Genotype >::reset_all | ( | ) | [inline, virtual] |
Resets all data in an organisim to the initial (or startup) state, including setting the fitness to zero. Derived classes should override this method to "clear" any data.
References libevocosm::organism< Genotype >::m_fitness.
© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.