From 65da2599bd751d0ab077dc933a97df7242dfb5d5 Mon Sep 17 00:00:00 2001 From: peet Date: Thu, 16 May 2024 18:07:20 +0200 Subject: [PATCH] meh --- bin/uebung05/logistics/Demo.class | Bin 0 -> 393 bytes bin/uebung05/logistics/Helicopter.class | Bin 0 -> 982 bytes bin/uebung05/logistics/NeedCollector.class | Bin 0 -> 1214 bytes bin/uebung05/logistics/Tank.class | Bin 0 -> 946 bytes bin/uebung05/logistics/Truck.class | Bin 0 -> 1380 bytes bin/uebung05/logistics/Vehicle.class | Bin 0 -> 566 bytes .../logistics/material/BulletBelts.class | Bin 0 -> 1182 bytes bin/uebung05/logistics/material/Grease.class | Bin 0 -> 1156 bytes .../logistics/material/LiterDiesel.class | Bin 0 -> 1179 bytes .../material/MetGallonsKerosene.class | Bin 0 -> 1214 bytes bin/uebung05/logistics/material/Oil.class | Bin 0 -> 1141 bytes .../logistics/material/RocketPods.class | Bin 0 -> 1177 bytes .../logistics/material/ShellBatches.class | Bin 0 -> 1188 bytes .../logistics/quantities/FloatUnit.class | Bin 0 -> 129 bytes .../logistics/quantities/IntUnit.class | Bin 0 -> 125 bytes .../logistics/storage/FloatStorage.class | Bin 0 -> 2254 bytes .../logistics/storage/IntStorage.class | Bin 0 -> 2237 bytes src/uebung05/logistics/Demo.java | 9 ++ src/uebung05/logistics/Helicopter.java | 5 ++ src/uebung05/logistics/NeedCollector.java | 60 +++++++++++++ src/uebung05/logistics/Tank.java | 5 ++ src/uebung05/logistics/Truck.java | 17 ++++ src/uebung05/logistics/Vehicle.java | 16 ++++ .../logistics/material/BulletBelts.java | 24 ++++++ src/uebung05/logistics/material/Grease.java | 25 ++++++ .../logistics/material/LiterDiesel.java | 25 ++++++ .../material/MetGallonsKerosene.java | 25 ++++++ src/uebung05/logistics/material/Oil.java | 24 ++++++ .../logistics/material/RocketPods.java | 24 ++++++ .../logistics/material/ShellBatches.java | 25 ++++++ .../logistics/quantities/FloatUnit.java | 5 ++ .../logistics/quantities/IntUnit.java | 5 ++ .../logistics/storage/FloatStorage.java | 60 +++++++++++++ .../logistics/storage/IntStorage.java | 58 +++++++++++++ .../uebung05/logistics/ManagerTest.java | 67 +++++++++++++++ .../logistics/storage/IntStorageTest.java | 80 ++++++++++++++++++ 36 files changed, 559 insertions(+) create mode 100644 bin/uebung05/logistics/Demo.class create mode 100644 bin/uebung05/logistics/Helicopter.class create mode 100644 bin/uebung05/logistics/NeedCollector.class create mode 100644 bin/uebung05/logistics/Tank.class create mode 100644 bin/uebung05/logistics/Truck.class create mode 100644 bin/uebung05/logistics/Vehicle.class create mode 100644 bin/uebung05/logistics/material/BulletBelts.class create mode 100644 bin/uebung05/logistics/material/Grease.class create mode 100644 bin/uebung05/logistics/material/LiterDiesel.class create mode 100644 bin/uebung05/logistics/material/MetGallonsKerosene.class create mode 100644 bin/uebung05/logistics/material/Oil.class create mode 100644 bin/uebung05/logistics/material/RocketPods.class create mode 100644 bin/uebung05/logistics/material/ShellBatches.class create mode 100644 bin/uebung05/logistics/quantities/FloatUnit.class create mode 100644 bin/uebung05/logistics/quantities/IntUnit.class create mode 100644 bin/uebung05/logistics/storage/FloatStorage.class create mode 100644 bin/uebung05/logistics/storage/IntStorage.class create mode 100644 src/uebung05/logistics/Demo.java create mode 100644 src/uebung05/logistics/Helicopter.java create mode 100644 src/uebung05/logistics/NeedCollector.java create mode 100644 src/uebung05/logistics/Tank.java create mode 100644 src/uebung05/logistics/Truck.java create mode 100644 src/uebung05/logistics/Vehicle.java create mode 100644 src/uebung05/logistics/material/BulletBelts.java create mode 100644 src/uebung05/logistics/material/Grease.java create mode 100644 src/uebung05/logistics/material/LiterDiesel.java create mode 100644 src/uebung05/logistics/material/MetGallonsKerosene.java create mode 100644 src/uebung05/logistics/material/Oil.java create mode 100644 src/uebung05/logistics/material/RocketPods.java create mode 100644 src/uebung05/logistics/material/ShellBatches.java create mode 100644 src/uebung05/logistics/quantities/FloatUnit.java create mode 100644 src/uebung05/logistics/quantities/IntUnit.java create mode 100644 src/uebung05/logistics/storage/FloatStorage.java create mode 100644 src/uebung05/logistics/storage/IntStorage.java create mode 100644 test/uebung/uebung05/logistics/ManagerTest.java create mode 100644 test/uebung/uebung05/logistics/storage/IntStorageTest.java diff --git a/bin/uebung05/logistics/Demo.class b/bin/uebung05/logistics/Demo.class new file mode 100644 index 0000000000000000000000000000000000000000..934e55a26ef9a13c8cf18e2efdb2c97ecaccc9c9 GIT binary patch literal 393 zcmZ`#O-sW-5Pg%TjfvH2D~d;NRl)V*sUnEtDd?fni>FOo)-A~fl8yh%liNCw#Z9(U zxg!itjWzC!(3|cr2;oI_uM+eS57EbfFiMS8*KL`p`c`IzB8<~2m&HQX#>ZdD&^?%j zu$%s~e#WCqX)IxTdY697n7i6oJ?mD>TJwm>A7w%^ui83SSH>%d{Xs{52=>6r`FtQ? zj}wtw)9m8Y(pF#0l>u*x|6Y+$>_QH*trIOEBO{Cpq%CPqJq{F~V98pn(Q FCLfs~Oh^C# literal 0 HcmV?d00001 diff --git a/bin/uebung05/logistics/Helicopter.class b/bin/uebung05/logistics/Helicopter.class new file mode 100644 index 0000000000000000000000000000000000000000..53851ae1ea94a196773f01bde0f5b76c269c5388 GIT binary patch literal 982 zcmcgqO>Yx15PeR!O|mT{1jg?z&>OfErIQtrnQ+rdp^>3t}3sxYV?-0 z%53S$wGjzyH9#hmt4x!?+Dm1Wew)ka71oC+Rywhd(!o7} zk5?%7k~ta10_%=S>--_njEC?fX_`WKJg{0*=B;D-9c&AHxkAZ*X-xhR6MhgM+1h3F zMuiRQEr+=q8jnZd{p6(wB0lk6vTbuTVlUXQK0Qb0D<4{j*@kCu!aCcH3jq6TKtIBD z^!O$uKW0RWef%B$_k+PXZvEtlrLbL8VEmm+vVaeDFYtH&gWtma#`+JM@Qi%O6MJ1?iPC&ehMM+ zgv0|Mz(*lwH^FVJR4KB&>)DxeX6B6T-+zAo0`LZps|Xl2tms-5KYtk|I+mG{y(~Hu zqJN;1MD&bKt0*(fpYhK;O1O%n_uVr(XPA-7xIoconCp1IH8P3b@rx#Tk7TU4v8iBq zJL=u*j7j;)a%H5EB8%F}d{ELf2PmJDjzlcd<~}jkKPH;zng5f!<*-F|f9Sa@dy+Em zGnB%{2}Ain_eBjQ%*~>XS=Xmj;?SOVMS9G;3H7$v(LJ7=@Kic`cvv>4GGo{p*XW40 z)J}=_Nx+@3JuY~RDz2^yKi5{#3|O0rv{W*~lN;h0cEi?$*h`gMHr8Tj+!#Tlk3~M7 z?QjC{->@6h$|su}>dDsdXh`;o_JAr2N?+ZI%br5dwleVM wr3JnqC&e1piyZZD1&$Zja;y@TemA+iJ5C*U7ZqxHih;EBfeoeI^oh3q0=xVI-~a#s literal 0 HcmV?d00001 diff --git a/bin/uebung05/logistics/Tank.class b/bin/uebung05/logistics/Tank.class new file mode 100644 index 0000000000000000000000000000000000000000..b8c08ef631c8c768852a08a3cf764ab8c1f0b658 GIT binary patch literal 946 zcmcgqO>Yx15PeR!P2v_B0;RNk86>0)hb|W`6d_d=NJvpHO(Su1HYRKE+Kbm)i5q{3 zQzek#&W}Qj)u;t&x%M*S@w|ESJf2^_zx@Dk0MSKI_SL4CenWF zB4OBVNlsOvbE6p6UTUkuD~6SHG-XH*-CS|3pud4ttTAkkwN*z=Ia7WjXR%^9cDXcD z>2-{kmq{pe&9F0W=@o_SGw|Hmx+&FxG1Mo0JDPTJgBpC0r!q6rF0$9&JKw`ihUUb2 zRXcO4<|21xrHu^QSy6dMJspt_s>@a+~5}_A8 z(-CJ__o{L}94R%Ykv~b>W*(D=&KQ*k=Sg@E_ZhxiiP*o?rT@r?+WE0-e6HT;xJmu^ zb$fBlcm&!&T4*4l6Kx*ZE=3u6Mt=3_8G2vo&;chK)1ZQNvK!|B^4EYtg6r6%n^^pq y5FPUTI|lED!!z9aNfC)4yJR5z_C>RZkG$vjJO9D&;%+Pdy*4}{9}r^)5B~tz`t+gz literal 0 HcmV?d00001 diff --git a/bin/uebung05/logistics/Truck.class b/bin/uebung05/logistics/Truck.class new file mode 100644 index 0000000000000000000000000000000000000000..f70bde5fe67b821af776dec5a60455abcf7ddf5a GIT binary patch literal 1380 zcmcgsT~8B16g@*L+in*M6%g@*1wpn&Tl_$gq6r}yNe~`@8XmXXp&i(-?9Mjv(Vt`@ z0VUCQf0Xg=Qf!SizVWiVbLY&t=bn3ae*FCU4Zu2HDi~mxjCehAn@h_T+iQwY3M;Ja z1(9{EAk8q%!m>HT;F@rSe8n(sY#o_xvtpZWv$87#;Wn$q8bf-+Yj71QWHnra z%8)XOwJaDk4MP|vfNMHLRQUV2f)R$%gf)`FuDmtF);rTzkw-RWxUOLg;|y8Hlspio z9WvxEXc9bOt152brh-X^={{v#9<1yLTf-D?G31(DZn~i~U5ixB8Joqe{~V+ocQCEs z?xonof=yTQCJ!{|m|;-brXBH}Lxzc%vFlU^R?Xoa<`v8_40Q{p0yNym0-5GVl3}IS z&iKsHD zmgk0%!`E$_x<}>I6jUffx2V@a-~|~xVrcKX0S`U9%^SMqIliz>DLhyA1CNqAtGb%q zYjItE@VTDw>rNC(T{u4Na#!k-c7@xb_DZ5K>!A!xOX?1nEw7<>#<1K~WC&LlRTX7C ziRW#QrsGi9_P$SQGkC@jT#cgNNsS`Sd@kU=7szeS8|3c1(a+v^bHlT3YN{8|uam(l z!^f*p+au5TLq{xL-Swit;%`JeHEPnOa@=do&_9@>YXnHs7nw~@g;vKD9iaC@=@gmL z;t6u4bL02?^yFpYm6#bhs` zL literal 0 HcmV?d00001 diff --git a/bin/uebung05/logistics/Vehicle.class b/bin/uebung05/logistics/Vehicle.class new file mode 100644 index 0000000000000000000000000000000000000000..e42bb66a9c0fae397558161f4d59e6610a133cbe GIT binary patch literal 566 zcmZuuO-}+b5PgLO1n~>M(TfKY^x%5&1R*gdCdRJ=!o4ixT2i{$?fSnwnRxIA_@j)| zl|)Ur%yiy+oq3&pe!YJHILBTE1%YNp!_35|XQ57Fl{yur;eei0q^W{HV0A2CWT>Ty z!~5ZwA}0_SIU#|@%`eq+R++dhP@PCeR!N--to#Tvr*wELr=IPp*hrUIzJC3m?cB^U z@|;QIlv9+3SH|^?a_v7u8KRhMyUU%+9mQ-{px8PZu*HjHL^Tw#QpY0d-itDHmraIb zALLNy_LE5Jfn>8>&%nSvDR#a;&&+HqJZ#a@G_mfEXvE^f);zT*FA}YJV~K5hPt`}I zb$@!UwLmROOqxw7FM`&U=WD$rvk_e?@2)hVaGjmmXP%vBX8QBj*>?a>u$4lLVKoq~K(;sT+n#E>zIGko z?s6^qF8A#1!1ILO7M}J~NH9zu@ndd#T(<4!ts~*+6p{=pBPiYlTxwUl!nf;Ezm%?K zNW0S4TsnfG+!&EF>e(tol6O@gDWBEJdE^q;V}?YjUfw5DQwPFA9JwsUFv$=vmG?7X zn93ppiy_x=rFa%}TcW?mTOPeV)ld%i_Bkmee-KRQL)WJgwQB0VE87e+rE=q3ZWOIf zQRn8en8yOcY?pULO-YCASFS#!lToLMr9ib^%w-sB3tj)ygEfQt-!>RY*Rx0=ZP97T zh|MyLH#K)UySz70VKr6Icf^isbWRRUZ`~*{A*Hmh`@FX+^r1TNEv%xPLWyDdT&pXO zRY%y7pUfaFb~^*}9aXU-P){3tH+8 zTHg!GM`=l6lVS1SP+HGOIF@Kgar!PH2Fpy1_9kW)l5Ct#G(EZ#z94^wE5HZxVlbS^ z@Fo{>nHmg3#FfEST%(Ao>P1*RQ22z!ADH+C_Imyl#m`uzfFX;AWKn_BL^^{!6<`XC lNDBk8H$p7SQ^HL;#;}YPvT1tfHhpVYC(o?3jk~yqx!($F8qxp& literal 0 HcmV?d00001 diff --git a/bin/uebung05/logistics/material/Grease.class b/bin/uebung05/logistics/material/Grease.class new file mode 100644 index 0000000000000000000000000000000000000000..d8dbd3d0feb0f0230942c9088f001c31852d9d0c GIT binary patch literal 1156 zcma)5T~8B16g|^c+Af7spdz4H5TvcjqT*AHi8eu-6g4Sgj8D^LEJL?Db$6D8f8x*Z zGbEV!YT}PF-q~%WN@IN3&fGiaoVjQ2?T??Q-vB(sRvHP0l~A-pud{j2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nrzo)i literal 0 HcmV?d00001 diff --git a/bin/uebung05/logistics/material/Oil.class b/bin/uebung05/logistics/material/Oil.class new file mode 100644 index 0000000000000000000000000000000000000000..50a9057dc435fee0a6fd72abab3172b58256ed65 GIT binary patch literal 1141 zcmah|T~8B16g|_{ek`S>Kt({IXwkMRi;7P*CfbD9q=-ooV|Lsohx;{)s=s z&yZl^tBF6#cxShf8XA4r-nnDn8OX1s1Prvk}W=KoV*W7ai z!&++sXZ*N2Lz4GZ;1Q2CDS0GG<1s^`(yZ=NXs82WA&z_&QsL}A(#p8fq*A2bE^-;BxVx5r>9D3Uk~|UN9aR!;9IzbY6=yG^0_zZ9jl(OBa4xt zZSH6_JTXpd4DTyrZbs-x@EP|GT;Z2nO7((4eGE3bu(8Tt#J!V&m;iq>hL0wzK7NxU zi3WGww$!4YPvT}8cNuc56wqAwCH1zXq|10Q;QaGjmmXP%vBX8QBj*>?bsv6VuMVXZG(eXqTF-*#1723k6S z-Q`;NlDqZ`<#dGJRR=)|35Llde#~u`du{u9>qs~{g(So32!?lk?rEu|2<*D2UwTqA zq@@>V?m2>?)EJR7;?*icl6O_#qjXj$=bbF9o`#=u$rpxJ7QZJnYr`PZ5SOiyeCTOK>NJ6BlIDS)WS`aQz$X4oGX>y zvFZpr5**3f=8jhWiP2qQcwZXQHb6&&Pq}yCieROoRHxso4#5WP8;bmuxOdVMBj9g_ z@X@+ehxcZ;KB$yWOH6E-?)zTlYNS*IXV1f);v{ zR`-JNQBqR4%dqrsDD7sX8_P7JIDMB8gJot$OA|BONH$I@@vO5Ehh`pu7y_%#b%5p-~7qDKBKDe+J#m4LG;RGQwJwFUX(aGVp=C7z}4J zyvc=JrUt_hab<7?S1Dqu+6}7*3ZJm_0~6oCUN4-Y_!&zSFl6zNEGlrCNN13z0!)Ds lX<;DtdWdCtO1MGC7*?=KHcjuW({~FSJ>{~Klq8BG8H literal 0 HcmV?d00001 diff --git a/bin/uebung05/logistics/material/ShellBatches.class b/bin/uebung05/logistics/material/ShellBatches.class new file mode 100644 index 0000000000000000000000000000000000000000..c659f0a41212ab7caf937777ae377263d92ac736 GIT binary patch literal 1188 zcma)5ZBG+H5Pr6;eK`uHKt({YC}>-S1H?}?Ceno1q^L;|WBjx|*7oRixAyi(_$U4h zUqgb4Urqc`#@V|@YG{lfuCp`y%(L^%On?45{|?{@c2bBjlmgKTWP9_W?WwlwYuEAZ z9@k>va?fsdgy-#Y?R12nLV{uXn4fUlcw&foX<#seG6L z!%P+#SPZ#_E5);**AjyR-ty@2nTB$>cgRU2`NLpBcU+%p)T*fmu52^RmCB6^y-~C} zL%mzbVi8LW^F7`bH6S%9=6gBR7O;?L*E{Qv7tTQaIVk=tRqIz50+TQH-ioRKBnoqVar5Mya?)zr5 zH))42X&8oAe?w_SBk5S7ImPL_f*33_INF_c9Oh3@?vDI${D6A zOJ9-y7-DDXcZ#r}tOVs{C})nms}UN7kdyL4R{Dd`&HRvahb$wkRr!MaIj#X8$cw>n zCc~Rt$Yp9U3=vlb*Kva)rm7cV^+4ehmVaRC8`$f`GZa5#nF59^9+E``&JyVy@>GB+ nFd{7s#oh|BEKdoy=@`Q**2t#moqP1%#|C+3t8HxI0TzA(HEbOS literal 0 HcmV?d00001 diff --git a/bin/uebung05/logistics/quantities/FloatUnit.class b/bin/uebung05/logistics/quantities/FloatUnit.class new file mode 100644 index 0000000000000000000000000000000000000000..5847b2591cbaac25846843bd1876f3a8a8bd4ceb GIT binary patch literal 129 zcmX^0Z`VEs1_nn4c6J6PMh5lL)TGk9bOTfUoc#36;*!kdV*SF>#JrNslFZa%eYc$a z#FEgw%o2767Dfhvti-ZJ{hY+SbbbG%tkmQZMh33n{L-T2RJY8WR7M6qxN<#^N;XCY SMh0e}Wgx)FzzQUp7}x+P;39tj literal 0 HcmV?d00001 diff --git a/bin/uebung05/logistics/quantities/IntUnit.class b/bin/uebung05/logistics/quantities/IntUnit.class new file mode 100644 index 0000000000000000000000000000000000000000..e32e6f310eb3bfa69dfd145ea560d1dfd2bed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yr#DC{z~@xw?Fa z;_uu~V1i?jh~P7oqGy)AdHyb76c@Q$4gGNmlUxxgh${k1MNR~kimjMU;c^tY##x;j zs{Vn(uQb9?>0q-EKx^TF2%0+J3U?IkLFcjGPB<51olCKiizg#rigmt<=_vA}APrz# z(dJj=H})DcZ%_eFGPyDUHhz@Gb=-)+o)Iib_5s-BYt$Z8zbEWehjp0hGs_2uW-0wV zWiJPyrO@$6_HisxVqRgE=wn(5+IMg_3iOhvRUu{+>&fSe_s_^z)yz=8U?hk;`J4+? z_2fX+7g_J?7$@fm%07)-LHJ?_cNBgm3V)B@DI_LTmwkfsQTRIn9roV4i2c?I8{{?_ zFAa#5Jrb*q`w_^~D2Kv=qOB6?a2Wd&4^E=pW#D@QGz&*G3uxeT;wA9~i6*d&FF7mS SR{5>rYp!y%zCjC{xcD!S!{R9b literal 0 HcmV?d00001 diff --git a/src/uebung05/logistics/Demo.java b/src/uebung05/logistics/Demo.java new file mode 100644 index 0000000..beded21 --- /dev/null +++ b/src/uebung05/logistics/Demo.java @@ -0,0 +1,9 @@ +package uebung05.logistics; + +public class Demo { + + public static void main(String[] args) { + + } + +} diff --git a/src/uebung05/logistics/Helicopter.java b/src/uebung05/logistics/Helicopter.java new file mode 100644 index 0000000..b8b56bf --- /dev/null +++ b/src/uebung05/logistics/Helicopter.java @@ -0,0 +1,5 @@ +package uebung05.logistics; + +public class Helicopter extends Vehicle{ + +} diff --git a/src/uebung05/logistics/NeedCollector.java b/src/uebung05/logistics/NeedCollector.java new file mode 100644 index 0000000..7294621 --- /dev/null +++ b/src/uebung05/logistics/NeedCollector.java @@ -0,0 +1,60 @@ +package uebung05.logistics; + +import java.util.Map; + +import uebung05.logistics.quantities.FloatUnit; +import uebung05.logistics.quantities.IntUnit; + +public class NeedCollector { + private Map intNeeded; + private Map floatNeeded; + + + /** + * add specific amount of operating material + * + * @param amount amount to be added + * @param unit type of operating material to be added + */ + public void add(int amount, IntUnit unit) { + + } + + /** + * add specific amount of operating material + * + * @param amount amount to be added + * @param unit type of operating material to be added + */ + public void add(float amount, FloatUnit unit) { + + } + + /** + * get the need of a specific operating material + * + * @param unit the type of operating material + * @return all the needs of the specific material + */ + public int getNeeded(IntUnit unit) { + return 0; + } + + /** + * get the need of a specific operating material + * + * @param unit the type of operating material + * @return all the needs of the specific material + */ + public float getNeeded(FloatUnit unit) { + return 0; + } + + /** + * Prints the total requirements in the therminal + * + */ + public void show(){ + + } +} \ No newline at end of file diff --git a/src/uebung05/logistics/Tank.java b/src/uebung05/logistics/Tank.java new file mode 100644 index 0000000..c6a2d79 --- /dev/null +++ b/src/uebung05/logistics/Tank.java @@ -0,0 +1,5 @@ +package uebung05.logistics; + +public class Tank extends Vehicle{ + +} diff --git a/src/uebung05/logistics/Truck.java b/src/uebung05/logistics/Truck.java new file mode 100644 index 0000000..eaf8d62 --- /dev/null +++ b/src/uebung05/logistics/Truck.java @@ -0,0 +1,17 @@ +package uebung05.logistics; + +import java.util.HashMap; +import java.util.Map; + +import uebung05.logistics.material.Oil; +import uebung05.logistics.quantities.IntUnit; + +public class Truck extends Vehicle { + + public Truck(String name){ + this.name = name; + materials = new HashMap<>(); + materials.put(Oil.getInstance(0), 5); + } + +} diff --git a/src/uebung05/logistics/Vehicle.java b/src/uebung05/logistics/Vehicle.java new file mode 100644 index 0000000..c285514 --- /dev/null +++ b/src/uebung05/logistics/Vehicle.java @@ -0,0 +1,16 @@ +package uebung05.logistics; + +import java.util.Map; + +import uebung05.logistics.quantities.IntUnit; + +public abstract class Vehicle{ + protected String name; + protected Map materials; + + protected abstract void reportNeeds(NeedCollector collector); + + protected abstract void fillUpAll(); + + protected abstract void consumeAll(int intensityRate); +} diff --git a/src/uebung05/logistics/material/BulletBelts.java b/src/uebung05/logistics/material/BulletBelts.java new file mode 100644 index 0000000..d44dc5c --- /dev/null +++ b/src/uebung05/logistics/material/BulletBelts.java @@ -0,0 +1,24 @@ +package uebung05.logistics.material; + +import uebung05.logistics.quantities.IntUnit; + +public class BulletBelts implements IntUnit{ + private static BulletBelts instance; + private int amount; + + private BulletBelts(int amount){ + this.amount = amount; + } + + @Override + public String toString() { + return amount + " belts of 7.62 bullets"; + } + + public static BulletBelts getInstance(int amount){ + if (instance == null){ + instance = new BulletBelts(amount); + } + return instance; + } +} diff --git a/src/uebung05/logistics/material/Grease.java b/src/uebung05/logistics/material/Grease.java new file mode 100644 index 0000000..4584cf2 --- /dev/null +++ b/src/uebung05/logistics/material/Grease.java @@ -0,0 +1,25 @@ +package uebung05.logistics.material; + +import uebung05.logistics.quantities.IntUnit; + +public class Grease implements IntUnit{ + private static Grease instance; + private int amount; + + private Grease(int amount){ + this.amount = amount; + } + + @Override + public String toString() { + return amount + " units of grease"; + } + + public static Grease getInstance(int amount){ + if (instance == null){ + instance = new Grease(amount); + } + return instance; + } + +} diff --git a/src/uebung05/logistics/material/LiterDiesel.java b/src/uebung05/logistics/material/LiterDiesel.java new file mode 100644 index 0000000..63184af --- /dev/null +++ b/src/uebung05/logistics/material/LiterDiesel.java @@ -0,0 +1,25 @@ +package uebung05.logistics.material; + +import uebung05.logistics.quantities.FloatUnit; + +public class LiterDiesel implements FloatUnit{ + private static LiterDiesel instance; + private float amount; + + private LiterDiesel(float amount){ + this.amount = amount; + } + + @Override + public String toString() { + return amount + " liters of diesel"; + } + + public static LiterDiesel getInstance(float amount){ + if (instance == null){ + instance = new LiterDiesel(amount); + } + return instance; + } + +} diff --git a/src/uebung05/logistics/material/MetGallonsKerosene.java b/src/uebung05/logistics/material/MetGallonsKerosene.java new file mode 100644 index 0000000..a9c2d3a --- /dev/null +++ b/src/uebung05/logistics/material/MetGallonsKerosene.java @@ -0,0 +1,25 @@ +package uebung05.logistics.material; + +import uebung05.logistics.quantities.FloatUnit; + +public class MetGallonsKerosene implements FloatUnit{ + private static MetGallonsKerosene instance; + private float amount; + + private MetGallonsKerosene(float amount){ + this.amount = amount; + } + + @Override + public String toString() { + return amount + " met gallons of kerosene"; + } + + public static MetGallonsKerosene getInstance(float amount){ + if (instance == null){ + instance = new MetGallonsKerosene(amount); + } + return instance; + } + +} diff --git a/src/uebung05/logistics/material/Oil.java b/src/uebung05/logistics/material/Oil.java new file mode 100644 index 0000000..acb4cd4 --- /dev/null +++ b/src/uebung05/logistics/material/Oil.java @@ -0,0 +1,24 @@ +package uebung05.logistics.material; + +import uebung05.logistics.quantities.IntUnit; + +public class Oil implements IntUnit{ + private static Oil instance; + private int amount; + + private Oil(int amount){ + this.amount = amount; + } + + @Override + public String toString() { + return amount + " units of oil"; + } + + public static Oil getInstance(int amount){ + if (instance == null){ + instance = new Oil(amount); + } + return instance; + } +} diff --git a/src/uebung05/logistics/material/RocketPods.java b/src/uebung05/logistics/material/RocketPods.java new file mode 100644 index 0000000..229f1db --- /dev/null +++ b/src/uebung05/logistics/material/RocketPods.java @@ -0,0 +1,24 @@ +package uebung05.logistics.material; + +import uebung05.logistics.quantities.IntUnit; + +public class RocketPods implements IntUnit{ + private static RocketPods instance; + private int amount; + + private RocketPods(int amount){ + this.amount = amount; + } + + @Override + public String toString() { + return amount + " pods of 70mm rockets"; + } + + public static RocketPods getInstance(int amount){ + if (instance == null){ + instance = new RocketPods(amount); + } + return instance; + } +} diff --git a/src/uebung05/logistics/material/ShellBatches.java b/src/uebung05/logistics/material/ShellBatches.java new file mode 100644 index 0000000..d411659 --- /dev/null +++ b/src/uebung05/logistics/material/ShellBatches.java @@ -0,0 +1,25 @@ +package uebung05.logistics.material; + +import uebung05.logistics.quantities.IntUnit; + +public class ShellBatches implements IntUnit{ + private static ShellBatches instance; + private int amount; + + private ShellBatches(int amount){ + this.amount = amount; + } + + @Override + public String toString() { + return amount + " batches of 120mm shells"; + } + + public static ShellBatches getInstance(int amount){ + if (instance == null){ + instance = new ShellBatches(amount); + } + return instance; + } + +} diff --git a/src/uebung05/logistics/quantities/FloatUnit.java b/src/uebung05/logistics/quantities/FloatUnit.java new file mode 100644 index 0000000..d9321a7 --- /dev/null +++ b/src/uebung05/logistics/quantities/FloatUnit.java @@ -0,0 +1,5 @@ +package uebung05.logistics.quantities; + +public interface FloatUnit { + +} diff --git a/src/uebung05/logistics/quantities/IntUnit.java b/src/uebung05/logistics/quantities/IntUnit.java new file mode 100644 index 0000000..b04d6e8 --- /dev/null +++ b/src/uebung05/logistics/quantities/IntUnit.java @@ -0,0 +1,5 @@ +package uebung05.logistics.quantities; + +public interface IntUnit { + +} diff --git a/src/uebung05/logistics/storage/FloatStorage.java b/src/uebung05/logistics/storage/FloatStorage.java new file mode 100644 index 0000000..dce9b10 --- /dev/null +++ b/src/uebung05/logistics/storage/FloatStorage.java @@ -0,0 +1,60 @@ +package uebung05.logistics.storage; + +import uebung05.logistics.NeedCollector; +import uebung05.logistics.quantities.FloatUnit; + +public class FloatStorage implements FloatUnit{ + + private float stored; + private final FloatUnit unit; + private final float max; + + public FloatStorage(float stored, FloatUnit unit, float max){ + this.stored = stored; + this.unit = unit; + this.max = max; + } + + public float getStored(){ + return stored; + } + + public FloatUnit getUnit(){ + return unit; + } + + public float getMax(){ + return max; + } + + @Override + public String toString() { + return "storage with "+ stored + " of " + max + " units of " + unit; + } + + public float consume(float amount){ + + float actualConsumed = Math.min(stored, amount); + + stored = stored - actualConsumed; + + return actualConsumed; + } + + public void fill(float amount){ + if (stored+amount > max) { + stored = max; + } else { + stored = stored + amount; + } + } + + public void fillUp(){ + stored = max; + } + + public void reportNeed(NeedCollector collector){ + collector.add(max-stored, unit); + } + +} diff --git a/src/uebung05/logistics/storage/IntStorage.java b/src/uebung05/logistics/storage/IntStorage.java new file mode 100644 index 0000000..44e00c1 --- /dev/null +++ b/src/uebung05/logistics/storage/IntStorage.java @@ -0,0 +1,58 @@ +package uebung05.logistics.storage; + +import uebung05.logistics.NeedCollector; +import uebung05.logistics.quantities.IntUnit; + +public class IntStorage implements IntUnit { + private int stored; + private final IntUnit unit; + private final int max; + + public IntStorage(int stored, IntUnit unit, int max){ + this.stored = stored; + this.unit = unit; + this.max = max; + } + + public int getStored(){ + return stored; + } + + public IntUnit getUnit(){ + return unit; + } + + public int getMax(){ + return max; + } + + @Override + public String toString() { + return "storage with "+ stored + " of " + max + " units of " + unit; + } + + public int consume(int amount){ + + int actualConsumed = Math.min(stored, amount); + + stored = stored - actualConsumed; + + return actualConsumed; + } + + public void fill(int amount){ + if (stored+amount > max) { + stored = max; + } else { + stored = stored + amount; + } + } + + public void fillUp(){ + stored = max; + } + + public void reportNeed(NeedCollector collector){ + collector.add(max-stored, unit); + } +} diff --git a/test/uebung/uebung05/logistics/ManagerTest.java b/test/uebung/uebung05/logistics/ManagerTest.java new file mode 100644 index 0000000..0eb3a56 --- /dev/null +++ b/test/uebung/uebung05/logistics/ManagerTest.java @@ -0,0 +1,67 @@ +package logistics; + +import logistics.material.BulletBelts; +import logistics.material.Grease; +import logistics.material.LiterDiesel; +import logistics.material.MetGallonsKerosene; +import logistics.material.Oil; +import logistics.material.RocketPods; +import logistics.material.ShellBatches; +import logistics.quantities.NeedCollector; +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ManagerTest { + private static final float EPS = 1e-5f; + private Manager manager; + + @Before + public void setup() { + manager = new Manager(); + manager.addVehicle(new Tank("Leo1")); + manager.addVehicle(new Tank("Leo2")); + manager.addVehicle(new Helicopter("Tiger1")); + manager.addVehicle(new Helicopter("Tiger2")); + } + + @Test + public void testInitialNeed() { + final NeedCollector collector = manager.collectNeeds(); + assertEquals(4, collector.getNeed(RocketPods.INSTANCE)); + assertEquals(12, collector.getNeed(Oil.INSTANCE)); + assertEquals(24, collector.getNeed(BulletBelts.INSTANCE)); + assertEquals(20, collector.getNeed(ShellBatches.INSTANCE)); + assertEquals(12, collector.getNeed(Grease.INSTANCE)); + assertEquals(1000f, collector.getNeed(MetGallonsKerosene.INSTANCE), EPS); + assertEquals(2400f, collector.getNeed(LiterDiesel.INSTANCE), EPS); + } + + @Test + public void testNeedAfterFillUp() { + manager.fillUpVehicles(); + final NeedCollector collector = manager.collectNeeds(); + assertEquals(0, collector.getNeed(RocketPods.INSTANCE)); + assertEquals(0, collector.getNeed(Oil.INSTANCE)); + assertEquals(0, collector.getNeed(BulletBelts.INSTANCE)); + assertEquals(0, collector.getNeed(ShellBatches.INSTANCE)); + assertEquals(0, collector.getNeed(Grease.INSTANCE)); + assertEquals(0f, collector.getNeed(MetGallonsKerosene.INSTANCE), EPS); + assertEquals(0f, collector.getNeed(LiterDiesel.INSTANCE), EPS); + } + + @Test + public void testNeedAfterLogTick() { + manager.fillUpVehicles(); + manager.logTick(1); + final NeedCollector collector = manager.collectNeeds(); + assertEquals(2, collector.getNeed(RocketPods.INSTANCE)); + assertEquals(4, collector.getNeed(Oil.INSTANCE)); + assertEquals(6, collector.getNeed(BulletBelts.INSTANCE)); + assertEquals(4, collector.getNeed(ShellBatches.INSTANCE)); + assertEquals(4, collector.getNeed(Grease.INSTANCE)); + assertEquals(100f, collector.getNeed(MetGallonsKerosene.INSTANCE), EPS); + assertEquals(360f, collector.getNeed(LiterDiesel.INSTANCE), EPS); + } +} diff --git a/test/uebung/uebung05/logistics/storage/IntStorageTest.java b/test/uebung/uebung05/logistics/storage/IntStorageTest.java new file mode 100644 index 0000000..bc086ac --- /dev/null +++ b/test/uebung/uebung05/logistics/storage/IntStorageTest.java @@ -0,0 +1,80 @@ +package logistics.storage; + +import logistics.material.Oil; +import org.junit.Before; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class IntStorageTest { + private static final int MAX = 3; + + private IntStorage intStorage; + + @Before + public void setup() { + intStorage = new IntStorage(0, Oil.INSTANCE, MAX); + } + + @Test + public void testEmptyStorage() { + assertEquals(0, intStorage.getStored()); + } + + @Test + public void testGetStorage() { + intStorage.fill(1); + assertEquals(1, intStorage.getStored()); + } + + @Test + public void testGetMax() { + assertEquals(MAX, intStorage.getMax()); + } + + @Test + public void testFillUp() { + intStorage.fillUp(); + assertEquals(MAX, intStorage.getStored()); + } + + @Test + public void testUpperBound() { + intStorage.fill(MAX + 1); + assertEquals(MAX, intStorage.getStored()); + } + + @Test + public void testConsume() { + intStorage.fillUp(); + assertEquals(MAX, intStorage.getStored()); + assertEquals(MAX, intStorage.consume(MAX)); + } + + @Test + public void testLowerBound() { + intStorage.consume(1); + assertEquals(0, intStorage.getStored()); + } + + @Test(expected = IllegalArgumentException.class) + public void testIllegalFill() { + intStorage.fill(-1); + } + + @Test(expected = IllegalArgumentException.class) + public void testIllegalConsume() { + intStorage.consume(-1); + } + + @Test(expected = IllegalArgumentException.class) + public void testIllegalLowerBoundConstructor() { + new IntStorage(-1, Oil.INSTANCE, MAX); + } + + @Test + public void testUpperBoundConstructor() { + final IntStorage storage = new IntStorage(MAX + 1, Oil.INSTANCE, MAX); + assertEquals(MAX, storage.getStored()); + } +}