1 #ifndef BLOBS_CREATURE_GENOME_HPP_
2 #define BLOBS_CREATURE_GENOME_HPP_
4 #include "../math/Distribution.hpp"
5 #include "../math/GaloisLFSR.hpp"
6 #include "../math/glm.hpp"
23 /// every one of these should have at least one
24 /// negative impact to prevent super-beings evolving
26 /// power at the cost of higher solid intake
27 T &Strength() noexcept { return props[0]; }
28 const T &Strength() const noexcept { return props[0]; }
29 /// more endurance at the cost of higher liquid intake
30 T &Stamina() noexcept { return props[1]; }
31 const T &Stamina() const noexcept { return props[1]; }
32 /// more speed at the cost of higher fatigue
33 T &Dexerty() noexcept { return props[2]; }
34 const T &Dexerty() const noexcept { return props[2]; }
35 /// higher mental capacity at the cost of boredom
36 T &Intelligence() noexcept { return props[3]; }
37 const T &Intelligence() const noexcept { return props[3]; }
38 /// average lifetime in seconds
39 T &Lifetime() noexcept { return props[4]; }
40 const T &Lifetime() const noexcept { return props[4]; }
41 /// how likely to succeed in reproduction
42 T &Fertility() noexcept { return props[5]; }
43 const T &Fertility() const noexcept { return props[5]; }
44 /// how likely to mutate
45 T &Mutability() noexcept { return props[6]; }
46 const T &Mutability() const noexcept { return props[6]; }
48 T &OffspringMass() noexcept { return props[7]; }
49 const T &OffspringMass() const noexcept { return props[7]; }
51 Properties<math::Distribution> properties;
53 math::Distribution base_hue;
54 math::Distribution base_saturation;
55 math::Distribution base_lightness;
57 void Configure(Creature &) const;
59 static Properties<double> Instantiate(
60 const Properties<math::Distribution> &p,
61 math::GaloisLFSR &rand
64 p.props[0].FakeNormal(rand.SNorm()),
65 p.props[1].FakeNormal(rand.SNorm()),
66 p.props[2].FakeNormal(rand.SNorm()),
67 p.props[3].FakeNormal(rand.SNorm()),
68 p.props[4].FakeNormal(rand.SNorm()),
69 p.props[5].FakeNormal(rand.SNorm()),
70 p.props[6].FakeNormal(rand.SNorm()),
71 p.props[7].FakeNormal(rand.SNorm())