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">
<option name="languageLevel" value="ES6" />
</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>

View File

@ -4,7 +4,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</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" />
</component>
</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):
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])
print(product_color)
for shelf in shelfs:
if shelf.color == product_color:
shelf.add_product(code)
c = shelf.get_field()
name = product_code_path[1].split("/")
name = name[2][:len(name[2])-4]
print("Product:", name, "is on", c.x, c.y)
print("Product", product_code_path, "is on", c)
return c

View File

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

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]
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_field, board)
path = functions.a_star(board[agent.y][agent.x], dest_shelf.get_field(), board)
print(path)
''''''
agent.item = new_product
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:
agent.is_busy = False
@ -116,4 +114,5 @@ def run():
pygame.display.flip()
run()

View File

@ -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

View File

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

View File

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