summaryrefslogtreecommitdiff
path: root/sim.hpp
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-12-12 20:38:04 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-12-12 20:38:04 -0500
commit442bb01af8b9cbf88189a4d2368548f41149413f (patch)
tree690353a2f923432746af19fbdc92ac4516fe578f /sim.hpp
parent0bd888b39af436ef28a6c9d4ab64e948d5ae99c7 (diff)
evolution
Diffstat (limited to 'sim.hpp')
-rw-r--r--sim.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/sim.hpp b/sim.hpp
index 1a93566..7de7a9a 100644
--- a/sim.hpp
+++ b/sim.hpp
@@ -167,6 +167,7 @@ typedef struct {
#define MAX_PLATFORMS 32
typedef struct {
float score; // distance this setup can throw the ball
+ bool mutated;
u32 nplatforms;
Platform platforms[MAX_PLATFORMS];
} Setup;
@@ -218,8 +219,9 @@ typedef struct {
u32 nplatforms;
Platform platforms[MAX_PLATFORMS];
-#define GENERATION_SIZE 1000
- Setup generation[GENERATION_SIZE];
+#define GENERATION_SIZE 100
+#define TOP_KEPT 10 // keep top this many setups after every generation
+ Setup setups[TOP_KEPT + GENERATION_SIZE];
u32 tmp_mem_used; // this is not measured in bytes, but in MaxAligns
#define TMP_MEM_BYTES (4L<<20)