-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathOrganism.h
More file actions
372 lines (357 loc) · 13.1 KB
/
Copy pathOrganism.h
File metadata and controls
372 lines (357 loc) · 13.1 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
#ifndef ORGANISM_H
#define ORGANISM_H
#include <string>
#include <optional>
#include "ConfigSetup.h"
#include "emp/Evolve/Systematics.hpp"
#include "TaxonData.h"
class Organism {
public:
using taxon_info_t = double;
Organism() = default;
Organism(const Organism &) = default;
Organism(Organism &&) = default;
virtual ~Organism() {}
Organism & operator=(const Organism &) = default;
Organism & operator=(Organism &&) = default;
virtual bool operator<(const Organism &other) const {
std::cout << "operator< called from Organism" << std::endl;
throw "Organism method called!";
};
virtual bool operator==(const Organism& other) const {
return (this == &other);
}
bool operator!=(const Organism& other) const {
return !(*this == other);
}
virtual std::string const GetName() const {
std::cout << "GetName called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double GetIntVal() const {
std::cout << "GetIntVal called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double GetPoints() const {
std::cout << "GetPoints called from Organism" << std::endl;
throw "Organism method called!";
}
virtual emp::WorldPosition GetLocation() const {
std::cout << "GetLocation called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetIntVal(double _in) {
std::cout << "SetIntVal called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetPoints(double _in) {
std::cout << "SetPoints called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetLocation(emp::WorldPosition _in) {
std::cout << "SetLocation called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void AddPoints(double _in) {
std::cout << "AddPoints called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetHost(emp::Ptr<Organism> _in) {
std::cout << "SetHost called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetDead() {
std::cout << "SetDead called from Organism" << std::endl;
throw "Organism method called!";
}
virtual bool GetDead() const {
std::cout << "GetDead called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void Process(emp::WorldPosition location) {
std::cout << "Process called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double GetIncVal() const {
std::cout << "GetIncVal called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetIncVal(double _in) {
std::cout << "SetIncVal called from Organism" << std::endl;
throw "Organism method called!";
}
virtual int GetAge() const {
std::cout << "GetAge called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetAge(int _in) {
std::cout << "SetAge called from Organism" << std::endl;
throw "Organism method called!";
}
virtual emp::Ptr<Organism> MakeNew() {
std::cout << "MakeNew called from Organism" << std::endl;
throw "Organism method called!";
}
virtual emp::BitSet<TAG_LENGTH>& GetTag() {
std::cout << "GetTag called from Organism" << std::endl;
throw "Organism method called!";
}
virtual const emp::BitSet<TAG_LENGTH>& GetTag() const {
std::cout << "GetTag const called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetTag(const emp::BitSet<TAG_LENGTH>& _in) {
std::cout << "SetTag called from Organism" << std::endl;
throw "Organism method called!";
}
virtual size_t GetReproCount() const {
std::cout << "GetReproCount called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetReproCount(size_t _in) {
std::cout << "SetReproCount called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetTowardsPartnerCount(size_t _in) {
std::cout << "SetTowardsPartnerCount called from Organism" << std::endl;
throw "Organism method called!";
}
virtual size_t GetTowardsPartnerCount() const {
std::cout << "GetTowardsPartnerCount called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetFromPartnerCount(size_t _in) {
std::cout << "SetFromPartnerCount called from Organism" << std::endl;
throw "Organism method called!";
}
virtual size_t GetFromPartnerCount() const {
std::cout << "GetFromPartnerCount called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetTagPermissiveness(double _in) {
std::cout << "SetTagPermissiveness called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double GetTagPermissiveness() const {
std::cout << "GetTagPermissiveness called from Organism" << std::endl;
throw "Organism method called!";
}
//Symbiont functions
virtual void Mutate() {
std::cout << "Mutate called from Organism" << std::endl;
throw "Organism method called!";
}
virtual emp::Ptr<Organism> Reproduce() {
std::cout << "Reproduce called from Organism" << std::endl;
throw "Organism method called!";
}
virtual std::optional<emp::Ptr<Organism>> VerticalTransmission(
emp::Ptr<Organism> host_baby
) {
std::cout << "VerticalTransmission called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void IndependentReproduction(emp::WorldPosition location) {
std::cout << "IndependentReproduction called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double ProcessResources(double sym_piece) {
std::cout << "ProcessResources called from an Organism" << std::endl;
throw "Organism method called!";
}
virtual double ProcessResources(double sym_piece, emp::Ptr<Organism> host) {
std::cout << "ProcessResources called from an Organism" << std::endl;
throw "Organism method called!";
}
virtual bool IsPhage() const {
std::cout << "IsPhage called from an Organism" << std::endl;
throw "Organism method called!";
}
virtual emp::Ptr<Organism> GetHost() {
std::cout << "GetHost called from an Organism" << std::endl;
throw "Organism method called!";
}
virtual bool WantsToInfect() {
std::cout << "WantsToInfect called from an Organism" << std::endl;
throw "Organism method called!";
}
virtual double GetInfectionChance() const {
std::cout << "GetInfectionChance called from an Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetInfectionChance(double _in) {
std::cout << "SetInfectionChance called from an Organism" << std::endl;
throw "Organism method called!";
}
virtual bool InfectionFails() {
std::cout << "InfectionFails called from an Organism" << std::endl;
throw "Organism method called!";
}
virtual emp::Ptr<emp::Taxon<taxon_info_t, datastruct::TaxonDataBase>> GetTaxon() {
std::cout << "GetTaxon called from an Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetTaxon(emp::Ptr<emp::Taxon<taxon_info_t, datastruct::TaxonDataBase>> _in) {
std::cout << "SetTaxon called from an Organism" << std::endl;
throw "Organism method called!";
}
//EfficientSymbiont functions
virtual double GetEfficiency() const {
std::cout << "GetEfficiency called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetEfficiency(double _in) {
std::cout << "SetEfficiency called from Organism" << std::endl;
throw "Organism method called!";
}
virtual emp::Ptr<Organism> Reproduce(std::string mode) {
std::cout << "EfficientSymbiont's Reproduce called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void Mutate(const std::string& mode) {
std::cout << "EfficientSymbiont's Mutate called from Organism" << std::endl;
throw "Organism method called!";
}
//Host functions
virtual emp::vector<emp::Ptr<Organism>>& GetSymbionts() {
std::cout << "GetSymbionts called from Organism" << std::endl;
throw "Organism method called!";
}
virtual Organism& GetSymbiont(size_t sym_id) {
std::cout << "GetSymbiont called from Organism" << std::endl;
throw "Organism method called!";
}
virtual const Organism& GetSymbiont(size_t sym_id) const {
std::cout << "GetSymbiont const called from Organism" << std::endl;
throw "Organism method called!";
}
virtual emp::vector<emp::Ptr<Organism>>& GetReproSymbionts() {
std::cout << "GetReproSymbionts called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetResInProcess(double _in) {
std::cout << "SetResInProcess called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double GetResInProcess() const {
std::cout << "GetResInProcess called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double StealResources(double _intval) {
std::cout << "GetResInProcess called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetSymbionts(emp::vector<emp::Ptr<Organism>> _in) {
std::cout << "SetSymbionts called from Organism" << std::endl;
throw "Organism method called!";
}
virtual emp::Ptr<Organism> RemoveSymbiont(int _in) {
std::cout << "RemoveSymbiont called from Organism" << std::endl;
throw "Organism method called!";
}
virtual int AddSymbiont(emp::Ptr<Organism> _in) {
std::cout << "AddSymbiont called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void AddReproSym(emp::Ptr<Organism> _in) {
std::cout << "AddReproSym called from Organism" << std::endl;
throw "Organism method called!";
}
virtual bool HasSym() const {
std::cout << "HasSym called from Organism" << std::endl;
throw "Organism method called!";
}
virtual bool IsHost() const {
std::cout << "IsHost called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void DistribResources(double resources) {
std::cout << "DistribResources called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void ClearSyms() {
std::cout << "ClearSyms called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void ClearReproSyms() {
std::cout << "ClearReproSyms called from Organism" << std::endl;
throw "Organism method called!";
}
//Bacterium functions
virtual double ProcessLysogenResources(double phage_inc_val) {
std::cout << "ProcessLysogenResources called from Organism" << std::endl;
throw "Organism method called!";
}
//Phage functions
virtual double GetBurstTimer() const {
std::cout << "GetBurstTimer called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void IncBurstTimer() {
std::cout << "IncBurstTimer called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetBurstTimer(double _in) {
std::cout << "SetBurstTimer called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double GetLysisChance() const {
std::cout << "GetLysisChance called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double GetInductionChance() const {
std::cout << "GetInductionChance called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetLysisChance(double _in) {
std::cout << "SetLysisChance called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetInductionChance(double _in) {
std::cout << "SetInductionChance called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void UponInjection() {
std::cout << "UponInjection called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void LysisBurst(emp::WorldPosition location) {
std::cout << "LysisBurst called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void LysisStep() {
std::cout << "LysisStep called from Organism" << std::endl;
throw "Organism method called!";
}
virtual bool GetLysogeny() {
std::cout << "GetLysogeny called from Organism" << std::endl;
throw "Organism method called!";
}
//Public goods game host functions
virtual void SetPool(double _in) {
std::cout << "SetPool called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void AddPool(double _in) {
std::cout << "AddPool called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void DistribPool() {
std::cout << "DistribPool called from Organism" << std::endl;
throw "Organism method called!";
}
//Public goods game sym functions
virtual double GetDonation() const {
std::cout << "GetDonation called from Organism" << std::endl;
throw "Organism method called!";
}
virtual void SetDonation(double _in) {
std::cout << "SetDonation called from Organism" << std::endl;
throw "Organism method called!";
}
virtual double ProcessPool() {
std::cout << "ProcessPool called from Organism" << std::endl;
throw "Organism method called!";
}
};
#endif