#include <ValueMutationStrategy.h>
Inherits IMutationStrategy.
Inheritance diagram for ValueMutationStrategy:
Public Member Functions | |
ValueMutationStrategy (IMutationFactorStrategy *strategy, int mutationProbability) | |
constructor | |
virtual | ~ValueMutationStrategy () |
default destructor | |
virtual Gen * | mutate (GenContext *context, Individual *individual, Gen *oldGen, GenContext *oldContext, SingletonGenFactory *factory) |
mutate a gen | |
virtual int | getMutationProbability (void) |
gives the Probability of a mutation back. | |
Protected Attributes | |
IMutationFactorStrategy * | m_strategy |
the mutation factor strategy | |
int | m_mutationProbability |
the mutation probability |
ValueMutationStrategy | ( | IMutationFactorStrategy * | strategy, | |
int | mutationProbability | |||
) |
constructor
strategy | (IMutationFactorStrategy*) this strategie is used to calculate the mutation factor. | |
mutationProbability | (int) the mutation probability which is give back. |
~ValueMutationStrategy | ( | ) | [virtual] |
default destructor
int getMutationProbability | ( | void | ) | [virtual] |
Gen * mutate | ( | GenContext * | context, | |
Individual * | individual, | |||
Gen * | oldGen, | |||
GenContext * | oldContext, | |||
SingletonGenFactory * | factory | |||
) | [virtual] |
mutate a gen
context | (GenContext*) the context in which the new gen comes (needed by the factory | |
individual | (Individual*) the individual, which the new gen becomes | |
oldGen | (Gen*) the old gen, which mutate | |
oldContext | (GenContext*) the Context in which the old gen are. | |
factory | (SingletonGenFactory*) the GenFactory which create the new gen. |
Implements IMutationStrategy.
int m_mutationProbability [protected] |
the mutation probability
IMutationFactorStrategy* m_strategy [protected] |
the mutation factor strategy