order_visualization #5
12
main.py
12
main.py
@ -35,7 +35,7 @@ def agent_portrayal(agent):
|
|||||||
elif agent.current_rotation == Direction.left:
|
elif agent.current_rotation == Direction.left:
|
||||||
shape = "img/image_left.png"
|
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):
|
if isinstance(agent, PatchAgent):
|
||||||
color = colors[0]
|
color = colors[0]
|
||||||
@ -48,11 +48,11 @@ def agent_portrayal(agent):
|
|||||||
elif agent.patch_type == PatchType.diffTerrain:
|
elif agent.patch_type == PatchType.diffTerrain:
|
||||||
portrayal = {"Shape": "img/puddle.png", "scale": 1.0, "Layer": 0}
|
portrayal = {"Shape": "img/puddle.png", "scale": 1.0, "Layer": 0}
|
||||||
elif agent.patch_type == PatchType.packingShelf:
|
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:
|
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:
|
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:
|
elif agent.patch_type == PatchType.divider:
|
||||||
portrayal = \
|
portrayal = \
|
||||||
@ -96,8 +96,8 @@ if __name__ == '__main__':
|
|||||||
scale = base / gridWidth
|
scale = base / gridWidth
|
||||||
|
|
||||||
diagram = GridWithWeights(gridWidth, gridHeight)
|
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.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), (2, 6), (5, 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)),
|
diagram.packingStations = [(PatchType.packingShelf, (4, 8)), (PatchType.packingRefrigerator, (4, 6)),
|
||||||
(PatchType.packingDoor, (4, 2))]
|
(PatchType.packingDoor, (4, 2))]
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class PathFinderOnStates:
|
|||||||
|
|
||||||
if action == action.action_type.MOVE:
|
if action == action.action_type.MOVE:
|
||||||
if curr_state.agent_position in self.game_constants.diffTerrain:
|
if curr_state.agent_position in self.game_constants.diffTerrain:
|
||||||
cost = curr_state.cost + 20
|
cost = curr_state.cost + 45
|
||||||
# tutaj koszt kaluzy
|
# tutaj koszt kaluzy
|
||||||
else:
|
else:
|
||||||
cost = curr_state.cost + 1
|
cost = curr_state.cost + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user