agent is getting path to the shelf

This commit is contained in:
shaaqu 2020-06-09 18:22:14 +02:00
parent f4e67bce3b
commit 0ed316f044
2 changed files with 9 additions and 0 deletions

View File

@ -70,8 +70,13 @@ def run():
new_product = FinalProduct(supply_depot.item[0], supply_depot.item[1], supply_depot.item[2], new_product = FinalProduct(supply_depot.item[0], supply_depot.item[1], supply_depot.item[2],
supply_depot.item[3], prediction[0]) supply_depot.item[3], prediction[0])
print(new_product) print(new_product)
# list [x, y]
dest_shelf = new_product.shelf()
dest_field = board[dest_shelf[0], dest_shelf[1]]
path = functions.a_star(board[agent.y][agent.x], dest_field, board)
agent.item = new_product agent.item = new_product
if next_step is not None: if next_step is not None:
time.sleep(0.5) time.sleep(0.5)
if functions.check_turn(agent, next_step): if functions.check_turn(agent, next_step):

View File

@ -1,4 +1,5 @@
from coder import create_image from coder import create_image
from assigning import assigning
class Product: class Product:
@ -29,3 +30,6 @@ class FinalProduct:
self.price = 4.99 self.price = 4.99
self.img = create_image(self) self.img = create_image(self)
def shelf(self):
return assigning(self.img);