53 #if !defined(LIBEVOCOSM_EVOCOSM_H) 54 #define LIBEVOCOSM_EVOCOSM_H 57 #pragma warning (disable : 4786) 70 #include "validator.h" 73 #include "landscape.h" 75 #include "reproducer.h" 101 template <
class OrganismType>
152 evocosm(vector<OrganismType> & a_population,
226 m_sleep_time = a_sleep_time;
238 if (m_sleep_time > 0)
240 #if defined(_MSC_VER) 243 usleep((useconds_t)m_sleep_time);
251 template <
class OrganismType>
275 template <
class OrganismType>
292 template <
class OrganismType>
299 template <
class OrganismType>
314 template <
class OrganismType>
317 bool keep_going =
true;
319 OrganismType * best = NULL;
360 survivors.insert(survivors.end(),children.begin(),children.end());
listener< OrganismType > & m_listener
A listener for evocosm progress.
Definition: evocosm.h:127
void set_sleep_time(unsigned int a_sleep_time)
Set the sleep time property value.
Definition: evocosm.h:224
mutator< OrganismType > & m_mutator
A mutator to randomly influence genes.
Definition: evocosm.h:112
Mutates organisms.
Definition: mutator.h:72
scaler< OrganismType > & m_scaler
Scales the fitness of the evocosm.
Definition: evocosm.h:118
vector< OrganismType > & get_population()
Directly view population.
Definition: evocosm.h:204
An abstract interface defining a fitness landscape.
Definition: landscape.h:80
selector< OrganismType > & m_selector
Selects organisms that survive from one generation to the next.
Definition: evocosm.h:121
A toolkit and framework for implementing evolutionary algorithms.
Definition: analyzer.h:60
void yield()
Yield.
Definition: evocosm.h:236
Elements shared by all classes in Evocosm.
Definition: evocommon.h:117
Selects organisms that survive.
Definition: selector.h:79
An abstract interface defining a listener.
Definition: listener.h:80
virtual ~evocosm()
Virtual destructor.
Definition: evocosm.h:293
unsigned int m_sleep_time
Number microseconds for process to sleep on yield.
Definition: evocosm.h:133
evocosm & operator=(const evocosm< OrganismType > &a_source)
Assignment operator.
Definition: evocosm.h:300
reproducer< OrganismType > & m_reproducer
Creates new organisms.
Definition: evocosm.h:115
landscape< OrganismType > & m_landscape
Fitness landscapes common to all populations.
Definition: evocosm.h:109
Fitness scaling for a population.
Definition: scaler.h:72
Creates new organisms from an existing population.
Definition: reproducer.h:72
analyzer< OrganismType > & m_analyzer
Reports the a evocosm for analysis or display.
Definition: evocosm.h:124
unsigned int get_sleep_time()
Get the sleep time property value.
Definition: evocosm.h:214
size_t m_iteration
Count of iterations made.
Definition: evocosm.h:130
Associates organisms with the components of an evolutionary system.
Definition: evocosm.h:102
Reports on a given population.
Definition: analyzer.h:70
virtual bool run_generation()
Compute next generation.
Definition: evocosm.h:315
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)
Creation constructor.
Definition: evocosm.h:252
vector< OrganismType > & m_population
The populations of organisms.
Definition: evocosm.h:106