Created by Scott Robert Ladd at Coyote Gulch Productions.
Wraps a roulette wheel for selecting mutations. More...
#include <machine_tools.h>
Public Member Functions | |
mutation_selector () | |
Creation constructor. More... | |
mutation_selector (const mutation_selector &a_source) | |
Copy constructor. More... | |
~mutation_selector () | |
Destructor. More... | |
mutation_selector & | operator= (const mutation_selector &a_source) |
Assignment operator. More... | |
void | set_weight (mutation_id a_type, double &a_new_weight) |
Change a given weight. More... | |
size_t | get_index () const |
Get a mutation index. | |
This class encapsulates a roulette wheel for selecting mutations. By default, the simple_fsm::mutate operator uses a pre-defined mutation_selector with default percentages of:
The default values were chosen based on my past experience. You can define your own mutation_selector with different weights, and pass it to simple_fsm::mutate.
|
inline |
Constructs a new mutation_selector with the default weights for the roulette wheel.
|
inline |
Creates a copy of an existing object.
a_source | - The source object to be copied |
|
inline |
Destroys a mutation selector, freeing resources.
|
inline |
Assigns the state of one mutation selector to another.
a_source | - The source object |
|
inline |
Changes a specific mutation weight to a new value.
a_type | - Identifies the specific mutation weight to be set |
a_new_weight | - New weight to be assigned |
References libevocosm::roulette_wheel::set_weight().
© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.