-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFoodSource.cpp
87 lines (72 loc) · 1.47 KB
/
FoodSource.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "FoodSource.h"
FoodSource::FoodSource() : d_coords{}, d_objectifValue{ 0 }, d_fitnessValue{ 0 }, d_trial{ 0 } {}
FoodSource::FoodSource(vector<double> coords, double objectifValue, double fitnessValue, int trial) :
d_coords{ coords }, d_objectifValue{ objectifValue }, d_fitnessValue{ fitnessValue }, d_trial{ trial }
{}
//
// GEILLER Valentin
//
double FoodSource::getCoordAt(int i) const {
return d_coords[i];
}
//
// MUHIRWA GABO Oreste
//
vector<double> FoodSource::getCoords() const {
return d_coords;
}
//
// GEILLER Valentin
//
double FoodSource::getObjectifValue() const {
return d_objectifValue;
}
//
// GEILLER Valentin
//
double FoodSource::getFitnessValue() const {
return d_fitnessValue;
}
//
// GEILLER Valentin
//
int FoodSource::getTrial() const {
return d_trial;
}
//
// GEILLER Valentin
//
void FoodSource::setCoordAt(int i, double valeur) {
d_coords[i] = valeur;
}
//
// GEILLER Valentin
//
void FoodSource::setObjectifValue(double objectifValue) {
d_objectifValue = objectifValue;
}
//
// GEILLER Valentin
//
void FoodSource::setFitnessValue(double fitnessValue) {
d_fitnessValue = fitnessValue;
}
//
// GEILLER Valentin
//
void FoodSource::incrementeTrial() {
d_trial++;
}
//
// GEILLER Valentin
//
void FoodSource::resetTrial() {
d_trial = 0;
}
//
// MUHIRWA GABO Oreste
//
void FoodSource::printFoodSource() const {
std::cout << "Objectif Value : " << d_objectifValue << std::endl;
std::cout << "Fitness Value : " << d_fitnessValue << std::endl;
}