Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

21 changed files with 12 additions and 27 deletions

View File

@ -3,5 +3,5 @@
<component name="JavaScriptSettings"> <component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" /> <option name="languageLevel" value="ES6" />
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (AL-2020)" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (AL-2020)" project-jdk-type="Python SDK" />
</project> </project>

View File

@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$"> <content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" /> <excludeFolder url="file://$MODULE_DIR$/venv" />
</content> </content>
<orderEntry type="jdk" jdkName="Python 3.8 (AL-2020)" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.7 (AL-2020)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
</module> </module>

View File

@ -1,10 +0,0 @@
# Raport final-evaluation
### Algorytm mcda w projekcie
Do magazynu przyjerzdza dostawa 20 produktów, które są selekcjonowane przez algorytm mcda(Multiple Criteria Decision Analysis) i zwracane za pomocą listy przez funkcję `selectedSupply()`.
### Rozpoznawanie produktów
Przy wykorzystaniu drzewa decyzyjnego, Agent rozpoznaje produkty pochodzące z dostawy na podstawie ich cech (kolor, kształt, masa, rozmiar), a następnie nadaje im unikalny kod produktu tworzony na podstawie tych cech.
### Digit recognizer
Każdemu produktowi przydzielany jest kod produktu i zapisywany w formacie .png. Recognizer rozpoznaje ciag cyfr, a nastepnie przekazyje go do metody `assigning.py`, która przydziela produkty do odpowiednich półek.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,16 +5,14 @@ from codes_recognizer.rocognizer import recognizer
def assigning(product_code_path, shelfs): def assigning(product_code_path, shelfs):
c = None c = None
code = product_code_path[0] code = recognizer(product_code_path)
# code = recognizer(product_code_path) print(code)
product_color = str(code[0]) + str(code[1]) product_color = str(code[0]) + str(code[1])
print(product_color)
for shelf in shelfs: for shelf in shelfs:
if shelf.color == product_color: if shelf.color == product_color:
shelf.add_product(code) shelf.add_product(code)
c = shelf.get_field() c = shelf.get_field()
name = product_code_path[1].split("/") print("Product", product_code_path, "is on", c)
name = name[2][:len(name[2])-4]
print("Product:", name, "is on", c.x, c.y)
return c return c

View File

@ -72,6 +72,5 @@ def create_image(product):
d.text((28, 28), string, font=fnt, fill=(0, 0, 0)) d.text((28, 28), string, font=fnt, fill=(0, 0, 0))
path = 'img/codes/' + product.name + '.png' path = 'img/codes/' + product.name + '.png'
img.save(path) img.save(path)
r = [string, path] return path
return r

BIN
img/codes/Góralki.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
img/codes/Kinder-bueno.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -79,15 +79,13 @@ def run():
''' '''
# list [x, y] # list [x, y]
dest_shelf = new_product.shelf(shelfs) dest_shelf = new_product.shelf(shelfs)
dest_field = board[dest_shelf.y+1][dest_shelf.x] path = functions.a_star(board[agent.y][agent.x], dest_shelf.get_field(), board)
path = functions.a_star(board[agent.y][agent.x], dest_field, board)
print(path)
'''''' ''''''
agent.item = new_product agent.item = new_product
path.pop(len(path) - 1) path.pop(len(path) - 1)
next_step = path.pop(len(path) - 1) next_step = path.pop(len(path) - 1)
# agent.is_busy = True agent.is_busy = True
if board[agent.y][agent.x] == dest_field: if board[agent.y][agent.x] == dest_field:
agent.is_busy = False agent.is_busy = False
@ -116,4 +114,5 @@ def run():
pygame.display.flip() pygame.display.flip()
run() run()

View File

@ -103,6 +103,6 @@ def selectedSupply():
supply = [] supply = []
for i in range(len(products)): for i in range(len(products)):
supply.append([products[i].color, products[i].shape, products[i].mass, products[i].size, '-']) supply.append([products[i].color, products[i].shape, products[i].mass, products[i].size, '-'])
# supply.append(['-', '-', 0, '-', '-']) supply.append(['-', '-', 0, '-', '-'])
print(supply) print(supply)
return supply return supply

View File

@ -32,4 +32,5 @@ class FinalProduct:
self.img = create_image(self) self.img = create_image(self)
def shelf(self, shelfs): def shelf(self, shelfs):
print(self.img)
return assigning(self.img, shelfs); return assigning(self.img, shelfs);

View File

@ -20,9 +20,7 @@ class Shelf:
self.level3.append(product) self.level3.append(product)
def get_field(self): def get_field(self):
return self.field return self.field
def get_color(self): def get_color(self):
return self.color return self.color