From 9443c03e0ac9b8fca72b6b5f700d21f79fc03cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20Szama=C5=82ek?= Date: Fri, 10 Jun 2022 08:52:43 +0200 Subject: [PATCH] grid changes --- main.py | 12 ++++++------ pathfinding/PathfinderOnStates.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index ea65039..8e97fb4 100644 --- a/main.py +++ b/main.py @@ -35,7 +35,7 @@ def agent_portrayal(agent): elif agent.current_rotation == Direction.left: shape = "img/image_left.png" - portrayal = {"Shape": shape, "scale": 1.0, "Layer": 0} + portrayal = {"Shape": shape, "scale": 1.0, "Layer": 2} if isinstance(agent, PatchAgent): color = colors[0] @@ -48,11 +48,11 @@ def agent_portrayal(agent): elif agent.patch_type == PatchType.diffTerrain: portrayal = {"Shape": "img/puddle.png", "scale": 1.0, "Layer": 0} elif agent.patch_type == PatchType.packingShelf: - portrayal = {"Shape": "img/shelf_s.jpg", "scale": 1.0, "Layer": 0} + portrayal = {"Shape": "img/shelf_s.jpg", "scale": 1.0, "Layer": 1} elif agent.patch_type == PatchType.packingRefrigerator: - portrayal = {"Shape": "img/fridge_f.jpg", "scale": 1.0, "Layer": 0} + portrayal = {"Shape": "img/fridge_f.jpg", "scale": 1.0, "Layer": 1} elif agent.patch_type == PatchType.packingDoor: - portrayal = {"Shape": "img/door_d.jpg", "scale": 1.0, "Layer": 0} + portrayal = {"Shape": "img/door_d.jpg", "scale": 1.0, "Layer": 1} elif agent.patch_type == PatchType.divider: portrayal = \ @@ -96,8 +96,8 @@ if __name__ == '__main__': scale = base / gridWidth diagram = GridWithWeights(gridWidth, gridHeight) - diagram.walls = [(6, 5), (6, 6), (6, 7), (6, 8), (2, 3), (2, 4), (3, 4), (4, 4), (6, 4)] - diagram.puddles = [(2, 2), (2, 5), (2, 6), (5, 4)] + diagram.walls = [(6, 5), (6, 6), (6, 7), (6, 8), (2, 3), (2, 4), (2, 6), (4, 7), (3, 4), (4, 4), (6, 4)] + diagram.puddles = [(2, 2), (2, 5), (5, 4), (4, 8), (4, 6), (4, 2)] diagram.packingStations = [(PatchType.packingShelf, (4, 8)), (PatchType.packingRefrigerator, (4, 6)), (PatchType.packingDoor, (4, 2))] diff --git a/pathfinding/PathfinderOnStates.py b/pathfinding/PathfinderOnStates.py index 65b306d..1cc88fc 100644 --- a/pathfinding/PathfinderOnStates.py +++ b/pathfinding/PathfinderOnStates.py @@ -57,7 +57,7 @@ class PathFinderOnStates: if action == action.action_type.MOVE: if curr_state.agent_position in self.game_constants.diffTerrain: - cost = curr_state.cost + 20 + cost = curr_state.cost + 45 # tutaj koszt kaluzy else: cost = curr_state.cost + 1