Created by Scott Robert Ladd at Coyote Gulch Productions.
Implements reproduction. More...
#include <function_optimizer.h>
Public Member Functions | |
function_reproducer (double p_crossover_rate=1.0) | |
Creation constructor. More... | |
function_reproducer (const function_reproducer &a_source) | |
Copy constructor. More... | |
virtual | ~function_reproducer () |
Virtual destructor. More... | |
function_reproducer & | operator= (const function_reproducer &a_source) |
Assignment operator. More... | |
double | crossover_rate () const |
Gets the crossover rate. More... | |
virtual vector< function_solution > | breed (const vector< function_solution > &a_population, size_t p_limit) |
Reproduction for solutions. More... | |
![]() | |
virtual | ~reproducer () |
Virtual destructor. More... | |
Additional Inherited Members | |
![]() | |
typedef vector< double > | t_function(vector< double > a_args) |
Definition of a function type. More... | |
![]() | |
static size_t | rand_index (size_t n) |
Static function to allow use of g_random function pointer in random_shuffle. | |
static void | set_seed (uint32_t a_seed) |
Set the seed for the random number generator. | |
static uint32_t | get_seed () |
Set the seed for the random number generator. | |
static std::string | version () |
Get version number. | |
![]() | |
static prng | g_random |
A shared random number generator. | |
static std::string | g_version |
Version number. | |
![]() | |
static evoreal | g_evoreal |
Provides mutation and crossover services for doubles. | |
Handles reproduction for solutions.
|
inline |
Creates a new reproducer with a given crossover rate.
|
inline |
Duplicates an existing object.
a_source | - The source object |
|
inlinevirtual |
Satisfies the requirements of the base class; does nothing at this time.
|
virtual |
Breeds new solutions, by cloning or the combination of elements from parent organisms. By default, the crossover rate is 1.0 (100%), meaning that all children stem from crossover between two parents. The crossover is implemented on a argument-by-argument basis; in other words, crossover occurs between corresponding elements of the parent solutions.
a_population | - A population of solutions |
p_limit | - Maximum number of children |
Implements libevocosm::reproducer< function_solution >.
|
inline |
Returns the crossover rate set for this reproducer.
|
inline |
Assigns the state of one object to another.
a_source | - The source object |
© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.