Implements reproduction.
More...
#include <function_optimizer.h>
Additional Inherited Members |
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 size_t | rand_index (size_t n) |
| Static function to allow use of g_random function pointer in random_shuffle.
|
Detailed Description
Handles reproduction for solutions.
Constructor & Destructor Documentation
libevocosm::function_reproducer::function_reproducer |
( |
double |
p_crossover_rate = 1.0 | ) |
|
|
inline |
Creates a new reproducer with a given crossover rate.
Duplicates an existing object.
- Parameters
-
a_source | - The source object |
virtual libevocosm::function_reproducer::~function_reproducer |
( |
| ) |
|
|
inlinevirtual |
Satisfies the requirements of the base class; does nothing at this time.
Member Function Documentation
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.
- Parameters
-
a_population | - A population of solutions |
p_limit | - Maximum number of children |
- Returns
- A vector containing new "child" chromosomes
Implements libevocosm::reproducer< function_solution >.
double libevocosm::function_reproducer::crossover_rate |
( |
| ) |
const |
|
inline |
Returns the crossover rate set for this reproducer.
- Returns
- Crossover rate
Assigns the state of one object to another.
- Parameters
-
a_source | - The source object |
- Returns
- A reference to this
The documentation for this class was generated from the following file: