-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cell.cpp
84 lines (75 loc) · 1.37 KB
/
Cell.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
//==============================
// INCLUDES
//==============================
#include "Cell.h"
//==============================
// DEFINITION STATIC ATTRIBUTES
//==============================
float Cell::rAA_ = 0;
float Cell::rAB_ = 0;
float Cell::rBB_ = 0;
float Cell::rBC_ = 0;
float Cell::min_fit_ = 0;
//==============================
// CONSTRUCTORS
//=============================
Cell::Cell()
{
cA_ = 0;
cB_ = 0;
cC_ = 0;
}
Cell::Cell(float cAi, float cBi, float cCi)
{
cA_ = cAi;
cB_ = cBi;
cC_ = cCi;
}
//==============================
// DESTRUCTOR
//==============================
Cell::~Cell(){}
//==============================
// PUBLIC METHODS
//==============================
char Cell::whatAmI()
/*
Give the type of the cell
*/
{
switch(geno_)
{
case GenA : return 'A'; break;
case GenB : return 'B'; break;
}
}
void Cell::set_c(float cAi, float cBi, float cCi)
/*
Update concentration of the cell
*/
{
cA_ = cAi;
cB_ = cBi;
cC_ = cCi;
this->compute_fitness();
}
//==============================
// PROTECTED METHODS
//==============================
void Cell::set_rates(float rAA, float rAB, float rBB, float rBC)
/*
define metabolism rates (Class fonction)
*/
{
rAA_ = rAA;
rAB_ = rAB;
rBB_ = rBB;
rBC_ = rBC;
}
void Cell::set_min_fit(float mf)
/*
set minimum fitness (Class fonction)
*/
{
min_fit_ = mf;
}