bfs_implementation #10

Merged
s473560 merged 5 commits from bfs_implementation into main 2023-04-23 20:54:10 +02:00
3 changed files with 17 additions and 1 deletions
Showing only changes of commit 560cceafc9 - Show all commits

View File

@ -13,7 +13,23 @@ class BFS:
self.explored = [] self.explored = []
def successor(self, state): def successor(self, state):
pass pos_x, pos_y, rotation = state
options = []
if rotation == directions[0]:
states = [(pos_x, pos_y - block_size, directions[0]), (pos_x, pos_y, directions[270]), (pos_x, pos_y, directions[90])]
actions = ['F', 'L', 'R']
elif rotation == directions[90]:
states = [(pos_x + block_size, pos_y, directions[90]), (pos_x, pos_y, directions[0]), (pos_x, pos_y, directions[180])]
actions = ['F', 'L', 'R']
elif rotation == directions[180]:
states = [(pos_x, pos_y + block_size, directions[180]), (pos_x, pos_y, directions[90]), (pos_x, pos_y, directions[270])]
actions = ['F', 'L', 'R']
elif rotation == directions[270]:
states = [(pos_x - block_size, pos_y, directions[270]), (pos_x, pos_y, directions[0]), (pos_x, pos_y, directions[180])]
actions = ['F', 'L', 'R']
return states, actions
def search(self): def search(self):
pass pass