From 230b94064bd13209cc3ab1df8e01a3b02e6827c0 Mon Sep 17 00:00:00 2001 From: s473561 Date: Mon, 29 May 2023 00:48:58 +0200 Subject: [PATCH] =?UTF-8?q?wozek=20odk=C5=82ada=20paczk=C4=99=20na=20rega?= =?UTF-8?q?=C5=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __pycache__/ekran.cpython-311.pyc | Bin 5998 -> 5622 bytes __pycache__/paczka.cpython-311.pyc | Bin 6120 -> 6116 bytes __pycache__/regal.cpython-311.pyc | Bin 4513 -> 4894 bytes __pycache__/wozek.cpython-311.pyc | Bin 6903 -> 6903 bytes ekran.py | 9 ++++----- main.py | 15 ++++++++------- paczka.py | 2 -- regal.py | 6 ++++++ 8 files changed, 18 insertions(+), 14 deletions(-) diff --git a/__pycache__/ekran.cpython-311.pyc b/__pycache__/ekran.cpython-311.pyc index fb3378d62cb05c7750db3b2e5958055af5e37f6d..47151c8f20826d2d4f8eb1985a91c2d1beee9488 100644 GIT binary patch delta 435 zcmaE-_f4C3IWI340}vd#TAVU>BCjOlt&Qrp7+D#E88ihq^DzBpXVjd`!Ij8pFgc4W zV6zmDI3t@ePiOE&jnME2PWtJeqe6qTL8LJnN>AX2ffRj5Bs7_dOh9Zi5SzKk zZgPvD8LK~#<2!l3;7wH@BqgR0CH6q-7FS+Te0F|LX>ML+k>BLKLK>_=K;clJ9?{MJ zg(MkG?10=NkkTS+AOW<+6G+`+1G_A-mZ}q9 w(g60p0f^-QB0#<`0{N^6Hq)$ delta 844 zcmY*XO=uHQ5PomdO>2@3`LWUvErFtKC=?3X784sZY5bwBKQ(Qw*06M!lIE|>CZrpp z73raeUStowc~dEZAh~!{@FWOrX`wC%o;*rH5K#}#Y?7jH*>Ao#^Ub{3dHbXP+ko^! zk{k?I?SrOlK9K_a%j;f~JH2ac?u^2xSlCy$3%}d>mLWJ~K4>V88><2(G?$3hhVS>s z2%D_bbdyQ2`Jo3wO<3YBXNlC!Rb$W5|MDo7wW`8N)Kfic{io+G{c0oFOlYeK3j$|T zY-3nKgno>M+u#Hm(_YD_pjE+5oAzumSI!sYu+0=#(x5JyqTVpb<(x*RhC(6eC2?1^ z0>uRi%Q-z=(UyxjsH#dqg%Ng-v2&==ZX!HlpS|6OOb`PWtcwRu&qj1VIP#`*Cm7oc z#&(^tZD;K5*!zk76l`lNJ1KoHrSB&6?Sy{d?^++H=jWl=s!)IBIK}M|EDaH3$64Z+ zjHIhayn>EMz2LG5(lv?^ge8a@58XW>3YzYM47yfcN-xU`)ocd(NOqARX1sF`iMNm@ z>VMqFc;GyFeF$LzqQpmu+aPIldxpdr+)NsGJfBYA{zr15A-RmkbQB=n7^V)>#*DX5 zoJ03?ea$<-&nA%q$smq^C(xKoyVaGf(Iq!$43i`xxNm&*-L>^%qY3}$RTw6}L}1;U z6H~MDqB@?@Nc)yEctFmd_=esx5#ZaJrpLLRsDn`+PMv&YA{$8Fu ze)3gOm(5p2l^NxYSmi%3;3g)Ei+8(~GBN@cVJADndSb8eDt-h@f5D-sNEhfZ0Q~GO ANB{r; delta 160 zcmaE&|3aU4IWI340}$*!Q=F2rk@vE&fHM;VLj%JNA(0OD4{QuP0-N6n$1+a7DC)Ag uS2Ueb-h@^D0|Rbivaoo!TR9^mP!V>rBdjO(3a{cvu=E!kii&iBP67aUwkyW~ diff --git a/__pycache__/regal.cpython-311.pyc b/__pycache__/regal.cpython-311.pyc index 37de8cc303e075649d3ba2c60ff19c476e642bd3..c7d75cf32b600c4e409ba000a017222f016ab678 100644 GIT binary patch delta 477 zcmZ3eJWq{pIWI340}$M}S)8(*XCt38Go#t$AZBfW6xJ4oDE1D93dSgoUVlLL4~MC*V$rZdzqr7&hQfpizi)G%aC-ped6Rl~T9k%3_~5JLbXLkdGM15lP} z@;+v{dhF7gOnyZmb2OQYWPsEyw#0&h)V!1;S%{bjNQ}K8F*!RiJ@poAc}8kcYB4iV zP(eYVhzBGoQBYbE4^WF^Z<`s5g*VTP0q=`_$`=<+$QS_7&Dem zP8JAL;$mS{|Gl= diff --git a/__pycache__/wozek.cpython-311.pyc b/__pycache__/wozek.cpython-311.pyc index 578d94e8a4f44a56c5402a8e4e186f08f170685b..406dafd25f29794a209f22189270ebe09a229eaa 100644 GIT binary patch delta 19 Zcmexv`rVXkIWI340}wpAxsmIw6aYh`2CD!7 delta 19 Zcmexv`rVXkIWI340}vP-+sO4+3IIPC1?B(% diff --git a/ekran.py b/ekran.py index ca73794..c009c34 100644 --- a/ekran.py +++ b/ekran.py @@ -50,11 +50,10 @@ def zwroc_regaly_kategoria(kategoria): lista_reg.append(reg) return lista_reg -def zwroc_regaly_wspolrzedne(x_reg, y_reg): - for regal in lista_regalow: - if regal.wiersz == obliczPixeleNaPodstawieKratek(x_reg) and regal.kolumna == obliczPixeleNaPodstawieKratek(y_reg): - return regal - +# def zwroc_regaly_wspolrzedne(x_reg, y_reg): +# for regal in lista_regalow: +# if regal.wiersz == obliczPixeleNaPodstawieKratek(x_reg) and regal.kolumna == obliczPixeleNaPodstawieKratek(y_reg): +# return regal def narysuj_siatke(): blockSize = 70 # Set the size of the grid block diff --git a/main.py b/main.py index 2cbd14b..ac27858 100644 --- a/main.py +++ b/main.py @@ -15,7 +15,7 @@ pygame.init() def main(): wozek = Wozek() - paczka = Paczka('duzy', 10, 'ogród', False, True, False, any, any, any, any, any) + paczka = Paczka('duzy', 10, 'narzedzia', False, True, False, any, any, any, any, any) ekran.lista_paczek.add(paczka) paczka.update_position(a_pix, b_pix) @@ -43,12 +43,11 @@ def main(): if wozek.ln == 0: wozek.load_package() wozek.dynamic_wozek_picture - print(wozek.storage) ## wozek jedzie odlozyc paczke na regal - paczka1 = wozek.storage.pop() + paczka1 = wozek.storage[0] - array, reg = paczka1.tablica_do_drzewa('ogród') + array, reg = paczka1.tablica_do_drzewa(paczka1.kategoria) plikZPrzecinkami = open("DecisionTree/training_data.txt", 'w') @@ -83,9 +82,11 @@ def main(): wozek.przemiesc_wozek_po_sciezce(sciezka) # print(wozek.storage) - # if wozek.ln != 0: # drops package - # wozek.drop_package() - # wozek.dynamic_wozek_picture() + if wozek.ln != 0: # drops package + wozek.drop_package() + reg.put_package_on_the_regal(paczka1, predictions) + wozek.dynamic_wozek_picture() + if event.type == pygame.MOUSEBUTTONDOWN: # lewy przycisk myszy diff --git a/paczka.py b/paczka.py index 87fb725..d9acda5 100644 --- a/paczka.py +++ b/paczka.py @@ -72,7 +72,6 @@ class Paczka(pygame.sprite.Sprite): def tablica_do_drzewa(self, kategoria): tablica = [] - # rozmiar if self.rozmiar == 'maly': tablica.append(0) @@ -103,7 +102,6 @@ class Paczka(pygame.sprite.Sprite): else: tablica.append(1) reg = ekran.zwroc_regaly_kategoria(kategoria) - # czy dolna wolna if reg[0].is_dolna_free() is True: tablica.append(0) diff --git a/regal.py b/regal.py index 89fbe12..c2c0649 100644 --- a/regal.py +++ b/regal.py @@ -85,5 +85,11 @@ class Regal(pygame.sprite.Sprite): return True return False + def put_package_on_the_regal(self, package, where): + if(where == 0): + self.dolna.append(package) + else: + self.gorna.append(package) +