implementation for 2nd individual project

This commit is contained in:
Kamila Bobkowska 2020-05-07 16:03:35 +00:00
parent 8421d2f7a7
commit fc6a719351

14
Main.py
View File

@ -65,10 +65,10 @@ def drawGrid(grid, size):
#glass #glass
img = garbageR img = garbageR
elif grid[row][column] == 4: elif grid[row][column] == 4:
#organic #cardboard
img = garbageBL img = garbageBL
elif grid[row][column] == 5: elif grid[row][column] == 5:
#mixede #metal
img = garbageBLK img = garbageBLK
elif row == TheDump[:,0] and column == TheDump[:,1]: elif row == TheDump[:,0] and column == TheDump[:,1]:
grid[row][column] = 0 grid[row][column] = 0
@ -172,15 +172,13 @@ while not done:
Xz=np.where(all==x)[0] Xz=np.where(all==x)[0]
x =[item for item, count in collections.Counter(Xz).items() if count > 1] x =[item for item, count in collections.Counter(Xz).items() if count > 1]
predicted=numbering.pred(dumpsters[x[0]].numberx,dumpsters[x[0]].numbery) predicted=numbering.pred(dumpsters[x[0]].numberx,dumpsters[x[0]].numbery)
#recognizing whether a house is our client and trying to collect trash
if(predicted not in paying_customers): if(predicted not in paying_customers):
print("House number is: ",predicted," but it is not our customer") print("House number is: ",predicted," but it is not our customer")
elif GT.collectingTrash(dumpsters, x[0]):
dumpsters[x[0]].empty()
print("House number is: ",predicted)
elif GT.amIFull():
print("DUMPSTER TRUCK FULL")
else: else:
print("No more space for this kind of trash") print("House number is: ",predicted)
GT.collectingTrash(dumpsters, x[0])