1
0
forked from s444399/AI

Upload files to ''

This commit is contained in:
Michal Kijowski 2020-05-08 20:35:15 +00:00
parent 9029e8d192
commit 67b1aac125

View File

@ -14,6 +14,7 @@ import easygui
from neurons import Neurons from neurons import Neurons
from whereDecision import WhereDecision from whereDecision import WhereDecision
from Evencik import Evencik from Evencik import Evencik
import pathlib
class MainWindow: class MainWindow:
def __init__(self, szerokosc, wysokosc, kruche, latwopalne, radioaktywne, niebezpieczne): def __init__(self, szerokosc, wysokosc, kruche, latwopalne, radioaktywne, niebezpieczne):
@ -75,7 +76,14 @@ class MainWindow:
self.wheel.move(event, self.map) self.wheel.move(event, self.map)
elif(event.type==pygame.MOUSEBUTTONDOWN): elif(event.type==pygame.MOUSEBUTTONDOWN):
if (type(self.map[0][2]) == Floor): if (type(self.map[0][2]) == Floor):
whatIsIt = self.neurons.whatIsIt(easygui.fileopenbox("Wybierz zdjęcie paczki", "Wybierz zdjęcie paczki", filetypes = [["*.jpg", "*.jpeg", "*.png", "Pliki graficzne"]])) meh = easygui.fileopenbox("Wybierz zdjęcie paczki", "Wybierz zdjęcie paczki", filetypes = [["*.jpg", "*.jpeg", "*.png", "Pliki graficzne"]])
if meh is None:
return
while pathlib.Path(meh).suffix!=".jpg" and pathlib.Path(meh).suffix!=".jpeg" and pathlib.Path(meh).suffix!=".png":
meh = easygui.fileopenbox("Wybierz zdjęcie paczki", "Wybierz zdjęcie paczki", filetypes = [["*.jpg", "*.jpeg", "*.png", "Pliki graficzne"]])
if meh is None:
return
whatIsIt = self.neurons.whatIsIt(meh)
where = self.whereDecision.recognize(whatIsIt, self.regalsik()) where = self.whereDecision.recognize(whatIsIt, self.regalsik())
self.map[0][2] = BoxOnTheFloor(self.screen, self.cell, 0, 2, Box()) self.map[0][2] = BoxOnTheFloor(self.screen, self.cell, 0, 2, Box())
star = AStar() star = AStar()
@ -143,4 +151,4 @@ class MainWindow:
for regal in self.regals: for regal in self.regals:
if self.map[regal[0]][regal[1]].isOccupied()==False: if self.map[regal[0]][regal[1]].isOccupied()==False:
tmp.append(regal) tmp.append(regal)
return tmp return tmp