+ genome.composition.push_back({
+ solid, // resource
+ { 0.4, 0.01 }, // mass
+ //{ 0.1, 0.001 }, // intake
+ { 0.4, 0.001 }, // intake
+ { 0.001, 0.0001 }, // penalty
+ { 10.0, 0.002 }, // growth
+ });
+ }
+
+ genome.Configure(c);
+}
+
+void Genome::Configure(Creature &c) const {
+ c.GetGenome() = *this;
+
+ math::GaloisLFSR &random = c.GetSimulation().Assets().random;
+
+ c.GetProperties().birth_mass = properties.birth_mass.FakeNormal(random.SNorm());
+ c.GetProperties().fertile_mass = properties.fertile_mass.FakeNormal(random.SNorm());
+ c.GetProperties().max_mass = properties.max_mass.FakeNormal(random.SNorm());
+ c.GetProperties().fertile_age = properties.fertile_age.FakeNormal(random.SNorm());
+ c.GetProperties().infertile_age = properties.infertile_age.FakeNormal(random.SNorm());
+ c.GetProperties().death_age = properties.death_age.FakeNormal(random.SNorm());
+ c.GetProperties().fertility = properties.fertility.FakeNormal(random.SNorm());
+
+ double mass = 0.0;
+ double volume = 0.0;
+ for (const auto &comp : composition) {
+ double comp_mass = comp.mass.FakeNormal(random.SNorm());
+ double intake = comp.intake.FakeNormal(random.SNorm());
+ double penalty = comp.penalty.FakeNormal(random.SNorm());
+
+ mass += comp_mass;
+ volume += comp_mass / c.GetSimulation().Resources()[comp.resource].density;
+
+ std::unique_ptr<Need> need;
+ if (c.GetSimulation().Resources()[comp.resource].state == world::Resource::SOLID) {
+ need.reset(new IngestNeed(comp.resource, intake, penalty));
+ need->gain = intake * 0.05;
+ } else if (c.GetSimulation().Resources()[comp.resource].state == world::Resource::LIQUID) {
+ need.reset(new IngestNeed(comp.resource, intake, penalty));
+ need->gain = intake * 0.1;
+ } else {
+ need.reset(new InhaleNeed(comp.resource, intake, penalty));
+ need->gain = intake * 0.5;
+ }
+ need->name = c.GetSimulation().Resources()[comp.resource].label;
+ need->growth = comp.growth.FakeNormal(random.SNorm());
+ need->inconvenient = 0.5;