diff --git a/ForkliftAgent.py b/ForkliftAgent.py index 502bdc6..b2bf5f0 100644 --- a/ForkliftAgent.py +++ b/ForkliftAgent.py @@ -102,9 +102,9 @@ class ForkliftAgent(AgentBase): packing_station: GridLocation = None stations = dict(self.graph.packingStations) if i.real_type == ItemType.SHELF: - packing_station = stations[PatchType.packingA] + packing_station = stations[PatchType.packingShelf] elif i.real_type == ItemType.REFRIGERATOR: - packing_station = stations[PatchType.packingB] + packing_station = stations[PatchType.packingRefrigerator] elif i.real_type == ItemType.DOOR: packing_station = stations[PatchType.packingC] diff --git a/PatchType.py b/PatchType.py index 289107d..96a4c05 100644 --- a/PatchType.py +++ b/PatchType.py @@ -7,7 +7,7 @@ class PatchType(enum.Enum): item = 3 wall = 4 diffTerrain = 5 - packingA = 6 - packingB = 7 - packingC = 8 + packingShelf = 6 + packingRefrigerator = 7 + packingDoor = 8 divider = 9 diff --git a/img/door_d.jpg b/img/door_d.jpg new file mode 100644 index 0000000..8ade864 Binary files /dev/null and b/img/door_d.jpg differ diff --git a/img/fridge_f.jpg b/img/fridge_f.jpg new file mode 100644 index 0000000..729fbc8 Binary files /dev/null and b/img/fridge_f.jpg differ diff --git a/img/shelf_s.jpg b/img/shelf_s.jpg new file mode 100644 index 0000000..0e1e552 Binary files /dev/null and b/img/shelf_s.jpg differ diff --git a/main.py b/main.py index c6e2056..ffa4084 100644 --- a/main.py +++ b/main.py @@ -51,6 +51,13 @@ def agent_portrayal(agent): portrayal = {"Shape": "img/okB00mer.png", "scale": 1.0, "Layer": 0} 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} + elif agent.patch_type == PatchType.packingRefrigerator: + portrayal = {"Shape": "img/fridge_f.jpg", "scale": 1.0, "Layer": 0} + elif agent.patch_type == PatchType.packingDoor: + portrayal = {"Shape": "img/door_d.jpg", "scale": 1.0, "Layer": 0} + elif agent.patch_type == PatchType.divider: portrayal = \ {"Shape": "rect", @@ -83,7 +90,7 @@ if __name__ == '__main__': 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.packingStations = [(PatchType.packingA, (4, 8)), (PatchType.packingB, (4, 6)), (PatchType.packingC, (4, 2))] + diagram.packingStations = [(PatchType.packingShelf, (4, 8)), (PatchType.packingRefrigerator, (4, 6)), (PatchType.packingDoor, (4, 2))] grid = CanvasGrid(agent_portrayal, gridWidth, gridHeight, scale * gridWidth, scale * gridHeight)