Skip to content
Snippets Groups Projects
Commit 5037c70a authored by hagrid67's avatar hagrid67 Committed by spmohanty
Browse files

updated instructions in editor notebook.

removed logging of filename for each keypress (silly)
parent 6bf1a626
No related branches found
No related tags found
No related merge requests found
...@@ -599,7 +599,7 @@ class EditorModel(object): ...@@ -599,7 +599,7 @@ class EditorModel(object):
self.redraw() self.redraw()
def setFilename(self, filename): def setFilename(self, filename):
self.log("filename = ", filename, type(filename)) # self.log("filename = ", filename, type(filename))
self.env_filename = filename self.env_filename = filename
def load(self): def load(self):
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Rail Editor v0.2 # Rail Editor v0.2
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
%load_ext autoreload %load_ext autoreload
%autoreload 2 %autoreload 2
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
import numpy as np import numpy as np
from numpy import array from numpy import array
import ipywidgets import ipywidgets
import IPython import IPython
from IPython.core.display import display, HTML from IPython.core.display import display, HTML
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
display(HTML("<style>.container { width:95% !important; }</style>")) display(HTML("<style>.container { width:95% !important; }</style>"))
``` ```
%% Output %% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from flatland.utils.editor import EditorMVC, EditorModel, View, Controller from flatland.utils.editor import EditorMVC, EditorModel, View, Controller
``` ```
%% Output
cpu
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
mvc = EditorMVC(sGL="PIL" ) # sGL="PIL") mvc = EditorMVC(sGL="PIL" ) # sGL="PIL")
``` ```
%% Output %% Output
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Instructions ## Instructions
- Drag to draw - Drag to draw (improved dead-ends)
- improved dead-ends - Shift-Drag to erase rails (erasing dead ends not yet automated - drag right across them)
- Shift-Drag to erase rails
- erasing dead ends not yet automated - drag right across them
- ctrl-click to add agent - ctrl-click to add agent
- direction chosen randomly to fit rail - direction chosen randomly to fit rail
- ctrl-shift-click to add target for last agent - ctrl-shift-click to add target for last agent
- target can be moved by repeating - target can be moved by repeating
- to Resize the env (cannot preserve work):
- select "Regen" tab, set regen size slider, click regenerate.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
mvc.view.display() mvc.view.display()
``` ```
%% Output %% Output
len: 190 <class 'bytes'> temp.pkl /home/jeremy/projects/aicrowd/rl-trains/notebooks
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
mvc.view.wOutput.clear_output() mvc.view.wOutput.clear_output()
mvc.view.wOutput mvc.view.wOutput
``` ```
%% Output %% Output
%% Cell type:code id: tags:
``` python
len(mvc.editor.env.agents), len(mvc.editor.env.agents_static)
```
%% Output
(0, 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment