summaryrefslogtreecommitdiff
path: root/src/simulation/actions.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-11-12 15:18:29 -0600
committersanine <sanine.not@pm.me>2023-11-12 15:18:29 -0600
commit7825b92ce3be95a0ce1dfea9388adbaadce83b1f (patch)
treeeb1e38561e3aba4b890e666e04d46e4de499658e /src/simulation/actions.js
parent95fd952b6d4c496efc0e6236ba2acfcbbeee8ed9 (diff)
fix bugs
Diffstat (limited to 'src/simulation/actions.js')
-rw-r--r--src/simulation/actions.js6
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,
];