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
StandartGenerationSizeStrategy.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 STANDARTGENERATIONSIZESTRATEGY_H_
28 #define STANDARTGENERATIONSIZESTRATEGY_H_
29 
30 //forward declaration
31 class Generation;
32 
33 //ga_tools includes
35 
36 /**
37  * this class calculate the new generation size over the enhancement speed
38  */
40 public:
41  /**
42  * constructor
43  * @param startSize (int) is the size of the first generation. is needed as basic of the calculation
44  * @param numGeneration (int) is the number of generation which the alg. will be create
45  */
46  StandartGenerationSizeStrategy(int startSize, int numGeneration);
47 
48  /**
49  * default destructor
50  */
52 
53  /**
54  * this function calculate the new generation size
55  * @param oldGeneration (Generation*) the old generation
56  * @return (int) the new generation size
57  */
58  virtual int calcGenerationSize(Generation* oldGeneration);
59 
60 protected:
61  /**
62  * is the first generation over?
63  */
65 
66  /**
67  * the start size of the first generation
68  */
70 
71  /**
72  * the number of generation
73  */
75 
76  /**
77  * the best value of the first generation
78  */
79  double m_best_first;
80 
81  /**
82  * the best value of the last generation.
83  */
84  double m_best_old;
85 
86  /**
87  * the best value of the new generation.
88  */
89  double m_best_new;
90 
91 private:
92  /**
93  * disable the default constructor
94  */
96 };
97 
98 #endif /* STANDARTGENERATIONSIZESTRATEGY_H_ */
double m_best_first
the best value of the first generation
Definition: StandartGenerationSizeStrategy.h:79
virtual ~StandartGenerationSizeStrategy()
default destructor
Definition: StandartGenerationSizeStrategy.cpp:51
double m_best_new
the best value of the new generation.
Definition: StandartGenerationSizeStrategy.h:89
bool m_firstIsSet
is the first generation over?
Definition: StandartGenerationSizeStrategy.h:64
virtual int calcGenerationSize(Generation *oldGeneration)
this function calculate the new generation size
Definition: StandartGenerationSizeStrategy.cpp:55
int m_startSize
the start size of the first generation
Definition: StandartGenerationSizeStrategy.h:69
This interface is to specify how big the next generation should be.
Definition: IGenerationSizeStrategy.h:36
The Generation class.
Definition: Generation.h:53
double m_best_old
the best value of the last generation.
Definition: StandartGenerationSizeStrategy.h:84
int m_numGeneration
the number of generation
Definition: StandartGenerationSizeStrategy.h:74
this class calculate the new generation size over the enhancement speed
Definition: StandartGenerationSizeStrategy.h:39