diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-12 20:38:04 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-12 20:38:04 -0500 |
commit | 442bb01af8b9cbf88189a4d2368548f41149413f (patch) | |
tree | 690353a2f923432746af19fbdc92ac4516fe578f /sim.hpp | |
parent | 0bd888b39af436ef28a6c9d4ab64e948d5ae99c7 (diff) |
evolution
Diffstat (limited to 'sim.hpp')
-rw-r--r-- | sim.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |