I have the maze:
I want to add Node (state, action) from Queue into states = [] without popup all Node in Queue
count = 0
max_element = queue.count()
for node in queue.queue_to_add_again():
if count < max_element:
states.append((node.state, node.action))
queue.add(node)
count += 1
else:
break
I have problem with infinite loop and cannot solve this maze. Someone can help me?
queue.count():
def count(self):
return len(self.queue)
queue.queue_to_add_again():
def queue_to_add_again(self):
return self.queue
