diff options
author | sanine <sanine.not@pm.me> | 2023-11-16 14:50:00 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-11-16 14:50:00 -0600 |
commit | f9fc4d26ec5fca9ee175c8a6fbcdd0fa36f10947 (patch) | |
tree | f190e6e465bb563c608a916f41fc8bf686ea2897 /src/simulation/validity.test.js | |
parent | 7825b92ce3be95a0ce1dfea9388adbaadce83b1f (diff) |
clear out js files
Diffstat (limited to 'src/simulation/validity.test.js')
-rw-r--r-- | src/simulation/validity.test.js | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/simulation/validity.test.js b/src/simulation/validity.test.js deleted file mode 100644 index ba9e684..0000000 --- a/src/simulation/validity.test.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -import { world_update } from '../world/world.js'; -import { validity } from './validity.js'; - -test("agents are not allowed to move into immutables", () => { - const actions = [{ - size: 1, propose: (world, agent, head) => { - return [{ - agent_changes: [{ - agent_id: agent.id, - x: agent.x + 1, y: agent.y, - }], - }]; - }, - }]; - - const agent = { - id: 1, - net: { compute: () => [[1], null] }, - state: null, - x: 0, y: 0, - flags: {}, - }; - - const lattice = [[{ type: 'empty', flags: {} }, { type: 'immutable', flags: {} }]]; - - const world = { - lattice, - lattice_rules: { empty: ()=>{}, immutable: ()=>{} }, - agents: [agent], - senses: [], - actions, - validity, - }; - - expect(world_update(world).agents[0]).toEqual(agent); - world.validity = []; - expect(world_update(world).agents[0]).toEqual({ - ...agent, - x: 1, y: 0, - }); -}); |