Newer
Older
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Rail Editor v0.2"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"from numpy import array\n",
"import ipywidgets\n",
"import IPython\n",
"from IPython.core.display import display, HTML"
]
},
{
"cell_type": "code",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<style>.container { width:95% !important; }</style>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display(HTML(\"<style>.container { width:95% !important; }</style>\"))"
]
},
{
"cell_type": "code",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"cpu\n"
]
}
],
"source": [
"from flatland.utils.editor import EditorMVC, EditorModel, View, Controller"
]
},
{
"cell_type": "code",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Figure size 432x288 with 0 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mvc = EditorMVC(sGL=\"PIL\" ) # sGL=\"PIL\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Instructions\n",
"- Drag to draw\n",
" - improved dead-ends\n",
"- Shift-Drag to erase rails\n",
" - erasing dead ends not yet automated - drag right across them\n",
"- ctrl-click to add agent\n",
" - direction chosen randomly to fit rail\n",
"- ctrl-shift-click to add target for last agent\n",
" - target can be moved by repeating "
]
},
{
"cell_type": "code",
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6b1f996bbb834fcc962c80041465ac2d",
"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",
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "bf8e0dd6aa564b42a5ec3aa19c31a679",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Output()"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mvc.view.wOutput.clear_output()\n",
"mvc.view.wOutput"
]
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
Erik Nygren
committed
"display_name": "Python 3",
Erik Nygren
committed
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
Erik Nygren
committed
"version": "3.6.5"
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
"autoclose": false,
"autocomplete": true,
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 1,
"hotkeys": {
"equation": "Ctrl-E",
"itemize": "Ctrl-I"
},
"labels_anchors": false,
"latex_user_defs": false,
"report_style_numbering": false,
"user_envs_cfg": false
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}