diff --git a/notebooks/Editor2.ipynb b/notebooks/Editor2.ipynb index e52945ef9678b38307996a5268dde51165417c0a..0705369b514edbae16f161ec0b672b340ec711d7 100644 --- a/notebooks/Editor2.ipynb +++ b/notebooks/Editor2.ipynb @@ -58,16 +58,10 @@ "metadata": {}, "outputs": [ { - "ename": "SyntaxError", - "evalue": "invalid syntax (graphics_pil.py, line 263)", - "output_type": "error", - "traceback": [ - "Traceback \u001b[1;36m(most recent call last)\u001b[0m:\n", - " File \u001b[0;32m\"c:\\users\\u216993\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\IPython\\core\\interactiveshell.py\"\u001b[0m, line \u001b[0;32m3291\u001b[0m, in \u001b[0;35mrun_code\u001b[0m\n exec(code_obj, self.user_global_ns, self.user_ns)\n", - " File \u001b[0;32m\"<ipython-input-4-cd594490df80>\"\u001b[0m, line \u001b[0;32m1\u001b[0m, in \u001b[0;35m<module>\u001b[0m\n from flatland.utils.editor import EditorMVC, EditorModel, View, Controller\n", - " File \u001b[0;32m\"c:\\users\\u216993\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\flatland_rl-0.1.1-py3.6.egg\\flatland\\utils\\editor.py\"\u001b[0m, line \u001b[0;32m21\u001b[0m, in \u001b[0;35m<module>\u001b[0m\n import flatland.utils.rendertools as rt\n", - "\u001b[1;36m File \u001b[1;32m\"c:\\users\\u216993\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\flatland_rl-0.1.1-py3.6.egg\\flatland\\utils\\rendertools.py\"\u001b[1;36m, line \u001b[1;32m7\u001b[1;36m, in \u001b[1;35m<module>\u001b[1;36m\u001b[0m\n\u001b[1;33m from flatland.utils.graphics_pil import PILGL, PILSVG\u001b[0m\n", - "\u001b[1;36m File \u001b[1;32m\"c:\\users\\u216993\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\flatland_rl-0.1.1-py3.6.egg\\flatland\\utils\\graphics_pil.py\"\u001b[1;36m, line \u001b[1;32m263\u001b[0m\n\u001b[1;33m newList.append( [word for word in os.listdir(directory): if word.startswith('flatland')] )\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n" + "name": "stdout", + "output_type": "stream", + "text": [ + "cairo installed: OK\n" ] } ], @@ -77,11 +71,56 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "<flatland.utils.graphics_pil.PILSVG object at 0x00000207B4DA0198> <class 'flatland.utils.graphics_pil.PILSVG'>\n", + "<super: <class 'PILSVG'>, <PILSVG object>> <class 'super'>\n", + " 0000000000000000 Background_#91D1DD.svg\n", + "WE 0000000000000100 Gleis_Deadend.svg\n", + "WW EE NN SS 1000010000100001 Gleis_Diamond_Crossing.svg\n", + "WW EE 0000010000000001 Gleis_horizontal.svg\n", + "EN SW 0000100000010000 Gleis_Kurve_oben_links.svg\n", + "WN SE 0000000001001000 Gleis_Kurve_oben_rechts.svg\n", + "ES NW 0001001000000000 Gleis_Kurve_unten_links.svg\n", + "NE WS 0100000000000010 Gleis_Kurve_unten_rechts.svg\n", + "NN SS 1000000000100000 Gleis_vertikal.svg\n", + "NN SS EE WW ES NW SE WN 1001011001101001 Weiche_Double_Slip.svg\n", + "EE WW EN SW 0000110000010001 Weiche_horizontal_oben_links.svg\n", + "EE WW SE WN 0000010001001001 Weiche_horizontal_oben_rechts.svg\n", + "EE WW ES NW 0001011000000001 Weiche_horizontal_unten_links.svg\n", + "EE WW NE WS 0100010000000011 Weiche_horizontal_unten_rechts.svg\n", + "NN SS EE WW NW ES 1001011000100001 Weiche_Single_Slip.svg\n", + "NE NW ES WS 0101001000000010 Weiche_Symetrical.svg\n", + "NN SS EN SW 1000100000110000 Weiche_vertikal_oben_links.svg\n", + "NN SS SE WN 1000000001101000 Weiche_vertikal_oben_rechts.svg\n", + "NN SS NW ES 1001001000100000 Weiche_vertikal_unten_links.svg\n", + "NN SS NE WS 1100000000100010 Weiche_vertikal_unten_rechts.svg\n", + "EW 0000000100000000 Bahnhof_#d50000_Deadend_links.svg\n", + "NS 0010000000000000 Bahnhof_#d50000_Deadend_oben.svg\n", + "WE 0000000000000100 Bahnhof_#d50000_Deadend_rechts.svg\n", + "SN 0000000010000000 Bahnhof_#d50000_Deadend_unten.svg\n", + "EE WW 0000010000000001 Bahnhof_#d50000_Gleis_horizontal.svg\n", + "NN SS 1000000000100000 Bahnhof_#d50000_Gleis_vertikal.svg\n", + "Clear rails\n" + ] + }, + { + "data": { + "text/plain": [ + "<Figure size 432x288 with 0 Axes>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ - "mvc = EditorMVC(sGL=\"PIL\" ) # sGL=\"PIL\")" + "mvc = EditorMVC(sGL=\"PILSVG\" ) # sGL=\"PIL\")" ] }, { @@ -102,22 +141,52 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": { "scrolled": false }, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "198e07236e2e4996accf8134a4641f6b", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(Canvas(), VBox(children=(Text(value='temp.pkl', description='Filename'), Button(description='Re…" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "mvc.view.display()" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": { "scrolled": false }, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "47371e94faa3422ca2d6b1d6e7a83e4f", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "mvc.view.wOutput.clear_output()\n", "mvc.view.wOutput" @@ -125,9 +194,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "(0, 0)" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "len(mvc.editor.env.agents), len(mvc.editor.env.agents_static)" ]