diff --git a/assigning.py b/assigning.py index 1430f9f..813e381 100644 --- a/assigning.py +++ b/assigning.py @@ -5,7 +5,7 @@ from codes_recognizer.rocognizer import recognizer def assigning(product_code_path, shelfs): c = None - code = product_code_path + code = product_code_path[0] # code = recognizer(product_code_path) product_color = str(code[0]) + str(code[1]) for shelf in shelfs: diff --git a/coder.py b/coder.py index caf576b..8961003 100644 --- a/coder.py +++ b/coder.py @@ -72,5 +72,6 @@ def create_image(product): d.text((28, 28), string, font=fnt, fill=(0, 0, 0)) path = 'img/codes/' + product.name + '.png' img.save(path) - return string + r = [string, path] + return r diff --git a/img/codes/Kinder-bueno.png b/img/codes/Kinder-bueno.png index 1ba42bf..ce2df48 100644 Binary files a/img/codes/Kinder-bueno.png and b/img/codes/Kinder-bueno.png differ diff --git a/main.py b/main.py index a82c2ba..8faa61c 100644 --- a/main.py +++ b/main.py @@ -79,11 +79,13 @@ def run(): ''' # list [x, y] dest_shelf = new_product.shelf(shelfs) - path = functions.a_star(board[agent.y][agent.x], dest_shelf, board) + dest_field = board[dest_shelf.y+1][dest_shelf.x] + path = functions.a_star(board[agent.y][agent.x], dest_field, board) + print(path) '''''' agent.item = new_product - # path.pop(len(path) - 1) + path.pop(len(path) - 1) next_step = path.pop(len(path) - 1) # agent.is_busy = True diff --git a/mcda.py b/mcda.py index a07060a..d4ed58a 100644 --- a/mcda.py +++ b/mcda.py @@ -103,6 +103,6 @@ def selectedSupply(): supply = [] for i in range(len(products)): supply.append([products[i].color, products[i].shape, products[i].mass, products[i].size, '-']) - supply.append(['-', '-', 0, '-', '-']) + # supply.append(['-', '-', 0, '-', '-']) print(supply) return supply \ No newline at end of file diff --git a/product.py b/product.py index 9d6c357..47d91ee 100644 --- a/product.py +++ b/product.py @@ -32,5 +32,4 @@ class FinalProduct: self.img = create_image(self) def shelf(self, shelfs): - print(self.img) return assigning(self.img, shelfs); diff --git a/shelf.py b/shelf.py index c73d77c..0d74593 100644 --- a/shelf.py +++ b/shelf.py @@ -20,6 +20,7 @@ class Shelf: self.level3.append(product) def get_field(self): + return self.field def get_color(self):