Skip to content
Snippets Groups Projects
Commit 33c181da authored by adrian_egli's avatar adrian_egli
Browse files

Merge branch 'adrian' into 'master'

Adrian

See merge request flatland/flatland!82
parents 6dd53c06 9a14a281
No related branches found
No related tags found
No related merge requests found
...@@ -69,15 +69,11 @@ class PILGL(GraphicsLayer): ...@@ -69,15 +69,11 @@ class PILGL(GraphicsLayer):
self.tColRail = (0, 0, 0) # black rails self.tColRail = (0, 0, 0) # black rails
self.tColGrid = (230,) * 3 # light grey for grid self.tColGrid = (230,) * 3 # light grey for grid
sColors = "d50000#c51162#aa00ff#6200ea#304ffe#2962ff#0091ea#00b8d4#00bfa5#00c853" + \ sColors = "ff0000#ff00FF#0000ff#00ff00#00FFFF#FFFF00#808080#000000" + \
"#d50000#c51162#aa00ff#6200ea#304ffe#2962ff#0091ea#00b8d4#00bfa5#00c853" + \
"#64dd17#aeea00#ffd600#ffab00#ff6d00#ff3d00#5d4037#455a64" "#64dd17#aeea00#ffd600#ffab00#ff6d00#ff3d00#5d4037#455a64"
self.ltAgentColors = [self.rgb_s2i(sColor) for sColor in sColors.split("#")] self.ltAgentColors = [self.rgb_s2i(sColor) for sColor in sColors.split("#")]
permute = np.random.permutation(len(self.ltAgentColors))
tmp = []
for p in permute:
tmp.append(self.ltAgentColors[p])
self.ltAgentColors = tmp
self.nAgentColors = len(self.ltAgentColors) self.nAgentColors = len(self.ltAgentColors)
self.window_root = None self.window_root = None
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Railway Scene Editor # Railway Scene Editor
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from IPython.core.display import display, HTML from IPython.core.display import display, HTML
display(HTML("<style>.container { width:95% !important; }</style>")) display(HTML("<style>.container { width:95% !important; }</style>"))
``` ```
%% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
from flatland.utils.editor import EditorMVC from flatland.utils.editor import EditorMVC
mvc = EditorMVC(sGL="PILSVG" ) mvc = EditorMVC(sGL="PILSVG" )
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Instructions ## Instructions
- Drag to draw (improved dead-ends) - Drag to draw (improved dead-ends)
- ctrl-click to add agent or select agent - ctrl-click to add agent or select agent
- if agent is selected: - if agent is selected:
- ctrl-click to move agent position - ctrl-click to move agent position
- use rotate agent to rotate 90° - use rotate agent to rotate 90°
- ctrl-shift-click to set target for selected agent - ctrl-shift-click to set target for selected agent
- target can be moved by repeating - target can be moved by repeating
- to Resize the env (cannot preserve work): - to Resize the env (cannot preserve work):
- select "Regen" tab, set regen size slider, click regenerate. - select "Regen" tab, set regen size slider, click regenerate.
- alt-click remove all rails from cell - alt-click remove all rails from cell
Demo Scene: complex_scene.pkl Demo Scene: complex_scene.pkl
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
mvc.view.display() mvc.view.display()
``` ```
%% Output %% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
......
This diff is collapsed.
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