Skip to content
Snippets Groups Projects
Commit 1510e426 authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

add a tag: QT_Rendering

parent 8bcde5de
No related branches found
Tags v0.3.3
No related merge requests found
%% Cell type:markdown id: tags:
# Rail Editor v0.2
%% Cell type:code id: tags:
``` python
%load_ext autoreload
%autoreload 2
```
%% Cell type:code id: tags:
``` python
import numpy as np
from numpy import array
import ipywidgets
import IPython
from IPython.core.display import display, HTML
```
%% Cell type:code id: tags:
``` python
display(HTML("<style>.container { width:95% !important; }</style>"))
```
%% Output
%% Cell type:code id: tags:
``` python
from flatland.utils.editor import EditorMVC, EditorModel, View, Controller
```
%% Output
cairo installed: OK
Traceback (most recent call last):
File "c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\IPython\core\interactiveshell.py", line 3291, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-4-cd594490df80>", line 1, in <module>
from flatland.utils.editor import EditorMVC, EditorModel, View, Controller
File "c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py", line 761
else:
^
SyntaxError: invalid syntax
%% Cell type:code id: tags:
``` python
mvc = EditorMVC(sGL="PILSVG" ) # sGL="PIL")
```
%% Output
<flatland.utils.graphics_pil.PILSVG object at 0x00000228826E5048> <class 'flatland.utils.graphics_pil.PILSVG'>
<super: <class 'PILSVG'>, <PILSVG object>> <class 'super'>
Clear rails
%% Cell type:markdown id: tags:
## Instructions
- Drag to draw (improved dead-ends)
- Shift-Drag to erase rails (erasing dead ends not yet automated - drag right across them)
- ctrl-click to add agent or select agent
- if agent is selected:
- ctrl-click to move agent position
- use rotate agent to rotate 90°
- ctrl-shift-click to set target for selected agent
- target can be moved by repeating
- to Resize the env (cannot preserve work):
- select "Regen" tab, set regen size slider, click regenerate.
- alt-click remove all rails from cell
%% Cell type:code id: tags:
``` python
mvc.view.display()
```
%% Output
<flatland.utils.graphics_pil.PILSVG object at 0x0000022882FA48D0> <class 'flatland.utils.graphics_pil.PILSVG'>
<super: <class 'PILSVG'>, <PILSVG object>> <class 'super'>
<flatland.utils.graphics_pil.PILSVG object at 0x000002288301CEB8> <class 'flatland.utils.graphics_pil.PILSVG'>
<super: <class 'PILSVG'>, <PILSVG object>> <class 'super'>
<flatland.utils.graphics_pil.PILSVG object at 0x000002288318CD30> <class 'flatland.utils.graphics_pil.PILSVG'>
<super: <class 'PILSVG'>, <PILSVG object>> <class 'super'>
<flatland.utils.graphics_pil.PILSVG object at 0x0000022883001D30> <class 'flatland.utils.graphics_pil.PILSVG'>
<super: <class 'PILSVG'>, <PILSVG object>> <class 'super'>
<flatland.utils.graphics_pil.PILSVG object at 0x0000022882FCC438> <class 'flatland.utils.graphics_pil.PILSVG'>
<super: <class 'PILSVG'>, <PILSVG object>> <class 'super'>
<flatland.utils.graphics_pil.PILSVG object at 0x0000022886C20668> <class 'flatland.utils.graphics_pil.PILSVG'>
<super: <class 'PILSVG'>, <PILSVG object>> <class 'super'>
complex_rail_generator: num_agents > nr_start_goal, changing num_agents
complex_rail_generator: num_agents > nr_start_goal, changing num_agents
<flatland.utils.graphics_pil.PILSVG object at 0x0000022882DF7518> <class 'flatland.utils.graphics_pil.PILSVG'>
<super: <class 'PILSVG'>, <PILSVG object>> <class 'super'>
%% Cell type:code id: tags:
``` python
mvc.view.wOutput.clear_output()
mvc.view.wOutput
```
%% 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