summaryrefslogtreecommitdiff
path: root/src/world/agent.test.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-11-10 19:51:02 -0600
committersanine <sanine.not@pm.me>2023-11-10 19:51:02 -0600
commit984f07a24d3d377c13358fc5533c0eda383858f5 (patch)
treef5031a2abc9b5382c3c1f585481a82a4da7553da /src/world/agent.test.js
parent57172b8c3c851497b55b5d4c90ddb0cb5f9b202c (diff)
refactor: actions take an additional world parameter
Diffstat (limited to 'src/world/agent.test.js')
-rw-r--r--src/world/agent.test.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/world/agent.test.js b/src/world/agent.test.js
index 5d5828f..d10a43a 100644
--- a/src/world/agent.test.js
+++ b/src/world/agent.test.js
@@ -13,13 +13,13 @@ test("simple agent decisions", () => {
const senses = [];
const actions = [
- { size: 1, propose: (agent, head) => [{ agent_changes: [{ agent_id: 3, flags: { act1: head[0] } }] }] },
- { size: 1, propose: (agent, head) => [{ agent_changes: [{ agent_id: 3, flags: { act2: head[0] } }] }] },
+ { size: 1, propose: (world, agent, head) => [{ agent_changes: [{ agent_id: 3, flags: { act1: head[0] } }] }] },
+ { size: 1, propose: (world, agent, head) => [{ agent_changes: [{ agent_id: 3, flags: { act2: head[0] } }] }] },
];
expect(agent_decide(lattice, agent, senses, actions)).toEqual([
{ ...agent, state: 'state' },
- actions.map((a, idx) => a.propose(null, [idx])).flat(),
+ actions.map((a, idx) => a.propose(null, null, [idx])).flat(),
]);
});