diff options
Diffstat (limited to 'src/simulation/actions.js')
-rw-r--r-- | src/simulation/actions.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/simulation/actions.js b/src/simulation/actions.js index 3b3e942..ad08572 100644 --- a/src/simulation/actions.js +++ b/src/simulation/actions.js @@ -9,6 +9,7 @@ const move_forward = { if (agent.flags.frozen === true) { return []; } if (head[0] > threshold) { console.log('move forward'); + console.log(agent.id, agent.x, agent.y); const dx = { n: 0, e: 1, s: 0, w: -1 }[agent.flags.orientation]; const dy = { n: -1, e: 0, s: 1, w: 0 }[agent.flags.orientation]; return [{ @@ -30,6 +31,7 @@ const move_backward = { propose: (world, agent, head) => { if (agent.flags.frozen === true) { return []; } if (head[0] > threshold) { + console.log('move backward'); const dx = { n: 0, e: 1, s: 0, w: -1 }[agent.flags.orientation]; const dy = { n: -1, e: 0, s: 1, w: 0 }[agent.flags.orientation]; return [{ @@ -51,6 +53,7 @@ const turn_left = { propose: (world, agent, head) => { if (agent.flags.frozen === true) { return []; } if (head[0] > threshold) { + console.log('turn left'); const orientation = { n: 'w', e: 'n', s: 'e', w: 's' }[agent.flags.orientation]; return [{ agent_changes: [{ @@ -70,6 +73,7 @@ const turn_right = { propose: (world, agent, head) => { if (agent.flags.frozen === true) { return []; } if (head[0] > threshold) { + console.log('turn right'); const orientation = { n: 'e', e: 's', s: 'w', w: 'n' }[agent.flags.orientation]; return [{ agent_changes: [{ @@ -250,7 +254,7 @@ const speak = { export const actions = [ - move_forward, move_backward, turn_left, turn_right, + move_forward, /*move_backward, */turn_left, turn_right, place, trigger, pretend_frozen, unfreeze, take_flag, drop_flag, speak, ]; |