The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cOperatorFitnessAlgorithm.h
Go to the documentation of this file.
1 /**
2  * @file cOperatorFitnessAlgorithm
3  * file name: cOperatorFitnessAlgorithm.h
4  * @author Betti Oesterholz
5  * @date 22.03.2010
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This header specifies a abstract class for gernerating the fitness for
11  * operators.
12  * Copyright (C) @c GPL3 2010 Betti Oesterholz
13  *
14  * This program is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License (GPL) as
16  * published by the Free Software Foundation, either version 3 of the
17  * License, or any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program. If not, see <http://www.gnu.org/licenses/>.
26  *
27  *
28  * This header specifies a abstract class for gernerating the fitness for
29  * operators.
30  * The fitness of operators is evalued by considering the information about
31  * the individuals the operation has created.
32  *
33  * @see cOperator
34  * @see cEnviroment
35  * @see cChoosOperator
36  */
37 /*
38 History:
39 22.03.2010 Oesterholz created
40 */
41 
42 
43 #ifndef ___C_OPERATION_FITNESS_ALGORITHM_H__
44 #define ___C_OPERATION_FITNESS_ALGORITHM_H__
45 
46 #include "version.h"
47 
48 #include "cOperation.h"
49 #include "cIndividualInfo.h"
50 
51 #include <string>
52 #include <list>
53 
54 using namespace std;
55 
56 namespace enviroment{
57 
58 
60 public:
61 
62  /**
63  * Destructor of the class cOperatorFitnessAlgorithm.
64  */
65  virtual ~cOperatorFitnessAlgorithm() = 0;
66 
67  /**
68  * This method evalues the fitness of the given operator operation new.
69  *
70  * @param operation the operator for which the fitness is to be evalued new
71  * @param liCreatedIndividualInfos a list with all informations about
72  * all individuals the operator has created
73  * @return the new evalued fitness of the operation
74  */
75  virtual double evalueFitness( const cOperation & operation,
76  const list<cIndividualInfo> &liCreatedIndividualInfos ) = 0;
77 
78 
79  /**
80  * This method updates the fitness of the given operator operation.
81  * For this update the information this cOperatorFitnessAlgorithm
82  * object knows about the operation and the given
83  * createdIndividualInfo is considered to evalue the new fitness.
84  *
85  * @param operation the operator, for which the fitness is to be updated
86  * @param createdIndividualInfo the information about an individual
87  * the operator has created and which is not jet known by this
88  * cOperatorFitnessAlgorithm object
89  * @return the new evalued fitness of the operation
90  */
91  virtual double updateFitness( const cOperation & operation,
92  const cIndividualInfo &createdIndividualInfo ) = 0;
93 
94  /**
95  * This method updates the fitness of the given operator operation.
96  * For this update the information this cOperatorFitnessAlgorithm
97  * object knows about the operation and the given information in
98  * liCreatedIndividualInfos is considered to evalue the new fitness.
99  *
100  * @param operation the operator, for which the fitness is to be updated
101  * @param liCreatedIndividualInfos a list with the information about
102  * the individuals the operator has created and which are not jet
103  * known by this cOperatorFitnessAlgorithm object
104  * @return the new evalued fitness of the operation
105  */
106  virtual double updateFitness( const cOperation & operation,
107  const list<cIndividualInfo> &liCreatedIndividualInfos ) = 0;
108 
109  /**
110  * This method returns the fitness of the given operator operation.
111  * This also can include a new evaluation of the fitnessvalue with the
112  * information this cOperatorFitnessAlgorithm object knows about the operator.
113  *
114  * @param operation the operator for which the fitness is to be returned
115  * @return the fitness of the operation
116  */
117  virtual double getFitness( const cOperation & operation ) = 0;
118 
119  /**
120  * This method returns the fitness of all operators.
121  * This also can include a new evaluation of the fitnessvalue with the
122  * information this cOperatorFitnessAlgorithm object knows about the
123  * operators.
124  *
125  * @return a list with all possible operators with ther fitness
126  */
127  virtual list< pair< const cOperation*, double > > getFitness() = 0;
128 
129  /**
130  * @return the class name of this object
131  */
132  virtual string getClassName() const;
133 
134  /**
135  * @return a list with all possible operators
136  */
137  virtual list<const cOperation*> getPossibleOperators() const;
138 
139  /**
140  * @return the minimal fitness which this object can evalue
141  */
142  virtual double getMinFitness() const = 0;
143 
144  /**
145  * @return the sum of all fitnessvalues of all operators
146  */
147  virtual double getFitnessSum() const = 0;
148 
149 
150  /**
151  * This method clones this object.
152  *
153  * @return a clone of this object
154  */
155  virtual cOperatorFitnessAlgorithm * clone() const = 0;
156 
157 
158 
159 };//end class cOperatorFitnessAlgorithm
160 
161 
162 };//end namespace enviroment
163 
164 #endif //___C_OPERATION_FITNESS_ALGORITHM_H__
165 
166 
167 
168 
169 
170 
171