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
cIndividualInfo.h
Go to the documentation of this file.
1 /**
2  * @file cIndividualInfo
3  * file name: cIndividualInfo.h
4  * @author Betti Oesterholz
5  * @date 28.02.2010
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This header specifies a class for information about individals.
11  * Copyright (C) @c GPL3 2010 Betti Oesterholz
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License (GPL) as
15  * published by the Free Software Foundation, either version 3 of the
16  * License, or any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program. If not, see <http://www.gnu.org/licenses/>.
25  *
26  *
27  * This header specifies a class for information about individals.
28  * @see cIndividual
29  *
30  */
31 /*
32 History:
33 28.02.2010 Oesterholz created
34 */
35 
36 #ifndef ___C_INDIVIDUAL_INFO_H__
37 #define ___C_INDIVIDUAL_INFO_H__
38 
39 
40 #include "version.h"
41 
42 #include "cIndividualIdentifier.h"
43 #include "cOperationIdentifier.h"
44 #include "cObjectFitness.h"
45 
46 #include <string>
47 #include <list>
48 #include <ctime>
49 
50 using namespace std;
51 
52 namespace enviroment{
53 
54 
56 
57 friend class cEnviroment;
58 friend class cIndividual;
59 
60 protected:
61 
62  /**
63  * the identifier of a individual, wich is unique for all individuals
64  */
66 
67  /**
68  * if true the individual is living;
69  * then a object should exists for it;
70  * if false the individual info exists for giving information about an
71  * object that dosn't exists anymore
72  */
73  bool bIsLiving;
74 
75  /**
76  * the list with the identifiers of the parent individuals of the
77  * individual for which this info is
78  */
79  list<cIndividualIdentifier> liIdsParents;
80 
81  /**
82  * the pFitness of the individual
83  */
85 
86  /**
87  * the name of the operation which created the individual
88  */
90 
91  /**
92  * some more information about the operation which created the
93  * individual; like: parameters or used algorithms
94  */
96 
97  /**
98  * the identifier of the operation which created the individual
99  */
101 
102  /**
103  * the time_t when the individual was created;
104  * this is the time_t, when the individual was inserted in the enviroment
105  */
106  time_t creationTime;
107 
108  /**
109  * the cost for the creation of the individual;
110  * this should be a value which is sytem independent
111  */
113 
114  /**
115  * the pFitness of the best individual, at the time_t the individual was
116  * created
117  */
119 
120 public:
121 
122  /**
123  * constructor
124  *
125  * @param ulAlgorithmIdentifier the identifier of the enviroment
126  * instantiation
127  * @param liIdentifierOfParents the list with the identifiers of the
128  * parent individuals of the individual for which this info is
129  * @param pFitness the pFitness of the individual
130  * @param szOperationName the name of the operation which created the
131  * individual
132  * @param szOperationInfo some more information about the operation
133  * which created the individual
134  * @param operationIdentifier the identifier of the operation which
135  * created the individual
136  * @param creationTime the time_t when the individual was created
137  * @param dOperationCost the cost for the creation of the individual
138  * @param inFitnessOfBestAtCreationTime the pFitness of the best
139  * individual, at the time_t the individual was created
140  */
141  cIndividualInfo( unsigned long ulAlgorithmIdentifier,
142  const list<cIndividualIdentifier> & liIdentifierOfParents,
143  const cObjectFitness & inFitness,
144  const string & szOperationName, const string & szOperationInfo,
145  const cOperationIdentifier & operationIdentifier,
146  time_t inCreationTime, double dOperationCost,
147  const cObjectFitness * inFitnessOfBestAtCreationTime );
148 
149  /**
150  * copyconstructor
151  *
152  * @param individualInfo the cIndividualInfo to copy
153  */
154  cIndividualInfo( const cIndividualInfo & individualInfo );
155 
156  /**
157  * destructor
158  */
159  virtual ~cIndividualInfo();
160 
161  /**
162  * @see idIndividual
163  * @return the identifier of a individual
164  */
165  cIndividualIdentifier getIdentifier() const;
166 
167  /**
168  * @see kill()
169  * @see bIsLiving
170  * @return true if the object is living, else false
171  */
172  bool isLiving() const;
173 
174  /**
175  * @see liIdsParents
176  * @return the list with the identifiers of the parent individuals of
177  * the individual for which this info is
178  */
179  list<cIndividualIdentifier> getIdentifiersOfParents() const;
180 
181  /**
182  * @see pFitness
183  * @return a pointer to the pFitness of the individual
184  */
185  const cObjectFitness * getFitness() const;
186 
187  /**
188  * @see szCreatingOperationName
189  * @return the name of the operation which created the individual
190  */
191  string getOperatorName() const;
192 
193  /**
194  * @see szCreatingOperationInfo
195  * @return some more information about the operation which created
196  * the individual
197  */
198  string getOperatorInfo() const;
199 
200  /**
201  * @see idCreatingOperation
202  * @return the identifier of the operation which created the individual
203  */
204  cOperationIdentifier getOperatorIdentifier() const;
205 
206  /**
207  * @see creationTime
208  * @return the time_t when the individual was created
209  */
210  time_t getCreationTime() const;
211 
212  /**
213  * @see dCreationOperationCost
214  * @return the cost for the creation of the individual
215  */
216  double getOperationCost() const;
217 
218  /**
219  * @see pFitnessOfBestAtCreationTime
220  * @return a pointer to the pFitness of the best individual, at the time_t
221  * the individual was created
222  */
223  const cObjectFitness * getFitnessOfBestAtCreationTime() const;
224 
225  /**
226  * Comparisson on equal method for two cIndividualInfo objects.
227  *
228  * @param idIndividual the idIndividualobject to compare this
229  * idIndividualobject to
230  * @param checkIdentifiers if true (standradvalue) the identifiers will
231  * be checked also, else not
232  * @return true if the cIndividualInfo this object represents is
233  * equal to the cIndividualInfo the given object idIndividual
234  * represents
235  */
236  virtual bool equal( const cIndividualInfo &idIndividual,
237  bool checkIdentifiers=true ) const;
238 
239  /**
240  * Comparisson on equal operator for two cIndividualInfo objects.
241  *
242  * @param idIndividual the idIndividualobject to compare this
243  * idIndividualobject to
244  * @return true if the cIndividualInfo this object represents is
245  * equal to the cIndividualInfo the given object idIndividual
246  * represents
247  */
248  bool operator==( const cIndividualInfo &idIndividual ) const;
249 
250  /**
251  * Comparisson on not equal operator for two cIndividualInfo objects.
252  *
253  * @param idIndividual the idIndividualobject to compare this
254  * idIndividualobject to
255  * @return true if the cIndividualInfo this object represents is
256  * not equal to the cIndividualInfo the given object idIndividual
257  * represents
258  */
259  bool operator!=( const cIndividualInfo &idIndividual ) const;
260 
261  /**
262  * This method clones this object.
263  *
264  * @return a clone of this object
265  */
266  virtual cIndividualInfo * clone() const;
267 
268 
269 #ifndef TEST
270 protected:
271 #endif
272  /**
273  * This method kills the individual, so it isn't living anymor.
274  * (The method dosn't change or deletes the object of the individual,
275  * but sets it's status to not living.)
276  *
277  * @see isLiving()
278  * @see bIsLiving
279  * @return true if the individal was killed, else false
280  */
281  bool kill();
282 
283 
284 };//end class cIndividualInfo
285 
286 
287 };//end namespace enviroment
288 
289 #endif //___C_INDIVIDUAL_INFO_H__
290 
291 
292 
293 
294 
295 
296