1 #ifndef BLOBS_CREATURE_GENOME_HPP_
2 #define BLOBS_CREATURE_GENOME_HPP_
4 #include "../math/Distribution.hpp"
5 #include "../math/GaloisLFSR.hpp"
28 PropertySet<T> props[6];
29 PropertySet<T> &Birth() noexcept { return props[0]; }
30 const PropertySet<T> &Birth() const noexcept { return props[0]; }
31 PropertySet<T> &Child() noexcept { return props[1]; }
32 const PropertySet<T> &Child() const noexcept { return props[1]; }
33 PropertySet<T> &Youth() noexcept { return props[2]; }
34 const PropertySet<T> &Youth() const noexcept { return props[2]; }
35 PropertySet<T> &Adult() noexcept { return props[3]; }
36 const PropertySet<T> &Adult() const noexcept { return props[3]; }
37 PropertySet<T> &Elder() noexcept { return props[4]; }
38 const PropertySet<T> &Elder() const noexcept { return props[4]; }
39 PropertySet<T> &Death() noexcept { return props[5]; }
40 const PropertySet<T> &Death() const noexcept { return props[5]; }
42 Properties<math::Distribution> properties;
48 // how much contained in the body
49 // relative value to determine average density
50 math::Distribution mass;
51 // how much to circulate
52 math::Distribution intake;
53 // how important for alive-being
54 math::Distribution penalty;
55 // how much off the mass may stay in the body
56 math::Distribution growth;
58 std::vector<Composition> composition;
60 void Configure(Creature &) const;
62 static PropertySet<double> Instantiate(
63 const PropertySet<math::Distribution> &p,
64 math::GaloisLFSR &rand
67 p.age.FakeNormal(rand.SNorm()),
68 p.mass.FakeNormal(rand.SNorm()),
69 p.fertility.FakeNormal(rand.SNorm())
73 static Properties<double> Instantiate(
74 const Properties<math::Distribution> &p,
75 math::GaloisLFSR &rand
78 Instantiate(p.props[0], rand),
79 Instantiate(p.props[1], rand),
80 Instantiate(p.props[2], rand),
81 Instantiate(p.props[3], rand),
82 Instantiate(p.props[4], rand),
83 Instantiate(p.props[5], rand)