RandomBit Class Reference
Inheritance diagram for RandomBit:

Public Member Functions | |
RandomBit () | |
Constructor. | |
virtual | ~RandomBit () |
Destructor. | |
virtual void | mutate (Genotype *) |
Mutate the Genotype. | |
Static Public Member Functions | |
static void | describe (QString type) |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups. |
Detailed Description
- Description
- Change the i-th bit with a random one with mutationRate probability.
The new bit is extracted with an equal probability for zero and one.
This differ from FlipBit for at least two points:- it requires the double of random access (extractions)
- if a mutation occur, it remains a 50% probability that bit remain the same
- Warnings
Definition at line 40 of file randombit.h.
Constructor & Destructor Documentation
RandomBit | ( | ) |
Constructor.
Definition at line 26 of file randombit.cpp.
~RandomBit | ( | ) | [virtual] |
Destructor.
Definition at line 30 of file randombit.cpp.
Member Function Documentation
void describe | ( | QString | type | ) | [static] |
Add to Factory::typeDescriptions() the descriptions of all parameters and subgroups.
Reimplemented from Mutation.
Definition at line 47 of file randombit.cpp.
References ParameterSettable::addTypeDescription().
void mutate | ( | Genotype * | gen | ) | [virtual] |
Mutate the Genotype.
Implements Mutation.
Definition at line 34 of file randombit.cpp.
References RandomGenerator::getBool(), globalRNG, Mutation::mutationRate(), Genotype::set(), Genotype::size(), and Genotype::unset().
The documentation for this class was generated from the following files:
- ga/include/mutations/randombit.h
- ga/src/mutations/randombit.cpp