diff options
author | sanine <sanine.not@pm.me> | 2023-11-12 05:17:19 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-11-12 05:17:19 -0600 |
commit | 444b2b5abfbb70473b0785b38eaba1df4197ae69 (patch) | |
tree | 98eeb63082c679f8944c740f466c1e56aef24aad /src/simulation/senses.js | |
parent | e3a042a7a5c041dad63255965576346377e4f823 (diff) |
refactor genome to include size information
Diffstat (limited to 'src/simulation/senses.js')
-rw-r--r-- | src/simulation/senses.js | 3 |
1 files changed, 2 insertions, 1 deletions
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; }, }; |