flatland.utils.graphics_pil moduleΒΆ
-
class
flatland.utils.graphics_pil.
PILGL
(width, height, jupyter=False, screen_width=800, screen_height=600)[source]ΒΆ Bases:
flatland.utils.graphics_layer.GraphicsLayer
-
AGENT_LAYER
= 3ΒΆ
-
PREDICTION_PATH_LAYER
= 1ΒΆ
-
RAIL_LAYER
= 0ΒΆ
-
SELECTED_AGENT_LAYER
= 4ΒΆ
-
SELECTED_TARGET_LAYER
= 5ΒΆ
-
TARGET_LAYER
= 2ΒΆ
-
get_image
()[source]ΒΆ return a blended / alpha composited image composed of all the layers, with layer 0 at the βbackβ.
-
idle
(seconds=1e-05)[source]ΒΆ process any display events eg redraw, resize. Return only after the given number of seconds, ie idle / loop until that number.
-
plot
(gX, gY, color=None, linewidth=3, layer=0, opacity=255, **kwargs)[source]ΒΆ Draw a line joining the points in gX, GY - each an
-
-
class
flatland.utils.graphics_pil.
PILSVG
(width, height, jupyter=False, screen_width=800, screen_height=600)[source]ΒΆ Bases:
flatland.utils.graphics_pil.PILGL
Note : This class should now ideally be called as PILPNG, but for backward compatibility, and to not introduce any breaking changes at this point we are sticking to the legacy name of PILSVG (when in practice we are not using SVG anymore)
-
load_pngs
(file_directory, rotate=False, agent_colors=False, background_image=None, whitefilter=None)[source]ΒΆ
-
set_agent_at
(agent_idx, row, col, in_direction, out_direction, is_selected, rail_grid=None, show_debug=False, clear_debug_text=True, malfunction=False)[source]ΒΆ
-
set_rail_at
(row, col, binary_trans, target=None, is_selected=False, rail_grid=None, num_agents=None, show_debug=True)[source]ΒΆ Set the rail at cell (row, col) to have transitions binTrans. The target argument can contain the index of the agent to indicate that agentβs target is at that cell, so that a station can be rendered in the static rail layer.
-