forked from anyaevostinar/SymbulationEmp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSGPWorldSetup.cc
More file actions
566 lines (488 loc) · 19.8 KB
/
Copy pathSGPWorldSetup.cc
File metadata and controls
566 lines (488 loc) · 19.8 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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
#ifndef SGP_WORLD_SETUP_C
#define SGP_WORLD_SETUP_C
#include "SGPWorld.h"
#include "org_type_info.h"
#include "utils.h"
#include "hardware/SGPHardware.h"
#include "sgpl/utility/ThreadLocalRandom.hpp"
#include "emp/datastructs/map_utils.hpp"
#include "emp/tools/string_utils.hpp"
#include "emp/math/math.hpp"
// TODO - assert that sym / host has program
namespace sgpmode {
void SGPWorld::Setup() {
// Clear all world signals
ClearWorldSignals();
// Clear any config snapshot entries
config_snapshot_entries.clear();
// Reset the seed of the main sgp thread based on the config
// TODO - should this be here? (used to be inside scheduler)
sgpl::tlrand.Get().ResetSeed(sgp_config.SEED());
// Configure start tag
// TODO - clean up start tag management.
START_TAG.SetUInt64(0, std::numeric_limits<uint64_t>::max());
// TODO - configure program builder if necessary
prog_builder.SetStartTag(START_TAG);
// TODO - print out mapper after all deletes, hand-check
// TODO - add tests for rectifier inst removals
// Configure SGP organism type variables based on config settings
SetupOrgTypeVariables();
// Remove and rectify instruction set as needed
DisableConfigurableInstructions();
// Configure task environment
SetupTaskEnvironment();
// NOTE - Some of this code is repeated from base class.
// - Could do some reorganization to copy-paste. E.g., make functions for this,
// add hooks into the base setup to give more 1wnstream flexibility.
double start_moi = sgp_config.START_MOI();
// NOTE - should POP_SIZE be changed to INIT_POP_SIZE for clarity?
long unsigned int POP_SIZE;
// TODO - add pop mode?
max_world_size = sgp_config.GRID_X() * sgp_config.GRID_Y();
if (sgp_config.POP_SIZE() < 0) {
POP_SIZE = max_world_size;
} else {
POP_SIZE = sgp_config.POP_SIZE();
}
// Setup mutation operator
SetupMutator();
// Setup population structure
SetupPopStructure();
// Setup scheduler
SetupScheduler();
// Setup host and symbiont reproduction
SetupReproduction();
// Setup any host-symbiont interactions
SetupHostSymInteractions();
// CureHost signal
// TODO: move to default? Figure out how to remove duplication
if (sgp_config.CURE()) {
begin_update_sig.AddAction(
[this]() {
if(GetUpdate() == sgp_config.CURE_UPDATES()) {
CureHosts();
}
}
);
}
if (sgp_config.ENABLE_TEMP_CHANGING_ENVIRONMENT()) {
SetupChangingEnvironment();
}
SetupHosts(&POP_SIZE);
Resize(max_world_size); // TODO - move this back to setup pop structure after fixing setup hosts
// NOTE - any way to clean this up a little? Or, add some explanatory comments.
long unsigned int total_syms = POP_SIZE * start_moi;
SetupSymbionts(&total_syms);
CreateDataFiles();
SnapshotConfig();
setup = true;
}
void SGPWorld::SetupChangingEnvironment() {
// on setup, set NAND, AND-NOT, OR-NOT to be negative (at update zero)
// then during each interval apply *-1 to the changing tasks
size_t nand_task_id = task_env.GetTaskSet().GetSize();
if (task_env.GetTaskSet().HasTask("NAND")) {
nand_task_id = task_env.GetTaskSet().GetID("NAND");
}
else if (task_env.GetTaskSet().HasTask("nand")) {
nand_task_id = task_env.GetTaskSet().GetID("nand");
}
size_t andn_task_id = task_env.GetTaskSet().GetSize();
if (task_env.GetTaskSet().HasTask("AND_NOT")) {
andn_task_id = task_env.GetTaskSet().GetID("AND_NOT");
}
else if (task_env.GetTaskSet().HasTask("and_not")) {
andn_task_id = task_env.GetTaskSet().GetID("and_not");
}
size_t orn_task_id = task_env.GetTaskSet().GetSize();
if (task_env.GetTaskSet().HasTask("OR_NOT")) {
orn_task_id = task_env.GetTaskSet().GetID("OR_NOT");
}
else if (task_env.GetTaskSet().HasTask("or_not")) {
orn_task_id = task_env.GetTaskSet().GetID("or_not");
}
// grab task ids for NOT, AND, OR
size_t not_task_id = task_env.GetTaskSet().GetSize();
if (task_env.GetTaskSet().HasTask("NOT")) {
not_task_id = task_env.GetTaskSet().GetID("NOT");
}
else if (task_env.GetTaskSet().HasTask("not")) {
not_task_id = task_env.GetTaskSet().GetID("not");
}
size_t and_task_id = task_env.GetTaskSet().GetSize();
if (task_env.GetTaskSet().HasTask("AND")) {
and_task_id = task_env.GetTaskSet().GetID("AND");
}
else if (task_env.GetTaskSet().HasTask("and")) {
and_task_id = task_env.GetTaskSet().GetID("and");
}
size_t or_task_id = task_env.GetTaskSet().GetSize();
if (task_env.GetTaskSet().HasTask("OR")) {
or_task_id = task_env.GetTaskSet().GetID("OR");
}
else if (task_env.GetTaskSet().HasTask("or")) {
or_task_id = task_env.GetTaskSet().GetID("or");
}
// update 0 will flip not-and-or to rewarded and nand-andn-orn to punished
GetTaskEnv().GetHostTaskReq(nand_task_id).task_value = -1 * GetTaskEnv().GetHostTaskReq(nand_task_id).task_value;
GetTaskEnv().GetSymTaskReq(nand_task_id).task_value = -1 * GetTaskEnv().GetSymTaskReq(nand_task_id).task_value;
GetTaskEnv().GetHostTaskReq(andn_task_id).task_value = -1 * GetTaskEnv().GetHostTaskReq(andn_task_id).task_value;
GetTaskEnv().GetSymTaskReq(andn_task_id).task_value = -1 * GetTaskEnv().GetSymTaskReq(andn_task_id).task_value;
GetTaskEnv().GetHostTaskReq(orn_task_id).task_value = -1 * GetTaskEnv().GetHostTaskReq(orn_task_id).task_value;
GetTaskEnv().GetSymTaskReq(orn_task_id).task_value = -1 * GetTaskEnv().GetSymTaskReq(orn_task_id).task_value;
begin_update_sig.AddAction(
[this, nand_task_id, andn_task_id, orn_task_id, not_task_id, and_task_id, or_task_id]() {
if (GetUpdate() % sgp_config.TEMP_CHANGING_ENVIRONMENT_INTERVAL() == 0) {
GetTaskEnv().GetHostTaskReq(not_task_id).task_value = -1 * GetTaskEnv().GetHostTaskReq(not_task_id).task_value;
GetTaskEnv().GetHostTaskReq(and_task_id).task_value = -1 * GetTaskEnv().GetHostTaskReq(and_task_id).task_value;
GetTaskEnv().GetHostTaskReq(or_task_id).task_value = -1 * GetTaskEnv().GetHostTaskReq(or_task_id).task_value;
GetTaskEnv().GetHostTaskReq(nand_task_id).task_value = -1 * GetTaskEnv().GetHostTaskReq(nand_task_id).task_value;
GetTaskEnv().GetHostTaskReq(andn_task_id).task_value = -1 * GetTaskEnv().GetHostTaskReq(andn_task_id).task_value;
GetTaskEnv().GetHostTaskReq(orn_task_id).task_value = -1 * GetTaskEnv().GetHostTaskReq(orn_task_id).task_value;
GetTaskEnv().GetSymTaskReq(not_task_id).task_value = -1 * GetTaskEnv().GetSymTaskReq(not_task_id).task_value;
GetTaskEnv().GetSymTaskReq(and_task_id).task_value = -1 * GetTaskEnv().GetSymTaskReq(and_task_id).task_value;
GetTaskEnv().GetSymTaskReq(or_task_id).task_value = -1 * GetTaskEnv().GetSymTaskReq(or_task_id).task_value;
GetTaskEnv().GetSymTaskReq(nand_task_id).task_value = -1 * GetTaskEnv().GetSymTaskReq(nand_task_id).task_value;
GetTaskEnv().GetSymTaskReq(andn_task_id).task_value = -1 * GetTaskEnv().GetSymTaskReq(andn_task_id).task_value;
GetTaskEnv().GetSymTaskReq(orn_task_id).task_value = -1 * GetTaskEnv().GetSymTaskReq(orn_task_id).task_value;
}
}
);
}
void SGPWorld::DisableConfigurableInstructions() {
// Knock out any mode-related instructions that shouldn't be active for this run
if (!sgp_config.DONATION_STEAL_INST()) {
// Knockout donate instruction
del_inst(
opcode_rectifier.mapper.begin(),
opcode_rectifier.mapper.end(),
Library::GetOpCode("Donate"),
Library::GetSize()
);
// Knockout steal instruction
del_inst(
opcode_rectifier.mapper.begin(),
opcode_rectifier.mapper.end(),
Library::GetOpCode("Steal"),
Library::GetSize()
);
}
// If free-living symbionts are disabled, disable the infect instruction
if (!sgp_config.FREE_LIVING_SYMS()) {
// Knockout the infect instruction
del_inst(
opcode_rectifier.mapper.begin(),
opcode_rectifier.mapper.end(),
Library::GetOpCode("Infect"),
Library::GetSize()
);
}
// if temporally changing environment are off, or if organisms aren't allowed to sense their environment,
// disable the SenseTask instruction
if (!sgp_config.ENABLE_TEMP_CHANGING_ENVIRONMENT() || sgp_config.TEMP_CHANGING_ENVIRONMENT_ORG_TYPE() == "static") {
del_inst(
opcode_rectifier.mapper.begin(),
opcode_rectifier.mapper.end(),
Library::GetOpCode("SenseTask"),
Library::GetSize()
);
}
}
void SGPWorld::SetupPopStructure() {
// set world structure (either mixed or a grid with some dimensions)
// and set synchronous generations to false
if (!sgp_config.GRID()) {
SetPopStruct_Mixed(false);
} else {
SetPopStruct_Grid(sgp_config.GRID_X(), sgp_config.GRID_Y(), false);
}
// Resize world capacity to max_world_size
// Resize(max_world_size); // TODO - move ethis back here
}
void SGPWorld::SetupScheduler() {
// Configure scheduler w/max world size (updated in SGPWorld::Setup, and cfg thread count)
scheduler.SetupScheduler(max_world_size);
// Scheduler calls world's ProcessOrgAt function
}
void SGPWorld::SetupReproduction() {
// Setup reproduction queue
repro_queue.Clear();
// NOTE - could configure reproduce function in repro queue for maximum
// runtime configurability
repro_queue.SetReproduceOrgFun([this](ReproEvent& repro_info) {
emp::Ptr<Organism> org = repro_info.org;
emp::Ptr<Organism> child = org->Reproduce();
if (child->IsHost()) {
HostDoBirth(child, org, repro_info.pos);
// Mark parent as no longer reproducing (world handles setting state, so should handle resetting)
// NOTE - could move reset repro state in Reproduce functions
// static_cast<sgp_host_t*>(org.Raw())->GetHardware().GetCPUState().ResetReproState();
} else {
const emp::WorldPosition sym_baby_pos = SymDoBirth(child, repro_info.pos);
emp::Ptr<sgp_sym_t> sym_parent = static_cast<sgp_sym_t*>(org.Raw());
// Trigger any post-birth actions
after_sym_do_birth_sig.Trigger(sym_baby_pos, sym_parent);
// Mark parent as no longer reproducing
// static_cast<sgp_sym_t*>(org.Raw())->GetHardware().GetCPUState().ResetReproState();
}
});
// OnBeforePlacement happens during emp::World's AddOrgAt
// Set CPUState's location when organism is added to the world.
OnBeforePlacement(
[this](Organism& org, size_t loc) {
if (org.IsHost()) {
static_cast<sgp_host_t&>(org).GetHardware().GetCPUState().SetLocation({loc});
this->AssignNewEnvIO(static_cast<sgp_host_t&>(org).GetHardware().GetCPUState()); // AEV Question: is there a better place for this?
} else {
static_cast<sgp_sym_t&>(org).GetHardware().GetCPUState().SetLocation({loc});
this->AssignNewEnvIO(static_cast<sgp_sym_t&>(org).GetHardware().GetCPUState());
}
}
);
SetupHostReproduction();
SetupSymReproduction();
}
// Configure HostDoBirth signals
void SGPWorld::SetupHostReproduction() {
// TODO - anything else to configure here?
}
// Configure symbiont reproduction signals
void SGPWorld::SetupSymReproduction() {
// Configure sym do birth function, if free-living, symbiont offspring go right into world
if (sgp_config.FREE_LIVING_SYMS()) {
// Configure sym birth in free-living symbiont mode
fun_sym_do_birth = [this](
emp::Ptr<sgp_sym_t> sym_baby_ptr,
const emp::WorldPosition& parent_pos
) -> emp::WorldPosition {
return FreeLivingSymDoBirth(sym_baby_ptr, parent_pos);
};
} else if (sgp_config.HORIZ_TRANS()){
// Configure sym birth in non-free-living symbiont mode.
fun_sym_do_birth = [this](
emp::Ptr<sgp_sym_t> sym_baby_ptr,
const emp::WorldPosition& parent_pos
) -> emp::WorldPosition {
return SymAttemptHorizontalInfection(sym_baby_ptr, parent_pos);
};
} else {
// Neither horizontal transmission nor free-living symbionts, so fun_sym_do_birth should just return invalid position and clean up the offspring
fun_sym_do_birth = [this](
emp::Ptr<sgp_sym_t> sym_baby_ptr,
const emp::WorldPosition& parent_pos
) -> emp::WorldPosition {
sym_baby_ptr.Delete();
return emp::WorldPosition();
};
}
// Configure after sym birth data tracking
// NOTE - Should this be adjusted at all to account for configuration differences?
// QUESTION - Should this fire for free-living symbionts?
// Can instead make this trigger after horizontal transmission
after_sym_do_birth_sig.AddAction(
[this](const emp::WorldPosition& sym_baby_pos, emp::Ptr<sgp_sym_t> sym_parent_ptr) {
sym_parent_ptr->AfterIndependentReproduction(sym_baby_pos);
}
);
// Configure vertical transmission
// TODO - Probably will need to change VT_TASK_MATCH to a categorical variable
// to accomodate different mechanisms for determining whether vt is possible.
if (sgp_config.VT_TASK_MATCH()) {
// If task matching required, check.
fun_vert_trans_compatible = [this](
sgp_sym_t& sym,
sgp_host_t& host_offspring,
sgp_host_t& host_parent
) -> bool {
// Check if host profile and sym profile have any overlap?
auto& host_profile = fun_get_host_task_profile(host_parent);
auto& sym_profile = fun_get_sym_task_profile(sym);
return utils::AnyMatchingOnes(host_profile, sym_profile);
};
} else {
// Otherwise, allow attempt in all cases.
fun_vert_trans_compatible = [](
sgp_sym_t& sym,
sgp_host_t& host_offspring,
sgp_host_t& host_parent
) -> bool {
return true;
};
}
// TODO - anything else to setup here?
}
// TODO - clear host process signals
void SGPWorld::SetupHosts(long unsigned int* POP_SIZE) {
// TODO - add any signals for host/endosymbiont initialization?
// TODO - discuss implications of timing for core launch
// Launch core if none running.
before_host_cpu_exec_sig.AddAction(
[this](sgp_host_t& host) {
// NOTE - currently, LaunchCPU will only launch if no cores currently running
host.GetHardware().LaunchCPU(START_TAG);
}
);
// TODO - inject initial population at fixed positions (unless configured otherwise)
size_t nand_task_id = task_env.GetTaskSet().GetSize();
if (task_env.GetTaskSet().HasTask("NAND")) {
nand_task_id = task_env.GetTaskSet().GetID("NAND");
} else if (task_env.GetTaskSet().HasTask("nand")) {
nand_task_id = task_env.GetTaskSet().GetID("nand");
}
const size_t init_pop_size = *POP_SIZE;
for (size_t i = 0; i < init_pop_size; ++i) {
emp::Ptr<sgp_host_t> new_host;
sgp_prog_t init_prog(
prog_builder.CreateNandProgram(PROGRAM_LENGTH)
);
switch (sgp_org_type) {
case org_mode_t::DEFAULT:
new_host = emp::NewPtr<sgp_host_t>(
random_ptr,
this,
&sgp_config,
init_prog,
sgp_config.HOST_INT()
);
break;
// TODO - add back more modes
default:
// org mode has already been verified, so something has gone very wrong
// with that if we're here.
std::cout << "Unrecognized SGP organism type: " << sgp_config.INTERACTION_MECHANISM() << std::endl;
break;
}
// NOTE - what about other Start MOI values?
// - these endosymbionts have empty programs?
if (sgp_config.START_MOI() == 1) {
sgp_prog_t sym_prog(
prog_builder.CreateNandProgram(PROGRAM_LENGTH)
);
emp::Ptr<sgp_sym_t> new_sym = emp::NewPtr<sgp_sym_t>(
random_ptr,
this,
&sgp_config,
sym_prog,
sgp_config.SYM_INT()
);
// TODO - add InjectSymIntoHost to wrap
// NOTE - Move env io assignment to different signal that is triggered on inject?
// AssignNewEnvIO(new_sym->GetHardware().GetCPUState()); // Add to AddSymbiont
// Set sym's parent task
if (task_env.IsSymTask(nand_task_id)) {
new_sym->GetHardware().GetCPUState().SetParentTaskPerformed(nand_task_id, true);
new_sym->GetHardware().GetCPUState().SetParentFirstTaskPerformed(nand_task_id, true);
new_sym->GetHardware().GetCPUState().MarkTaskPerformed(nand_task_id);
}
// NOTE - Do we need to set location in cpu state here?
new_host->AddSymbiont(new_sym);
}
// TODO - Add SGPWorld function to wrap inject host function
// AssignNewEnvIO(new_host->GetHardware().GetCPUState()); // This is in OnPlacement now, so should be fine
if (task_env.IsHostTask(nand_task_id)) {
new_host->GetHardware().GetCPUState().SetParentTaskPerformed(nand_task_id, true);
new_host->GetHardware().GetCPUState().SetParentFirstTaskPerformed(nand_task_id, true);
}
InjectHost(new_host);
}
}
void SGPWorld::SetupSymbionts(long unsigned int* total_syms) {
// NOTE - this was empty in original implementation.
before_endosym_process_sig.AddAction(
[this](
const emp::WorldPosition& sym_pos,
sgp_sym_t& sym,
sgp_host_t& host
) {
// NOTE - currently, LaunchCPU will
sym.GetHardware().LaunchCPU(START_TAG);
}
);
before_freeliving_sym_process_sig.AddAction(
[this](sgp_sym_t& sym) {
// NOTE - currently, LaunchCPU will
sym.GetHardware().LaunchCPU(START_TAG);
}
);
}
void SGPWorld::SetupTaskEnvironment() {
// TODO - configure any world <--> environment interactions that need to be
// setup prior to run
task_env.Setup(
sgp_config.TASK_ENV_CFG_PATH(),
sgp_config.TASK_IO_BANK_SIZE(),
sgp_config.TASK_IO_UNIQUE_OUTPUT()
);
// Configure organism input buffers / environment id
// NOTE - now that assigning new env io is in a function, could
// hardcode these calls in "ProcessOrg" functions.
// If this isn't something we want to configure at runtime, should do that.
// TODO - Move assign new env to where host_do_birth_sig
before_host_do_birth_sig.AddAction(
[this](
sgp_host_t& host_offspring,
sgp_host_t& host_parent,
const emp::WorldPosition& parent_pos
) {
// auto& offspring_cpu_state = host_offspring.GetHardware().GetCPUState();
// auto& parent_cpu_state = host_parent.GetHardware().GetCPUState();
// AssignNewEnvIO(offspring_cpu_state); // This is in OnPlacement now, so should be fine
}
);
before_sym_do_birth_sig.AddAction(
[this](
emp::Ptr<sgp_sym_t> sym_baby_ptr,
const emp::WorldPosition& parent_pos
) {
// AssignNewEnvIO(sym_baby_ptr->GetHardware().GetCPUState()); // This is in AddSymbiont and OnPlacement now, so should be fine
}
);
// Inconsistent between host do birth, sym do birth, vert trans
// because vert trans doesn't know sym offspring until after
after_sym_vert_transmission_sig.AddAction(
[this](
emp::Ptr<sgp_sym_t> sym_offspring_ptr,
emp::Ptr<sgp_sym_t> sym_parent_ptr,
emp::Ptr<sgp_host_t> host_offspring_ptr,
emp::Ptr<sgp_host_t> host_parent_ptr,
bool success /* vertical transmission success */
) {
if (!success) return;
emp_assert(sym_offspring_ptr != nullptr);
}
);
// --- Setup task completion/output buffer checks ---
// NOTE - discuss timing of this check. Currently happens after executing cpu
// fully for this update
// NOTE - discuss whether we want ability to configure this differently for different
// kinds of organisms
// TODO - Move this into Process functions
after_host_cpu_exec_sig.AddAction(
[this](sgp_host_t& host) {
host.ProcessOutputBuffer();
}
);
// E.g., fine for freeliving and endo syms to have same output processing?
after_freeliving_sym_cpu_exec_sig.AddAction(
[this](sgp_sym_t& sym) {
ProcessSymOutputBuffer(sym);
}
);
after_endosym_cpu_exec_sig.AddAction(
[this](
const emp::WorldPosition& sym_pos,
sgp_sym_t& sym,
sgp_host_t& host
) {
ProcessSymOutputBuffer(sym);
}
);
}
void SGPWorld::SetupMutator() {
// NOTE - can add more flexibility to mutator
mutator.SetPerBitMutationRate(sgp_config.SGP_MUT_PER_BIT_RATE());
// NOTE - could make host mutator a functor that could be configured here
// same with endosymbionts / etc
}
}
#endif