Source code for flatland.utils.graphics_layer

import matplotlib.pyplot as plt
from numpy import array


[docs]class GraphicsLayer(object): def __init__(self): pass
[docs] def open_window(self): pass
[docs] def plot(self, *args, **kwargs): pass
[docs] def scatter(self, *args, **kwargs): pass
[docs] def text(self, *args, **kwargs): pass
[docs] def prettify(self, *args, **kwargs): pass
[docs] def show(self, block=False): pass
[docs] def pause(self, seconds=0.00001): pass
[docs] def clf(self): pass
[docs] def begin_frame(self): pass
[docs] def endFrame(self): pass
[docs] def get_image(self): pass
[docs] def save_image(self, filename): pass
[docs] def adapt_color(self, color, lighten=False): if type(color) is str: if color == "red" or color == "r": color = (255, 0, 0) elif color == "gray": color = (128, 128, 128) elif type(color) is list: color = tuple((array(color) * 255).astype(int)) elif type(color) is tuple: if type(color[0]) is not int: gcolor = array(color) color = tuple((gcolor[:3] * 255).astype(int)) else: color = self.tColGrid if lighten: color = tuple([int(255 - (255 - iRGB) / 3) for iRGB in color]) return color
[docs] def get_cmap(self, *args, **kwargs): return plt.get_cmap(*args, **kwargs)
[docs] def set_rail_at(self, row, col, binTrans, iTarget=None, isSelected=False, rail_grid=None, num_agents=None): """ 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. """ pass
[docs] def set_agent_at(self, iAgent, row, col, iDirIn, iDirOut, isSelected=False, rail_grid=None, show_debug=False, clear_debug_text=True): pass
[docs] def set_cell_occupied(self, iAgent, row, col): pass
[docs] def resize(self, env): pass
[docs] def build_background_map(self, dTargets): pass