Robot Simulator of the Robotics Group for Self-Organization of Control
0.8.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
ValueMutationStrategy.h
Go to the documentation of this file.
1
/***************************************************************************
2
* Copyright (C) 2008-2011 LpzRobots development team *
3
* Joerg Weider <joergweide84 at aol dot com> (robot12) *
4
* Georg Martius <georg dot martius at web dot de> *
5
* Frank Guettler <guettler at informatik dot uni-leipzig dot de *
6
* Frank Hesse <frank at nld dot ds dot mpg dot de> *
7
* Ralf Der <ralfder at mis dot mpg dot de> *
8
* Joern Hoffmann <jhoffmann at informatik dot uni-leipzig dot de *
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
* This program is distributed in the hope that it will be useful, *
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18
* GNU General Public License for more details. *
19
* *
20
* You should have received a copy of the GNU General Public License *
21
* along with this program; if not, write to the *
22
* Free Software Foundation, Inc., *
23
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
24
* *
25
***************************************************************************/
26
27
#ifndef VALUEMUTATIONSTRATEGY_H_
28
#define VALUEMUTATIONSTRATEGY_H_
29
30
//forward declarations
31
class
Gen
;
32
class
Individual
;
33
class
GenContext
;
34
class
SingletonGenFactory
;
35
class
IMutationFactorStrategy
;
36
37
//ga_tools includes
38
#include "
IMutationStrategy.h
"
39
40
/**
41
* this mutation strategy clculate a mutation factor by using a
42
* mutation factor strategy an add this factor to the old gen.
43
*/
44
class
ValueMutationStrategy
:
public
IMutationStrategy
{
45
public
:
46
/**
47
* constructor
48
* @param strategy (IMutationFactorStrategy*) this strategie is used to calculate the mutation factor.
49
* @param mutationProbability (int) the mutation probability which is give back.
50
*/
51
ValueMutationStrategy
(
IMutationFactorStrategy
* strategy,
int
mutationProbability);
52
53
/**
54
* default destructor
55
*/
56
virtual
~ValueMutationStrategy
();
57
58
/**
59
* mutate a gen
60
* @param context (GenContext*) the context in which the new gen comes (needed by the factory
61
* @param individual (Individual*) the individual, which the new gen becomes
62
* @param oldGen (Gen*) the old gen, which mutate
63
* @param oldContext (GenContext*) the Context in which the old gen are.
64
* @param factory (SingletonGenFactory*) the GenFactory which create the new gen.
65
* @return (Gen*) the new mutated gen
66
*/
67
virtual
Gen
*
mutate
(
GenContext
* context,
Individual
* individual,
Gen
* oldGen,
GenContext
* oldContext,
SingletonGenFactory
* factory);
68
69
/**
70
* gives the Probability of a mutation back.
71
* @return
72
*/
73
virtual
int
getMutationProbability
(
void
);
74
75
protected
:
76
/**
77
* the mutation factor strategy
78
*/
79
IMutationFactorStrategy
*
m_strategy
;
80
81
/**
82
* the mutation probability
83
*/
84
int
m_mutationProbability
;
85
86
private
:
87
/**
88
* disable the default constructor
89
*/
90
ValueMutationStrategy
();
91
};
92
93
#endif
/* VALUEMUTATIONSTRATEGY_H_ */
SingletonGenFactory
This is the factory for the class Gen.
Definition:
SingletonGenFactory.h:43
IMutationStrategy
This interface gives the structur for the mutation of a gen.
Definition:
IMutationStrategy.h:39
ValueMutationStrategy
this mutation strategy clculate a mutation factor by using a mutation factor strategy an add this fac...
Definition:
ValueMutationStrategy.h:44
Gen
The Gen class.
Definition:
Gen.h:51
GenContext
The GenContext class.
Definition:
GenContext.h:51
IMutationFactorStrategy
This is a interface for a strategy, which is used by ValueMutationStrategy.
Definition:
IMutationFactorStrategy.h:40
ValueMutationStrategy::m_strategy
IMutationFactorStrategy * m_strategy
the mutation factor strategy
Definition:
ValueMutationStrategy.h:79
ValueMutationStrategy::~ValueMutationStrategy
virtual ~ValueMutationStrategy()
default destructor
Definition:
ValueMutationStrategy.cpp:46
ValueMutationStrategy::mutate
virtual Gen * mutate(GenContext *context, Individual *individual, Gen *oldGen, GenContext *oldContext, SingletonGenFactory *factory)
mutate a gen
Definition:
ValueMutationStrategy.cpp:50
ValueMutationStrategy::m_mutationProbability
int m_mutationProbability
the mutation probability
Definition:
ValueMutationStrategy.h:84
ValueMutationStrategy::getMutationProbability
virtual int getMutationProbability(void)
gives the Probability of a mutation back.
Definition:
ValueMutationStrategy.cpp:61
Individual
This class represent one individual of the complete gen.
Definition:
Individual.h:45
IMutationStrategy.h
ga_tools
MutationStrategies
ValueMutationStrategy.h
Generated on Mon Jan 12 2015 09:40:56 for Robot Simulator of the Robotics Group for Self-Organization of Control by
1.8.6