forked from s444420/AL-2020
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
670f16b83f | ||
|
fdeecfcbf0 | ||
|
273aaa45fc | ||
|
f5b45dc7db | ||
3c2c69a19b | |||
92c06d9bda | |||
|
10548ec900 | ||
|
217057456f | ||
|
1463e10a33 | ||
|
8442924577 | ||
|
9dae531fd6 | ||
|
7eadd83803 | ||
|
238355d785 | ||
|
1864443980 | ||
2b1b66f3b3 |
@ -3,5 +3,5 @@
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7 (AL-2020)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (AL-2020)" project-jdk-type="Python SDK" />
|
||||
</project>
|
@ -4,7 +4,7 @@
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.7 (AL-2020)" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.8 (AL-2020)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
10
Raporty/final-evaluation.md
Normal file
10
Raporty/final-evaluation.md
Normal file
@ -0,0 +1,10 @@
|
||||
# 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.
BIN
__pycache__/coder.cpython-38.pyc
Normal file
BIN
__pycache__/coder.cpython-38.pyc
Normal file
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.
10
assigning.py
10
assigning.py
@ -5,14 +5,16 @@ from codes_recognizer.rocognizer import recognizer
|
||||
|
||||
def assigning(product_code_path, shelfs):
|
||||
c = None
|
||||
code = recognizer(product_code_path)
|
||||
print(code)
|
||||
code = product_code_path[0]
|
||||
# code = recognizer(product_code_path)
|
||||
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()
|
||||
|
||||
print("Product", product_code_path, "is on", c)
|
||||
name = product_code_path[1].split("/")
|
||||
name = name[2][:len(name[2])-4]
|
||||
|
||||
print("Product:", name, "is on", c.x, c.y)
|
||||
return c
|
||||
|
3
coder.py
3
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 path
|
||||
r = [string, path]
|
||||
return r
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 8.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.1 KiB |
7
main.py
7
main.py
@ -79,13 +79,15 @@ def run():
|
||||
'''
|
||||
# list [x, y]
|
||||
dest_shelf = new_product.shelf(shelfs)
|
||||
path = functions.a_star(board[agent.y][agent.x], dest_shelf.get_field(), 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)
|
||||
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
|
||||
@ -114,5 +116,4 @@ def run():
|
||||
pygame.display.flip()
|
||||
|
||||
|
||||
|
||||
run()
|
||||
|
2
mcda.py
2
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
|
@ -32,5 +32,4 @@ class FinalProduct:
|
||||
self.img = create_image(self)
|
||||
|
||||
def shelf(self, shelfs):
|
||||
print(self.img)
|
||||
return assigning(self.img, shelfs);
|
||||
|
Loading…
Reference in New Issue
Block a user