From 444b2b5abfbb70473b0785b38eaba1df4197ae69 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 12 Nov 2023 05:17:19 -0600 Subject: refactor genome to include size information --- src/simulation/senses.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/simulation/senses.js') diff --git a/src/simulation/senses.js b/src/simulation/senses.js index 23775b6..ca07442 100644 --- a/src/simulation/senses.js +++ b/src/simulation/senses.js @@ -157,7 +157,7 @@ const see = { const [x, y] = vision_idx_to_world_pos(world, agent, idx); return see_cell(world, x, y); }); - return world.agents.reduce( + const result = world.agents.reduce( (acc, a) => { const idx = world_pos_to_vision_idx(world, agent, a.x, a.y); if (idx < 0 || idx > VIS_WIDTH*VIS_HEIGHT) { @@ -169,6 +169,7 @@ const see = { }, vision ); + return result; }, }; -- cgit v1.2.1