Update main.py
This commit is contained in:
parent
9f24b128eb
commit
0529f89343
14
src/main.py
14
src/main.py
@ -29,9 +29,9 @@ WAREHOUSE_MAP = [
|
||||
[0, 10, 0, 0, 0, 200, 200, 200, 200],
|
||||
[0, 0, 10, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 10, 0, 0, 200, 200, 200, 200],
|
||||
[0, 0, 10, 0, 0, 0, 0, 0, 0],
|
||||
[10, 0, 0, 0, 0, 200, 200, 200, 200],
|
||||
[0, 0, 0, 10, 0, 0, 0, 0, 0],
|
||||
[0, 0, 10, 10, 0, 0, 0, 0, 0],
|
||||
[10, 0, 0, 0, 10, 200, 200, 200, 200],
|
||||
[0, 0, 10, 10, 10, 0, 0, 0, 0],
|
||||
[0, 10, 0, 0, 0, 200, 200, 200, 200],
|
||||
]
|
||||
|
||||
@ -319,7 +319,7 @@ class Stain:
|
||||
class Agent:
|
||||
def __init__(self, pos, agent_direction="right"):
|
||||
self.pos = pos
|
||||
self.pos_coord = (get_position_from_pix(pos)[1], get_position_from_pix(pos)[0])
|
||||
self.pos_coord = get_position_from_pix(pos)
|
||||
self.image = IMAGE
|
||||
self.rect = self.image.get_rect(center=pos)
|
||||
self.goal = (0, 0)
|
||||
@ -443,7 +443,7 @@ Package_list = [
|
||||
print(a_star_search((6, 8), (0, 0), "down"))
|
||||
|
||||
#agent.path = breadth_first_search(agent.pos_coord, agent.agent_direction)
|
||||
agent.path = a_star_search(agent.pos_coord, (0, 0), agent.agent_direction)
|
||||
agent.path = a_star_search((agent.pos_coord[1], agent.pos_coord[0]), (0, 0), agent.agent_direction)
|
||||
|
||||
|
||||
print(agent.path)
|
||||
@ -497,8 +497,8 @@ while running:
|
||||
agent.goal = coord_goals.pop(0)
|
||||
agent.goal_achieved = False
|
||||
|
||||
#agent.path = breadth_first_search(agent.pos_coord, agent.agent_direction)
|
||||
agent.path = a_star_search(agent.pos_coord, agent.goal, agent.agent_direction)
|
||||
# agent.path = breadth_first_search(agent.pos_coord, agent.agent_direction)
|
||||
agent.path = a_star_search((agent.pos_coord[1], agent.pos_coord[0]), (agent.goal[1], agent.goal[0]), agent.agent_direction)
|
||||
|
||||
# DRAWING
|
||||
screen.blit(BACKGROUND, [0, 0])
|
||||
|
Loading…
Reference in New Issue
Block a user