-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathFCMPrey.h
More file actions
191 lines (165 loc) · 6.9 KB
/
FCMPrey.h
File metadata and controls
191 lines (165 loc) · 6.9 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#ifndef FCMPREY_H_
#define FCMPREY_H_
//-- If uncomment TWO_RESOURCES -> world has to kind of Grass
//#define TWO_RESOURCES
#include "FCM.h"
class Ecosystem;
class Predator;
class Prey;
using namespace std;
class FCMPrey : public FCM{
public:
/*******
*New FCM
********/
#ifdef TWO_RESOURCES
const static int PredClose = 0;
const static int PredFar = 1;
const static int FoodClose = 2;
const static int FoodFar = 3;
const static int FoodClose2 = 4;
const static int FoodFar2 = 5;
const static int FriendClose = 6;
const static int FriendFar = 7;
const static int EnergyLow = 8;
const static int EnergyHigh = 9;
const static int FoodLocalHigh = 10;
const static int FoodLocalLow = 11;
const static int FoodLocalHigh2 = 12;
const static int FoodLocalLow2 = 13;
const static int PartnerLocalYes = 14;
const static int PartnerLocalNo = 15;
const static int StrengthPreyCellLocalHigh = 16; //A.G
const static int StrengthPreyCellLocalLow = 17; //A.G
const static int AgeLow = 18; //A.G
const static int AgeHigh = 19; //A.G
const static int StrengthStrongestPreyCellDistanceLow = 20; //A.G
const static int StrengthStrongestPreyCellDistanceHigh = 21; //A.G
const static int StrengthStrongestPreyLocalLow = 22; //A.G
const static int StrengthStrongestPreyLocalHigh = 23; //A.G
const static int StrengthLow = 24; //A.G
const static int StrengthHigh = 25; //A.G
const static int Fear = 26;
const static int Hunger = 27;
const static int SearchPartner = 28;
const static int Curiosity = 29;
const static int Sedentary = 30;
const static int Satisfaction = 31;
const static int Nuisance = 32;
const static int Escape = 33;
const static int SearchFood = 34;
const static int SearchFood2 = 35;
const static int Socialize = 36;
const static int Exploration = 37;
const static int Wait = 38;
const static int Eat = 39;
const static int Eat2 = 40;
const static int Reproduce = 41;
const static int Move2StrongestPrey = 42; //A.G
const static int Move2StrongestPreyCell = 43; //A.G
const static int Move2WeakestPreyCell = 44; //A.G
//const static int Decision = 32;
const static int NbActions = 21;
const static int EscapeAction = 1;
const static int SearchFoodAction = 2;
const static int SearchFoodFailAction = 3;
const static int SearchFood2Action = 4;
const static int SearchFoodFail2Action = 5;
const static int SocializeAction = 6;
const static int SocializeFailAction = 7;
const static int ExplorationAction = 8;
const static int WaitAction = 9;
const static int EatAction = 10;
const static int EatFailAction = 11;
const static int Eat2Action = 12;
const static int EatFail2Action = 13;
const static int ReproduceAction = 14;
const static int ReproduceFailAction = 15;
const static int Move2StrongestPreyAction = 16; //A.G
const static int Move2StrongestPreyFailAction = 17; //A.G
const static int Move2StrongestPreyCellAction = 18; //A.G
const static int Move2StrongestPreyCellFailAction = 19; //A.G
const static int Move2WeakestPreyCellAction = 20; //A.G
const static int Move2WeakestPreyCellFailAction = 21; //A.G
#else
/*******
*OLD FCM
********/
const static int PredClose = 0;
const static int PredFar = 1;
const static int FoodClose = 2;
const static int FoodFar = 3;
const static int FriendClose = 4;
const static int FriendFar = 5;
const static int EnergyLow = 6;
const static int EnergyHigh = 7;
const static int FoodLocalHigh = 8;
const static int FoodLocalLow = 9;
const static int PartnerLocalYes = 10;
const static int PartnerLocalNo = 11;
const static int StrengthPreyCellLocalLow = 12; //A.G
const static int StrengthPreyCellLocalHigh = 13; //A.G
const static int AgeLow = 14; //A.G
const static int AgeHigh = 15; //A.G
const static int StrengthStrongestPreyCellDistanceLow = 16; //A.G
const static int StrengthStrongestPreyCellDistanceHigh = 17; //A.G
const static int StrengthStrongestPreyLocalLow = 18; //A.G
const static int StrengthStrongestPreyLocalHigh = 19; //A.G
const static int StrengthLow = 20; //A.G
const static int StrengthHigh = 21; //A.G
const static int Fear = 22;
const static int Hunger = 23;
const static int SearchPartner = 24;
const static int Curiosity = 25;
const static int Sedentary = 26;
const static int Satisfaction = 27;
const static int Nuisance = 28;
const static int Escape = 29;
const static int SearchFood = 30;
const static int Socialize = 31;
const static int Exploration = 32;
const static int Wait = 33;
const static int Eat = 34;
const static int Reproduce = 35;
const static int Move2StrongestPrey = 36; //A.G
const static int Move2StrongestPreyCell = 37; //A.G
const static int Move2WeakestPreyCell = 38; //A.G
// const static int Decision = 26;
const static int NbActions = 17;
const static int EscapeAction = 1;
const static int SearchFoodAction = 2;
const static int SearchFoodFailAction = 3;
const static int SocializeAction = 4;
const static int SocializeFailAction = 5;
const static int ExplorationAction = 6;
const static int WaitAction = 7;
const static int EatAction = 8;
const static int EatFailAction = 9;
const static int ReproduceAction = 10;
const static int ReproduceFailAction = 11;
const static int Move2StrongestPreyAction = 12; //A.G
const static int Move2StrongestPreyFailAction = 13; //A.G
const static int Move2StrongestPreyCellAction = 14; //A.G
const static int Move2StrongestPreyCellFailAction = 15; //A.G
const static int Move2WeakestPreyCellAction = 16; //A.G
const static int Move2WeakestPreyCellFailAction = 17; //A.G
#endif
static short nbSens; //-- Number of concepts about direction
static short nbConcepts; //-- Number of concepts about emotions
static short nbMoteursDep;
static short nbMoteursFix;
static short nbNodes;
static vector<vector<float> > fuzzyfication_params1;
static vector<vector<float> > fuzzyfication_params2;
static void static_init (short nbSens, short nbConcepts, short nbMoteursDep, short nbMoteursFix);
Prey * prey;
FCMPrey();
FCMPrey(Prey *p);
FCMPrey(vector<vector<FCM_TYPE> > * chart, vector<float> *activations, Prey *p);
virtual ~FCMPrey();
void updateConcepts();
int choose_action(Ecosystem *eco);
short percept_prey(Ecosystem * eco);
void set_prey(Prey *prey);
};
#endif /* FCMPREY_H_ */