Commit cf66525c authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

cleanup rendering

parent 594adf63
Pipeline #2148 failed with stages
in 15 minutes and 17 seconds
......@@ -110,9 +110,9 @@ def get_shortest_paths(distance_map: DistanceMap) -> Dict[int, List[ShortestPath
position = best_next_action.next_position
direction = best_next_action.next_direction
if position == a.target:
shortest_paths[a.handle].append(
ShortestPathElement(position, direction,
RailEnvNextAction(RailEnvActions.DO_NOTHING, position, direction)))
return shortest_paths
shortest_paths[a.handle].append(
ShortestPathElement(position, direction,
RailEnvNextAction(RailEnvActions.STOP_MOVING, position, direction)))
return shortest_paths
......@@ -174,7 +174,6 @@ class PILGL(GraphicsLayer):
self.draws[layer].text(xyPixLeftTop, strText, font=self.font, fill=(0, 0, 0, 255))
def text_rowcol(self, rcTopLeft, strText, layer=AGENT_LAYER):
print("Text:", "rc:", rcTopLeft, "text:", strText, "layer:", layer)
xyPixLeftTop = tuple((array(rcTopLeft) * self.nPixCell)[[1, 0]])
self.text(*xyPixLeftTop, strText, layer)
......@@ -606,7 +605,6 @@ class PILSVG(PILGL):
self.draw_image_row_col(bg_svg, (row, col), layer=PILGL.SELECTED_AGENT_LAYER)
if show_debug:
print("Call text:")
self.text_rowcol((row + 0.2, col + 0.2,), str(agent_idx))
def set_cell_occupied(self, agent_idx, row, col):
......
......@@ -155,7 +155,7 @@ def test_shortest_path_predictor(rendering=False):
next_direction=1)),
ShortestPathElement((3, 8), 1, RailEnvNextAction(action=RailEnvActions.MOVE_FORWARD, next_position=(3, 9),
next_direction=1)),
ShortestPathElement((3, 9), 1, RailEnvNextAction(action=RailEnvActions.DO_NOTHING, next_position=(3, 9),
ShortestPathElement((3, 9), 1, RailEnvNextAction(action=RailEnvActions.STOP_MOVING, next_position=(3, 9),
next_direction=1))]
# extract the 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