Robot Simulator of the Robotics Group for Self-Organization of Control: ValueMutationStrategy Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# ValueMutationStrategy Class Reference

this mutation strategy clculate a mutation factor by using a mutation factor strategy an add this factor to the old gen. More...

`#include <ValueMutationStrategy.h>`

Inherits IMutationStrategy.

Inheritance diagram for ValueMutationStrategy:

[legend]
Collaboration diagram for ValueMutationStrategy:

[legend]
List of all members.

## 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

## Detailed Description

this mutation strategy clculate a mutation factor by using a mutation factor strategy an add this factor to the old gen.

## Constructor & Destructor Documentation

ValueMutationStrategy | ( | IMutationFactorStrategy * | strategy,
|  | int | mutationProbability |
| ) |  |  |

constructor

Parameters:

  | strategy | (IMutationFactorStrategy*) this strategie is used to calculate the mutation factor.
  | mutationProbability | (int) the mutation probability which is give back.

~ValueMutationStrategy | ( |  | ) | `[virtual]`

default destructor

## Member Function Documentation

int getMutationProbability | ( | void |  | ) | `[virtual]`

gives the Probability of a mutation back.

Returns:

Implements IMutationStrategy.

Gen * mutate | ( | GenContext * | context,
|  | Individual * | individual,
|  | Gen * | oldGen,
|  | GenContext * | oldContext,
|  | SingletonGenFactory * | factory |
| ) |  |  | `[virtual]`

mutate a gen

Parameters:

  | 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.

Returns:
  (Gen*) the new mutated gen

Implements IMutationStrategy.

## Member Data Documentation

int m_mutationProbability`[protected]`

the mutation probability

IMutationFactorStrategy* m_strategy`[protected]`

the mutation factor strategy

The documentation for this class was generated from the following files:

- ValueMutationStrategy.h
- ValueMutationStrategy.cpp