From 734505ab3db2ee0cb0a09ad8d9e6f3f36cb22639 Mon Sep 17 00:00:00 2001 From: Tomek Date: Tue, 19 May 2020 17:45:15 +0200 Subject: [PATCH] Dodanie podprojektu --- .idea/misc.xml | 2 +- .idea/wozek.iml | 2 +- __pycache__/agent.cpython-38.pyc | Bin 0 -> 1981 bytes __pycache__/board.cpython-38.pyc | Bin 0 -> 1475 bytes __pycache__/data.cpython-38.pyc | Bin 0 -> 2169 bytes __pycache__/decision_tree.cpython-38.pyc | Bin 0 -> 4825 bytes __pycache__/field.cpython-38.pyc | Bin 0 -> 1638 bytes __pycache__/functions.cpython-38.pyc | Bin 0 -> 2998 bytes __pycache__/mcda.cpython-38.pyc | Bin 0 -> 2384 bytes __pycache__/product.cpython-38.pyc | Bin 0 -> 475 bytes __pycache__/settings.cpython-38.pyc | Bin 0 -> 585 bytes __pycache__/shelf.cpython-38.pyc | Bin 0 -> 600 bytes __pycache__/supply.cpython-38.pyc | Bin 0 -> 1288 bytes __pycache__/sweets.cpython-38.pyc | Bin 0 -> 491 bytes main.py | 4 +- mcda.py | 100 +++++++++++++++++++++++ product.py | 7 ++ supply.py | 64 +++++++++++++++ 18 files changed, 176 insertions(+), 3 deletions(-) create mode 100644 __pycache__/agent.cpython-38.pyc create mode 100644 __pycache__/board.cpython-38.pyc create mode 100644 __pycache__/data.cpython-38.pyc create mode 100644 __pycache__/decision_tree.cpython-38.pyc create mode 100644 __pycache__/field.cpython-38.pyc create mode 100644 __pycache__/functions.cpython-38.pyc create mode 100644 __pycache__/mcda.cpython-38.pyc create mode 100644 __pycache__/product.cpython-38.pyc create mode 100644 __pycache__/settings.cpython-38.pyc create mode 100644 __pycache__/shelf.cpython-38.pyc create mode 100644 __pycache__/supply.cpython-38.pyc create mode 100644 __pycache__/sweets.cpython-38.pyc create mode 100644 mcda.py create mode 100644 product.py create mode 100644 supply.py diff --git a/.idea/misc.xml b/.idea/misc.xml index 715ed69..adaa126 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/.idea/wozek.iml b/.idea/wozek.iml index a9742fc..904114b 100644 --- a/.idea/wozek.iml +++ b/.idea/wozek.iml @@ -4,7 +4,7 @@ - + diff --git a/__pycache__/agent.cpython-38.pyc b/__pycache__/agent.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7eee4502453830eb1bf743e3b70ea701838e2741 GIT binary patch literal 1981 zcmbVNPj4GV6rY)$U9ZJ>@Bhw^Y6g@b*NbQz9c%>63JYA2!crt$_;cut9@2CLdh{gie@Q$CX# zVE6WMLKekM#o(IXIsXJ_pDVzHOvi(dF671}AGB9YQ1*3_hS74(siM7Mn-%Ve~#Yj8k^ z1h_+{=}OO-ejTri4<3Bc-6<1YcDH(u6P*|RgYH&R4y$6){Z1EIGOW5dHLo@%M<$Hp zG*7EI4zRU+4ZwIX`?YvWT<1+5iQ`p!Asch!J}1N3AbD{!*D*o9*a@XfSl+T43C*^$Gf1eHxDow?zDWhl7UX5NMg$?)`NjC}TvX;WFQ+>oEaNWQ{xdvc7;^ER0 z@Z)PP0}I>#l>`d;jtg*>1Pb}yEG;exl&Ec&mj6hCev<-uo8T>iTLg;?=yzy(Rlt!A zLQ}$S!{%iXx0WKd#(i51*g=D2>R7fdWGF>@gLLmdKtk6UN=Q_UTzO~$-a5NUHt1#~ zW#~uFR$7bCL5OyOdd|?J>`XrAxnm7r`NHlc))#ZuOU60>j1{)v!AX_}Rfw5CWA*c2 zz{FGyoPS#H!Xbk+^AxpqwWqLko__WZPwh0i zYq=KQ+8Nb9G#R(eFoQcL^@P tW-Cz#(^Q<4my+6ZD8kjy3maj>>Jg%C3S@KDW)pttT=A3-E@OYt;Or-G@Bmx7g$5Y#i22luh);wsIAJTYCbn;LCdCo+IoRO5V7>z`)UbDf zKW1HTf$?mo%M0(Z%(7uTND(`ahBAUaCtvk>*l%Eah%J4Mo&n1_a1daTFo}W(E3gU| zpbiaa!Wyi@M{p4?!Ny=C7a7a=NF4EP_QP>*VYF=+%P?{7WVUA7(H30R4qVw_Er!Ud zPzzenKJs!`3yi;;*R(rwbPYNkHWum-M=p-q9&jvCMz+dpyjg+}F3v%?J6 zZnF*>)eP_2Y_taL`%JK4&3HG*3_bq&h}JT~*B?eSt2K_x2r%lTRIPFRKM}Zwdb^xY z+RORKp3|Sbo&Bll@UQK3#o`?v=;CKIU7>93j6t5xSUDw+75JWiiKVyXYiIcHtp9i_ zmP)78B!R9NJ|)c(Fa9E(5-T&m!X^h2Ugon>VsfjBH@MB-Ch~;pwzniGE;0Fbt7tMZ> zWjOy*_yr|s(+x<8RrQ zBPRZ_?I!x0{3iGKCU^O|sPj5vk2eL`8|YiM>-?fn*HQ7@<3fKTox6El$g3G%#w$5D z*RP%nEl$`e!>e1L*}$-LIXzkKZZym$vTLcU7^61HTq8sKF3qQiid9hI^KwhKaGX;4 zFq5GA3{khHE@7wE$Y51gB9xR#)l530Y1ECd_thkUA0zoSl~GDBwud{f3)k{K{}&dt BGavu} literal 0 HcmV?d00001 diff --git a/__pycache__/data.cpython-38.pyc b/__pycache__/data.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82c5772992f19063e8d47b9422f8399405315a29 GIT binary patch literal 2169 zcmbVNO>^5s7?x~FvEzKWNk5W?HlcwMw{@Xk6iV8-ZKg1UB&DGPv*RJN)-H-_S!-5u zTzk?}>6yO(!>PXj&hQ5~QAQUIaM6?-ABSAvSw)>DaRLnTtmfJGdER%|`|kVd?%-g* zhUe06-+lb`kf!~tCflD$Oez?`nyzU~W4fm`bfW7T%dqTc8p$w&napB+Ea#Xk&-z(` z4X{DrA=nij1}?&W0GbitQP>Z%L+o&ZkFYV=$5Z=J;0fS7G-J@bkYc4j23&;wIPheO z4**XAznJPz08gj!UjkNZy^KAaOf|0{{!F6jXC?Ta0zM6migPB_tN3MLwTH9teHB>6 zSNOFApJV5NFQoR1hH-O&+o`(GjV!j1zq<9wibc(M!rZYjZ>>8WH zc^a&;qLr@4DhDM!vR2xhhk>o8&z=l`g>e%j7(iMa?SU2|H7X@49S_Y1`iAy}zM+4K zM5RoUqJ0>ot%oTfn(`UglTqso_AoN>wOHPx zK9e24j-Ub}o z#Bf>->TKoy`?*p^s`N(|Z8o{jN*Pk1o_AXc*0RGOG6Qv89&0iW(dMa}SE_ddE`#bk zUFXsl_F8qG2lY@it8lr;>tU7Ake+RJq7hqi8uC>&UrnL}hPq#8)XKV%DeC?De;65A zfIc#79<}QvFS#93-|={S0cK(bI1W#$z>(nyj}fB@UCb1jt+@`d-l5X1iO6cUWD|#K zF1lWwBAyg&KQ2Qj&BVLrwRn79`B@Fl+*X5FH$=-1JIL{;Eh>3DqsZKXFK|*ah^H~_ z=2f^(xlM8UAGF>3-NJ3@`Zg~&g(u?6iN}iX+I4sk<2_gSk=b5zL*5-&aDB#Qxz^&o zh_bjw-M$4kEZ1om2k?`sBI98d!CJs(>omT#6|U}vxE?`d35lcN#Jaqav&cXx zo0P5W1CES!v?o+t?R@BsbeYm+|;DTm&tc#cLp&J2s&IkKZrG F)ZbDqCE5T0 literal 0 HcmV?d00001 diff --git a/__pycache__/decision_tree.cpython-38.pyc b/__pycache__/decision_tree.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..281b85f5dd1214adf2d56269daa48d8826ebd5ce GIT binary patch literal 4825 zcmbVQ&5zs06`vWB5~bD3&f0O-vD-`%yN+7NEt(cdUE47l!$FI7k=DsYbxLqK)GoCY zsU1?;F2OxCa*_1dOMxI42M7xIUnp{`7yTc2?aAlfdTD=eC~2ilb1Ai)&o__n`@Pu@ z*4Nt%&yWB0_upMT$Jjqc!`-t^z z)lzNrj#^V4^o@6!T36jiOm(NC-&AMRS**J1IkkblrOv7I=-cXfbpibvpkGj%fZhaj z2eXUnMa*8rY+YSamjTmNSJb!FOOJT}jFReQtejP^s8`WHr}zWbyZQ{2vaQMq(m2(X zlkNKBu-`Zcqn+Knva_fND?9N=VIT-__R!eIYvIibxyyt%u>Ld+zAKnYIy*w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#klva9t^XXL zj`k-^zrXI^`jY?td->$Q$_KaqMV&9*&ctf5|HX3tvVW0}`+ov`#ZYoudwB)tTROvX z1g+t&J*Z#GC6(#bC5b2wmh|OR)y7#H4rViz%b2@r*kG?1X!&(fIs+-i;z7iiXVwrH zY{TtE{~b;?>PlUUzNQ)~*y0c7Hyo6#becKEYujR{@Xn3Syb2aa;azUV8ul literal 0 HcmV?d00001 diff --git a/__pycache__/functions.cpython-38.pyc b/__pycache__/functions.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e39b7f480b6125339589101927430b7a987dfa41 GIT binary patch literal 2998 zcmZ`*&2Jk;6rY*>@Or&=LxpGy2!SXSMhH+GV9DnUPvzw$r zYcAo8Dh{08Tgw3<{sk`l1wG6OiBr#T>WSZ*brL5LYt77?H}Ci6&71e0XSH4r8NN6F z`QzJ*Pcrs5P3Av=$p>iJCOXL^AF@_C@)pNj48_Q4Ih=UT&>eX#&(iMDA5~fv(4O>v zV68w_WPq_Mt1`qG%9@NY)?{5aFh=r>T)<$c!b^9Qj?otS><^z>1Lq454$SK zL4;DbcjNW6t!0M{Jop?C9@=%ZY>F;teLfZU*dqJp?nD%#?||bDgua-2Q~w_0Y%82` zE8r3xK%xrzX2GW6p#*Vj;I4ri9pl!)&B1LH{2rg_Bk41wFJCCQq; zFMj^jl5qxV53~5oPe1--#f15`PGa5bZsx|n6@PZ)=8CCW-cW5o*{yi>wuwgRj*2%@ zy$cT#cKP;)*KZiV9cOu4Hyz`($3Hq7PWx(*uWf86oxGPO*=yrH6LmIKXAs*1WmTxi&ZA?z!6P1ui27M0T0eue z4&CFyM>O5Bz0>DF{&w2ync;T~-y`R5^wdzAu$#7raY=J|(z*zt z5#vmGJL#zBp(Ufu8GoMZmoXl5;TbRvOlXxRdJExbUF;>?F*+zCW!~H;42=FgWYDLZN9!lZ|wy)aWkqjJn z>-Vi+3U8U=B;jm7=WyqsUz_aj_G13Y)&mq zfxb#~93%_nXnj<-J|Z1_UtqOL(rD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$3gHna`0d(BMxeE%|`w0CSp<3;|?yb@sJ5C8Bw}$_qOvKK!0P5QS zOy42#0g1a1#!YmylhwSs*Xg%+BCRP9#!n7oi~pXEUKpnxe68=%qW>^|Cfx0&(Kv{Y zFe4?mjC;g+`(7f96iOS=D(pTqk6*Ggs?cXK%Rl@y#dE7RUH8&{lEg3T^P!G{EPAej zEOwCOh*4+8w8G{Pe31*(l68(o;XJb625=< OxBJU0`6YkZpZgbk!0#9U literal 0 HcmV?d00001 diff --git a/__pycache__/product.cpython-38.pyc b/__pycache__/product.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..61b31f2bfaf6fc71e78505c5e14745004a8cb8de GIT binary patch literal 475 zcmY*U!AiqG5S`s5HWmva9{qtH><5TQp#^V6kX}M?3E7p_rcK;U1xs%BXL|A@`~t7J z`U&1V`6jVYC%iX1o0+$7roCR55WCNhhj-*JE)K&(F$CNh=$15Tu?5~_L|Wcc-%D}- zFC?lV;LbsYBB3dgT4=eY$kQHX{JL{zbG=T>G(gWj_{_s2z+HeUQIVobf<@(lW#xlC zO%M?i=mcq=<+cvoEGbOwFB9i#-_19sA0V6T(XycBC9KcHZ|ul+kbW*lSMk&t>*8_p zV(cnUXYts$MVS{d{5_dP85gb3LGfCLO3hdEQYlt*A&A6L^KDN5)*0+u*cUV-HgvCNt;A<~#RAXc`5)d9!;L)p}mzG(76FYjS_pboFwCvJG^8=zm% CL1Wth literal 0 HcmV?d00001 diff --git a/__pycache__/settings.cpython-38.pyc b/__pycache__/settings.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19a5bce1bfd962c41ae310e0232e76f0e9f0a643 GIT binary patch literal 585 zcmY*VO;5r=5S?u+Rs<3af1(#|UW_3mka#h~gm7sZC)izRp|rSLR17!yGyV?$MX#PX zbMvCJ{V+J2_jcayyiRw<&1M}at`46McMRZ5i{mg!^a$#b=oUC|wj;b7E^uQ6j_K3+ zzc5Jk2&zpaz-1giGE0eQ`T^3WUf-SmwKrBmDsM1(7BWu! zz#9m)NRyR!FO#`gq@F6L(OGRW8!?Q-6j4t?wTOV#%GF{m_I6Rtu2WSG^+XZl$xmletKTEFA+v9a7G3Q+5a1V` C$AsGe literal 0 HcmV?d00001 diff --git a/__pycache__/shelf.cpython-38.pyc b/__pycache__/shelf.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16977edb6d52515d580b8de86f1d43743dbf7352 GIT binary patch literal 600 zcmZWm%}T>S5T4!q7^{_@#TN)dZ(c;C(1N!jgkC~$3E8!OX&ZM_rKLCfAbRXGc=RoD z_2k)`Cug>l795ywb}~EPd^_pY>oq{T`uTkL!1zVUp*fhe(9Jo51j%xU;SMC1&Kjii z%3~&31flzlb?9bZ?1$Y}`E}7(Oh#l!j7o#gZWbi958mRm+qn4e~nY@i| z8VD=40s(zMM5+ijtQ+!*4`me;dM4*tX)t#U5@{FjZ$KYm_`PgjCq1LINjmAX($iTs zNIJ@l%UO}!>)A++%f!(5X0fOOA%@doDTGgBi3XU@mSLaDSp z!4H8O{0{yD2VXdF@|{yp%q&H!REHy$Jn?+~{CQ^N$!@nBG8~&fzP;JN)lYKH4+ov+ zI8`4FFyI->`5xyC9B@CfJqNs3EbIvrSqr3U`81@}>B$)ZEJ zO+Q5Zl7&xr+k#(i(C;4_Bvm{aWx_nhXRLjd$62Pm zQIUc6N~9Pd+#RMP9h9{!Gl6GiaWpXxXu}(3wJ?up8RP=eI@f`ETgOtE4Ft_SGEZpR zKRQS&pyr8Y1kQjq7@5ylwW0}6jb}}pIroT9v?`X^^x{)KP?Q{^ArI z<+1K1QpAS5XWaXAH-r2#3%3;klwtANTCI9MJT<5;1aSc#-vT$-6}1)*_ZJ-y!Qe2 z>Lc{#$(htbo$&w7&SqwIXJ`F>574f6Uyob#-xM61hrtkK&Jp(@L9z|%gC`*Q6k;#O z{eQ+W8lubvLP5eLBwRAdH;{PJ!y4a((|4t;$wN#z7_F&xgff?imbDQy0{{R3 literal 0 HcmV?d00001 diff --git a/main.py b/main.py index f71fa65..8cc46c1 100644 --- a/main.py +++ b/main.py @@ -9,7 +9,7 @@ from agent import Agent from settings import Settings from board import create_board, draw_board from random import randint, choice - +from mcda import choseProducts # Inicjalizacja programu i utworzenie obiektu ekrany def run(): @@ -21,6 +21,8 @@ def run(): board = create_board(screen) my_tree = decision_tree.build_tree(data.learning_data) + produsctsFromSupply = choseProducts(5) + # for row in board: # for field in row: # print(field.cost_of_travel) diff --git a/mcda.py b/mcda.py new file mode 100644 index 0000000..742828c --- /dev/null +++ b/mcda.py @@ -0,0 +1,100 @@ +from supply import * + +allProducts = create_data_products() + +color = {'black': 16, 'gold': 10, 'purple': 5, 'brown': 7, 'blue': 12, 'white': 14, 'red': 13, 'orange': 11} +shape = {'rectangle': 15, 'pack': 19, 'square': 9, 'jar': 7} +size = {'small': 7, 'medium': 16, 'big': 13} + +def sizeValue(X): + if X.size == 'small': + return X.mass/5 + if X.size == 'medium': + return X.mass/10 + if X.size == 'big': + return X.mass/20 +parameters = { + 'color': {'weights': 3, 'q': 1, 'p': 5}, + 'shape': {'weights': 4, 'q': 1, 'p': 6}, + 'mass': {'weights': 0.5, 'q': 2, 'p': 10}, + 'size': {'weights': 1, 'q': 1, 'p': 8} + +} +def getConcordance(gA, gB, q, p): + if gB <= gA + q: + return 1 + if gB <= gA + p: + return (p - gB + gA) / (p - q) + return 0 + +def getAllTypeConcordance(A, B): + concordance = 0.0 + weight_sum = 0 + + parameter = parameters['color'] + w, q, p = parameter['weights'], parameter['q'], parameter['p'] + concordance += getConcordance(color[A.color], color[B.color], q, p) * w + weight_sum += w + + parameter = parameters['shape'] + w, q, p = parameter['weights'], parameter['q'], parameter['p'] + concordance += getConcordance(shape[A.shape], shape[B.shape], q, p) * w + weight_sum += w + + parameter = parameters['mass'] + w, q, p = parameter['weights'], parameter['q'], parameter['p'] + concordance += getConcordance(sizeValue(A), sizeValue(B), q, p) * w + weight_sum += w + + parameter = parameters['size'] + w, q, p = parameter['weights'], parameter['q'], parameter['p'] + concordance += getConcordance(size[A.size], size[B.size], q, p) * w + weight_sum += w + + concordance /= weight_sum + return concordance + +def getConcordanceAllProducts(): + + C = [] + + for i in range(len(allProducts)): + c = 0 + for j in range(len(allProducts)): + if j==i: + continue + else: + c += getAllTypeConcordance(allProducts[i], allProducts[j]) + c /= len(allProducts)-1 + C.append(c) + return C + +def choseProducts(number): + C = getConcordanceAllProducts() + products = [] + prev = -1 + if number > len(allProducts): + return allProducts + while number > 0: + max = -1 + if prev == -1: + max = 0 + for j in range(len(allProducts)): + if prev == -1: + if C[max]C[j]: + max = j + elif C[max] < C[j] and C[j] < C[prev]: + max = j + prev = max + for j in range(len(allProducts)): + if C[max] == C[j]: + products.append(allProducts[j]) + print(C[j]) + number -= 1 + if number == 0: + break + print(C) + return products \ No newline at end of file diff --git a/product.py b/product.py new file mode 100644 index 0000000..e2acbe5 --- /dev/null +++ b/product.py @@ -0,0 +1,7 @@ +class Product: + + def __init__(self, color, shape, mass, size): + self.color = color + self.shape = shape + self.mass = mass + self.size = size \ No newline at end of file diff --git a/supply.py b/supply.py new file mode 100644 index 0000000..673b31a --- /dev/null +++ b/supply.py @@ -0,0 +1,64 @@ +from product import Product + + +def create_data_products(): + allProducts = [] + + product = Product('black', 'rectangle', 51, 'small') + allProducts.append(product) + product = Product('black', 'rectangle', 51, 'small') + allProducts.append(product) + product = Product('gold', 'pack', 100, 'big') + allProducts.append(product) + product = Product('purple', 'rectangle', 100, 'big') + allProducts.append(product) + product = Product('brown', 'pack', 45, 'small') + allProducts.append(product) + product = Product('blue', 'rectangle', 50, 'medium') + allProducts.append(product) + product = Product('blue', 'square', 40, 'small') + allProducts.append(product) + product = Product('blue', 'rectangle', 35, 'small') + allProducts.append(product) + product = Product('gold', 'rectangle', 40, 'medium') + allProducts.append(product) + product = Product('gold', 'rectangle', 50, 'medium') + allProducts.append(product) + product = Product('brown', 'rectangle', 55, 'medium') + allProducts.append(product) + product = Product('brown', 'rectangle', 45, 'medium') + allProducts.append(product) + product = Product('white', 'rectangle', 40, 'medium') + allProducts.append(product) + product = Product('red', 'rectangle', 50, 'medium') + allProducts.append(product) + product = Product('blue', 'rectangle', 115, 'big') + allProducts.append(product) + product = Product('white', 'rectangle', 15, 'small') + allProducts.append(product) + product = Product('red', 'pack', 70, 'medium') + allProducts.append(product) + product = Product('orange', 'rectangle', 45, 'medium') + allProducts.append(product) + product = Product('blue', 'rectangle', 55, 'medium') + allProducts.append(product) + product = Product('gold', 'rectangle', 120, 'big') + allProducts.append(product) + product = Product('white', 'rectangle', 120, 'big') + allProducts.append(product) + product = Product('white', 'jar', 600, 'big') + allProducts.append(product) + product = Product('white', 'rectangle', 25, 'small') + allProducts.append(product) + product = Product('brown', 'jar', 500, 'big') + allProducts.append(product) + product = Product('brown', 'jar', 470, 'big') + allProducts.append(product) + product = Product('red', 'jar', 250, 'medium') + allProducts.append(product) + product = Product('black', 'jar', 250, 'medium') + allProducts.append(product) + product = Product('orange', 'jar', 250, 'medium') + allProducts.append(product) + + return allProducts \ No newline at end of file