Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IMutationStrategy.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 IMUTATIONSTRATEGY_H_
28 #define IMUTATIONSTRATEGY_H_
29 
30 //forward declarations
31 class Gen;
32 class GenContext;
33 class Individual;
35 
36 /**
37  * This interface gives the structur for the mutation of a gen.
38  */
40 public:
41  /**
42  * default constructor
43  */
45 
46  /**
47  * default destructor
48  */
49  virtual ~IMutationStrategy();
50 
51  /**
52  * mutate a gen
53  * @param context (GenContext*) the context in which the new gen comes (needed by the factory
54  * @param individual (Individual*) the individual, which the new gen becomes
55  * @param oldGen (Gen*) the old gen, which mutate
56  * @param oldContext (GenContext*) the Context in which the old gen are.
57  * @param factory (SingletonGenFactory*) the GenFactory which create the new gen.
58  * @return (Gen*) the new mutated gen
59  */
60  virtual Gen* mutate(GenContext* context, Individual* individual, Gen* oldGen, GenContext* oldContext, SingletonGenFactory* factory) = 0;
61 
62  /**
63  * gives the Probability of a mutation back.
64  * @return
65  */
66  virtual int getMutationProbability(void) = 0;
67 };
68 
69 #endif /* IMUTATIONSTRATEGY_H_ */
This is the factory for the class Gen.
Definition: SingletonGenFactory.h:43
This interface gives the structur for the mutation of a gen.
Definition: IMutationStrategy.h:39
The Gen class.
Definition: Gen.h:51
The GenContext class.
Definition: GenContext.h:51
virtual Gen * mutate(GenContext *context, Individual *individual, Gen *oldGen, GenContext *oldContext, SingletonGenFactory *factory)=0
mutate a gen
IMutationStrategy()
default constructor
Definition: IMutationStrategy.cpp:29
virtual ~IMutationStrategy()
default destructor
Definition: IMutationStrategy.cpp:33
virtual int getMutationProbability(void)=0
gives the Probability of a mutation back.
This class represent one individual of the complete gen.
Definition: Individual.h:45