grid changes

This commit is contained in:
Aleksander Szamałek 2022-06-10 08:52:43 +02:00
parent 530b221763
commit 9443c03e0a
2 changed files with 7 additions and 7 deletions

12
main.py
View File

@ -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))]

View File

@ -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