Created by Scott Robert Ladd at Coyote Gulch Productions.
Associates organisms with the components of an evolutionary system. More...
#include <evocosm.h>
This is where it all comes together: An evocosm binds a evocosm of organisms to a set of objects that define how those organisms evolve.
OrganismType | - The type of organism |
libevocosm::evocosm< OrganismType >::evocosm | ( | vector< OrganismType > & | a_population, |
landscape< OrganismType > & | a_landscape, | ||
mutator< OrganismType > & | a_mutator, | ||
reproducer< OrganismType > & | a_reproducer, | ||
scaler< OrganismType > & | a_scaler, | ||
selector< OrganismType > & | a_selector, | ||
analyzer< OrganismType > & | a_analyzer, | ||
listener< OrganismType > & | a_listener | ||
) |
Creates a new evocosm. Think of an evocosm as a director, a tool for associating organisms with their landscape. Note that these arguments are modifiable references, and that the referenced objects must continue to exist during the lifetime of the evocosm.
a_population | Initial population of organisms |
a_landscape | Initial set of landscaoes for testing organism fitness |
a_mutator | - A concrete implementation of mutator |
a_reproducer | - A concrete implementation of reproducer |
a_scaler | - A concrete implementation of scaler |
a_selector | - A concrete implementation of selector |
a_analyzer | - A concrete implementation of analyzer |
a_listener | - a listener for events |
libevocosm::evocosm< OrganismType >::evocosm | ( | const evocosm< OrganismType > & | a_source | ) |
Creates a new evocosm identical to an existing one.
a_source | - The source object |
libevocosm::evocosm< OrganismType >::~evocosm | ( | ) | [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.
vector<OrganismType>& libevocosm::evocosm< OrganismType >::get_population | ( | ) | [inline] |
Use with caution! This function provides direct read-write access to an evocosm's population. This is necessary when the organisms need special manipulation, such as when they can not be randomized by a default constructor.
unsigned int libevocosm::evocosm< OrganismType >::get_sleep_time | ( | ) | [inline] |
Get the sleep time setting for this listerner. /return current value of sleep time (microseconds)
evocosm< OrganismType > & libevocosm::evocosm< OrganismType >::operator= | ( | const evocosm< OrganismType > & | a_source | ) |
Assigns an existing object the state of another.
a_source | - The source object |
References libevocosm::evocosm< OrganismType >::m_analyzer, libevocosm::evocosm< OrganismType >::m_iteration, libevocosm::evocosm< OrganismType >::m_landscape, libevocosm::evocosm< OrganismType >::m_population, libevocosm::evocosm< OrganismType >::m_scaler, and libevocosm::evocosm< OrganismType >::m_sleep_time.
bool libevocosm::evocosm< OrganismType >::run_generation | ( | ) | [virtual] |
A generation represents a cycle in the life of an evocosm; this function performs one sequence of fitness testing & scaling, reporting, breeding, and mutation. This method can be replaced by in a derived class to define a different processing sequence; the default sequence defined here is good for most evolutionary algorithms I've created.
void libevocosm::evocosm< OrganismType >::set_sleep_time | ( | unsigned int | a_sleep_time | ) | [inline] |
Set the sleep time property value. /param a_sleep_time new value of sleep time (microseconds)
void libevocosm::evocosm< OrganismType >::yield | ( | ) | [inline, protected] |
Evocosm periodically invokes this function to allow other processes to run. In most cases, this will be some sort of platform-specific sleep function, such as usleep.
© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.