Commit 404d650a authored by hagrid67's avatar hagrid67
Browse files

Refactored editor as model-view-controller.

New notebook Editor2.ipynb.
parent 0b2b56f6
Pipeline #485 passed with stage
in 2 minutes and 40 seconds
This diff is collapsed.
%% Cell type:markdown id: tags:
# Rail Editor v0.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:90% !important; }</style>"))
```
%%%% Output: display_data
%% Cell type:code id: tags:
``` python
from flatland.utils.editor import EditorMVC, EditorModel, View, Controller
```
%% Cell type:code id: tags:
``` python
mvc = EditorMVC()
```
%%%% Output: display_data
%% 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
- direction chosen randomly to fit rail
- ctrl-shift-click to add target for last agent
- target can be moved by repeating
%% Cell type:code id: tags:
``` python
mvc.view.display()
```
%%%% Output: display_data
%% Cell type:code id: tags:
``` python
mvc.view.wOutput.clear_output()
mvc.view.wOutput
```
%%%% Output: display_data
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment