diff --git a/flatland/utils/editor.py b/flatland/utils/editor.py index 0955788b88a8bf3a54732dde12763a5c62a52c2a..13ec977c9945545f0147e691b2ddb4f118c43639 100644 --- a/flatland/utils/editor.py +++ b/flatland/utils/editor.py @@ -332,7 +332,8 @@ class Controller(object): for iAgent, agent in enumerate(self.model.env.agents_static): if agent is None: continue - agent.direction = (agent.direction + 1) % 4 + if iAgent == self.model.iSelectedAgent: + agent.direction = (agent.direction + 1) % 4 self.model.redraw() def restartAgents(self, event): diff --git a/notebooks/Editor2.ipynb b/notebooks/Editor2.ipynb index 4ac6e9dbd974df1074b90b2f481561d2dbac5b50..22bc70746fc7af324a3e7d236171baa9fed48212 100644 --- a/notebooks/Editor2.ipynb +++ b/notebooks/Editor2.ipynb @@ -9,18 +9,9 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 1, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The autoreload extension is already loaded. To reload it, use:\n", - " %reload_ext autoreload\n" - ] - } - ], + "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" @@ -28,7 +19,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -41,7 +32,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -63,7 +54,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -72,7 +63,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -106,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 6, "metadata": { "scrolled": false }, @@ -114,7 +105,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "ece47ccd72af4638b61e9d93a66e9a57", + "model_id": "0f61a1b60a024112ace6ee136b49f20a", "version_major": 2, "version_minor": 0 }, @@ -132,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 7, "metadata": { "scrolled": false }, @@ -140,7 +131,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "86207439e5a94055bb3d837028f195fc", + "model_id": "d3c56d6d214949e181e45330b00082f8", "version_major": 2, "version_minor": 0 }, @@ -159,7 +150,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -168,7 +159,7 @@ "(0, 0)" ] }, - "execution_count": 16, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" }