From 1291fcfda3d034961a3d5fb26fea2d7e7d5bc8e6 Mon Sep 17 00:00:00 2001 From: Erik Nygren <erik.nygren@sbb.ch> Date: Mon, 29 Apr 2019 10:13:39 +0200 Subject: [PATCH] minor changes in render_qt.py -> grid size --- examples/training_navigation.py | 5 +++-- notebooks/CanvasEditor.ipynb | 32 +++++++------------------------- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/examples/training_navigation.py b/examples/training_navigation.py index 6a38852..3566a3b 100644 --- a/examples/training_navigation.py +++ b/examples/training_navigation.py @@ -24,13 +24,15 @@ env = RailEnv(width=10, height=10, rail_generator=random_rail_generator(cell_type_relative_proportion=transition_probability), number_of_agents=1) + """ env = RailEnv(width=20, height=20, rail_generator=rail_from_list_of_saved_GridTransitionMap_generator( - ['../flatland/baselines/test-editor.npy']), + ['../env-data/tests/test_rail.npy']), number_of_agents=1) """ + env_renderer = RenderTool(env, gl="QT") handle = env.get_agent_handles() @@ -105,7 +107,6 @@ for trials in range(1, n_trials + 1): action = agent.act(np.array(obs[a]), eps=eps) action_prob[action] += 1 action_dict.update({a: action}) - # Environment step next_obs, all_rewards, done, _ = env.step(action_dict) for a in range(env.number_of_agents): diff --git a/notebooks/CanvasEditor.ipynb b/notebooks/CanvasEditor.ipynb index ed911ad..159b85a 100644 --- a/notebooks/CanvasEditor.ipynb +++ b/notebooks/CanvasEditor.ipynb @@ -55,24 +55,6 @@ "from ipywidgets import IntSlider, link, VBox, RadioButtons, HBox, interact" ] }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "['', 'C:\\\\Users\\\\u224870\\\\Innovation\\\\progressive_growing_of_gans', 'c:\\\\users\\\\u224870\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\python36.zip', 'c:\\\\users\\\\u224870\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\DLLs', 'c:\\\\users\\\\u224870\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\lib', 'c:\\\\users\\\\u224870\\\\appdata\\\\local\\\\programs\\\\python\\\\python36', 'c:\\\\users\\\\u224870\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\lib\\\\site-packages', 'c:\\\\users\\\\u224870\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\lib\\\\site-packages\\\\flatland_rl-0.1.1-py3.6.egg', 'c:\\\\users\\\\u224870\\\\projekte_git\\\\jupyter_canvas_widget', 'c:\\\\users\\\\u224870\\\\appdata\\\\local\\\\programs\\\\python\\\\python36\\\\lib\\\\site-packages\\\\IPython\\\\extensions', 'C:\\\\Users\\\\u224870\\\\.ipython']\n" - ] - } - ], - "source": [ - "import sys\n", - "print(sys.path)" - ] - }, { "cell_type": "code", "execution_count": 5, @@ -328,7 +310,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "c30a40a90919407d804dfc82ed67ea53", + "model_id": "15e10f8984c44a529cd86cc57c697c7f", "version_major": 2, "version_minor": 0 }, @@ -355,7 +337,7 @@ { "data": { "text/plain": [ - "0" + "1" ] }, "execution_count": 16, @@ -377,12 +359,12 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "b8951ec0e2504bf08b45539117774bda", + "model_id": "98e7e971e71848f19c417aa93e575179", "version_major": 2, "version_minor": 0 }, "text/plain": [ - "Output()" + "Output(outputs=({'output_type': 'stream', 'text': \"Debug: True\\ndebug: 0 2 {'type': 'mousemove', 'shiftKey': F…" ] }, "metadata": {}, @@ -464,7 +446,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": {}, "outputs": [], "source": [ @@ -480,7 +462,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -490,7 +472,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ -- GitLab