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

,.

parent 269258c6
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# Railway Scene Editor
%% 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
```
%% Cell type:code id: tags:
``` python
mvc = EditorMVC(sGL="PILSVG" )
```
%% Cell type:markdown id: tags:
## Instructions
- Drag to draw (improved dead-ends)
- 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
Demo Scene: complex_scene.pkl
%% Cell type:code id: tags:
``` python
mvc.view.display()
```
%% Output
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in on_click(self, wid, event)
238 bAlt = event["altKey"]
239 if bCtrl and not bShift and not bAlt:
--> 240 self.model.click_agent(rcCell)
241 elif bShift and bCtrl:
242 self.model.add_target(rcCell)
c:\users\u216993\appdata\local\programs\python\python36\lib\site-packages\flatland_rl-0.1.1-py3.6.egg\flatland\utils\editor.py in click_agent(self, rcCell)
686 if self.iSelectedAgent is None:
687 # Create a new agent and select it.
--> 688 agent_static = EnvAgentStatic(rcCell, 0, rcCell)
689 self.iSelectedAgent = self.env.add_agent_static(agent_static)
690 self.player = None # will need to start a new player
TypeError: __init__() missing 1 required positional argument: 'moving'
......
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