Skip to content
Snippets Groups Projects
Commit 404d650a authored by hagrid67's avatar hagrid67
Browse files

Refactored editor as model-view-controller.

New notebook Editor2.ipynb.
parent 0b2b56f6
No related branches found
Tags submission-v7.8
No related merge requests found
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
%% Cell type:code id: tags:
``` python
from flatland.utils.editor import EditorMVC, EditorModel, View, Controller
```
%% Output
cpu
%% Cell type:code id: tags:
``` python
mvc = EditorMVC()
```
%% Output
%% 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
%% Cell type:code id: tags:
``` python
mvc.view.wOutput.clear_output()
mvc.view.wOutput
```
%% Output
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