flatland.utils.editor moduleΒΆ
-
class
flatland.utils.editor.
Controller
(model, view)[source]ΒΆ Bases:
object
Controller to handle incoming events from the ipywidgets Updates the editor/model. Calls the View directly for things which do not directly effect the model (this means the mouse drag path before it is interpreted as transitions)
-
class
flatland.utils.editor.
EditorMVC
(env=None, sGL='PIL', env_filename='temp.pkl')[source]ΒΆ Bases:
object
EditorMVC - a class to encompass and assemble the Jupyter Editor Model-View-Controller.
-
class
flatland.utils.editor.
EditorModel
(env, env_filename='temp.pkl')[source]ΒΆ Bases:
object
-
click_agent
(cell_row_col)[source]ΒΆ The user has clicked on a cell - * If there is an agent, select it
- If that agent was already selected, then deselect it
- If there is no agent selected, and no agent in the cell, create one
- If there is an agent selected, and no agent in the cell, move the selected agent to the cell
-
mod_rail_2cells
(lrcCells, bAddRemove=True, iCellToMod=0, bPop=False)[source]ΒΆ Add transitions for rail between two cells lrcCells β list of two rc cells bAddRemove β whether to add (True) or remove (False) the transition iCellToMod β the index of the cell to modify: either 0 or 1
-
mod_rail_3cells
(lrcStroke, bAddRemove=True, bPop=True)[source]ΒΆ Add transitions for rail spanning three cells. lrcStroke β list containing βstrokeβ of cells across grid bAddRemove β whether to add (True) or remove (False) the transition The transition is added to or removed from the 2nd cell, consistent with entering from the 1st cell, and exiting into the 3rd. Both the forward and backward transitions are added, eg rcCells [(3,4), (2,4), (2,5)] would result in the transitions N->E and W->S in cell (2,4).
-