The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
cObjectFitness.h
Go to the documentation of this file.
1
/**
2
* @file cObjectFitness
3
* file name: cObjectFitness.h
4
* @author Betti Oesterholz
5
* @date 26.02.2010
6
* @mail webmaster@BioKom.info
7
*
8
* System: C++
9
*
10
* This header specifies the abstract basisclass of enviroment object
11
* fitnesses.
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 the abstract basisclass of enviroment object
29
* fitnesses. This represents the fitness of a object which is a
30
* individuum in genetic algorithm (enviroment).
31
* The better (higher) the fitness the better the object, the more likly
32
* it should live and children should be created from it.
33
*
34
*/
35
/*
36
History:
37
26.02.2010 Oesterholz created
38
*/
39
40
#ifndef ___C_OBJECT_FITNESS_H__
41
#define ___C_OBJECT_FITNESS_H__
42
43
#include "version.h"
44
45
#include <string>
46
47
48
using
std::string;
49
50
namespace
enviroment{
51
52
//cyclic dependencies
53
class
cObjectFitnessAlgorithm;
54
55
56
class
cObjectFitness
{
57
58
friend
class
cObjectFitnessAlgorithm
;
59
60
protected
:
61
62
/**
63
* a value for the fitness of the object; the higher this value is the
64
* better the fitness of the associated object
65
*/
66
double
dFittness
;
67
68
/**
69
* the algorithm with which this fitness was created;
70
* if NULL no algorithm had created this object
71
*/
72
const
cObjectFitnessAlgorithm
*
pObjectFitnessAlgorithm
;
73
74
/**
75
* constructor
76
*
77
* @param dInFittness a value for the fitness of the object;
78
* the higher this value is the better the fitness
79
* @param pInObjectFitnessAlgorithm the algorithm with which this
80
* fitness was created; if NULL no algorithm had created this object;
81
* Beware: this object won't be copied, if you delete it
82
* getFitnessAlgorithm() will return an invalid pointer
83
*/
84
cObjectFitness
(
double
dInFittness,
85
const
cObjectFitnessAlgorithm
* pInObjectFitnessAlgorithm=NULL );
86
87
public
:
88
89
/**
90
* copyconstructor
91
*
92
* @param objectFitness the cObjectFitness object to copy
93
*/
94
cObjectFitness
(
const
cObjectFitness
& objectFitness );
95
96
/**
97
* Destructor of the class cObjectFitnessAlgorithm.
98
*/
99
virtual
~cObjectFitness
();
100
101
/**
102
* @return a value for the fitness of the associated object;
103
* the higher this value is the better the fitness
104
*/
105
virtual
double
getFitness
()
const
;
106
107
/**
108
* @return the name of this class
109
*/
110
virtual
string
getClassName
()
const
;
111
112
/**
113
* @return the algorithm with which this fitness was created;
114
* if NULL no algorithm had created this object
115
*/
116
const
cObjectFitnessAlgorithm
*
getFitnessAlgorithm
()
const
;
117
118
/**
119
* This Method clones this object.
120
*
121
* @return a clone of this object
122
*/
123
virtual
cObjectFitness
*
clone
()
const
;
124
125
/**
126
* Comparisson on equal method for two fitness objects.
127
*
128
* @param fitness the fitnessobject to compare this fitnessobject to
129
* @return true if the fitness this object represents is equal to the
130
* fitness the given object fitness represents
131
*/
132
virtual
bool
equal
(
const
cObjectFitness
&fitness )
const
;
133
134
/**
135
* Comparisson on equal operator for two fitness objects.
136
*
137
* @param fitness the fitnessobject to compare this fitnessobject to
138
* @return true if the fitness this object represents is equal to the
139
* fitness the given object fitness represents
140
*/
141
virtual
bool
operator==
(
const
cObjectFitness
&fitness )
const
;
142
143
/**
144
* Comparisson on lower operator for two fitness objects.
145
*
146
* @param fitness the fitnessobject to compare this fitnessobject to
147
* @return true if the fitness this object represents is lower to the
148
* fitness the given object fitness represents; the higher the
149
* fitness is, the better is the fitness of the associated object
150
*/
151
virtual
bool
operator<
(
const
cObjectFitness
&fitness )
const
;
152
153
154
155
};
//end class cObjectFitness
156
157
158
};
//end namespace enviroment
159
160
#endif //___C_OBJECT_FITNESS_H__
161
162
163
164
165
166
167
enviroment
incl
cObjectFitness.h
Generated on Thu Feb 14 2013 14:06:55 for The Fib multimedia system by
1.8.1