Program Listing for File EfficientWorldSetup.cc¶
↰ Return to documentation for file (source/efficient_mode/EfficientWorldSetup.cc
)
#ifndef EFFWORLD_SETUP_C
#define EFFWORLD_SETUP_C
#include "EfficientWorld.h"
#include "EfficientSymbiont.h"
#include "EfficientHost.h"
void EfficientWorld::SetupHosts(long unsigned int* POP_SIZE) {
for (size_t i = 0; i < *POP_SIZE; i++) {
emp::Ptr<EfficientHost> new_org;
new_org.New(&GetRandom(), this, my_config, my_config->HOST_INT());
InjectHost(new_org);
}
}
void EfficientWorld::SetupSymbionts(long unsigned int* total_syms) {
for (size_t j = 0; j < *total_syms; j++) {
emp::Ptr<EfficientSymbiont> new_sym = emp::NewPtr<EfficientSymbiont>(&GetRandom(), this, my_config, my_config->SYM_INT(), 0, 1);
InjectSymbiont(new_sym);
}
}
void EfficientWorld::Setup() {
if (my_config->EFFICIENCY_MUT_RATE() == -1) my_config->EFFICIENCY_MUT_RATE(my_config->HORIZ_MUTATION_RATE());
SymWorld::Setup();
}
#endif