Skip to content
Snippets Groups Projects

Resolve "simple pathfinding"

Merged Fabian Heinrich requested to merge 120-simple-pathfinding into dev
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -211,7 +211,7 @@ def create_movement_graph(state: StateRepresentation, diagonal=True) -> Graph:
@@ -211,7 +211,7 @@ def create_movement_graph(state: StateRepresentation, diagonal=True) -> Graph:
free_space = np.ones((width, height), dtype=bool)
free_space = np.ones((width, height), dtype=bool)
for counter in state["counters"]:
for counter in state["counters"]:
grid_idx = np.array(counter["pos"]).round().astype(int)
grid_idx = np.array(counter["pos"]).round().astype(int)
free_space[*grid_idx] = False
free_space[grid_idx[0], grid_idx[1]] = False
graph = networkx.Graph()
graph = networkx.Graph()
for i in range(width):
for i in range(width):
Loading