movement_planning #2

Merged
s473585 merged 13 commits from movement_planning into master 2023-05-24 14:28:17 +02:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit fc588a4ad5 - Show all commits

5
bfs.py
View File

@ -14,8 +14,9 @@ def bfs(istate, goalx, goaly):
return steps
element = successors(state)
explored.append(state)
explored.append((state.xpos, state.ypos, state.orientation))
for value in element :
if value not in explored and value not in fringe:
val = (value.xpos, value.ypos, value.orientation)
if val not in explored:
fringe.append(value)
return False

View File

@ -68,7 +68,7 @@ def main():
run = False
#keys_pressed = pygame.key.get_pressed()
draw_window(agent, fields)
steps = bfs(State(None, None, 0, 0, 'E'), 250, 100)
steps = bfs(State(None, None, 0, 0, 'E'), 250, 700)
for interm in steps:
if interm.action == 'LEFT':
agent.direction = (agent.direction - 1) % 4