From e07514241fd5a5f3392f2de8b564b2439c7cadc9 Mon Sep 17 00:00:00 2001 From: de1008 Date: Sun, 19 May 2024 18:46:13 +0200 Subject: [PATCH] Paar Kommentare, sowie Name u. Mrt. Nummer der Gruppe --- .../7.1/executionHistory/executionHistory.bin | Bin 80265 -> 88271 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/7.1/fileHashes/fileHashes.bin | Bin 21847 -> 24247 bytes .gradle/7.1/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .gradle/buildOutputCleanup/outputFiles.bin | Bin 19343 -> 19667 bytes .idea/misc.xml | 2 +- .idea/runConfigurations.xml | 10 ---------- .../java/main/com/example/AddressBook.class | Bin 6807 -> 6818 bytes .../compileJava/previous-compilation-data.bin | Bin 20858 -> 20858 bytes src/main/java/com/example/AddressBook.java | 2 +- src/main/java/com/example/AkkaStart.java | 4 ++++ src/main/java/com/example/DeliveryCar.java | 10 ++++++++++ 13 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 .idea/runConfigurations.xml diff --git a/.gradle/7.1/executionHistory/executionHistory.bin b/.gradle/7.1/executionHistory/executionHistory.bin index b64d7e389e0c08b93333531a8000fa2a22c45451..d9218ff039a1a71843e36dc96142ca1f45fdead4 100644 GIT binary patch delta 2279 zcmb_deM}Q)81GAa6DG{UKxzRQ3I`p6z3cUQogdR}#E%S9{#bMZLa%oPDimx1hnirs zAfiz^U-ca_2p@CdpC#6A5k-eAahVbYzXsw|h%w8yWE(?mT8-}RG^>BiN z^E|)zd7ixYzAZDV5g+D_kBL%9pS4G!P^NsAwmwFo0Le;)B4wArdwiaQiEy6gZS9B7 zr_aBL(z}1RHLEZw4VYW}#TpHzQ|g3#T{~$oab!aS>vGyE4CR$Im9>0BnW>g{Zh5wi zA|B3Xm-u7Y4ZwQx{dbBiuIe(EwW_Luchxz|cxO@mI*YhU1c!s)Tw6jExm~uRDr<$a z$i=&>>s&V84I<6~Il1tJZAFHxU0?!7XAH>Ftl*4k6F2*sgT%SllnQlvN#~GbtX10> zat6A8uq#zSm;>#-%@D4tv4tXsmp|A6j!^8G?}&;8?05^Z1t{6cX^p}OZjG# zyS(Q4e83^-*`DX$xqXdN{cD6!&_{0GyoSk7PMz1%MdcDmgl*{m( z(MA{vhGYoZz_K=054*q6!kv!!&*~EzOh3@k2$Md4fq>rOrm!2T+v>y3EQJ==8mK-J z4&VEKO$~W703P0HFI?9Y`;v}dd30KM_N8L4IzBo)n*$x~VFUg3I`}kf!kW(7a5v)I z_?;t^N`HsF_J#lq>rWO%QC4(eS5vT@l>CBuy;<4{r#$i>Iy?{od+Jk*f`jQAB< zIcPcuY{JK6$1a4Hu{?ZOR=m{r=vXvLSqyY}-^jVkUbtHw)_SY@tEKw$6@#rArxqtn zvBBaVv@#APW_%|{3Jw)#!LD%%n>c^0IS7Xz7_ploLa}cGJvJ_pU8gk~&)tccB|BQu zLIvISsp5pVJEDi^F+xvoDr|YE#`atg^C#<*P$U7=v-XK5(GN!-rei}lgj*MuoLK;q z0%|NMY3c(M7Lw4&nGCo;pjO=%EHq7kTx>?<(NsJzr~)EcNCI5-L_|%bzy-(qn$c+z zELJ@d(VrwRVlx5?q8$lB&C?R}B>_8-p4N4S2uSR@)UD@B2D>Ve)fzxxS0pm$HiL~zh&Z|oyCI>eM>_15gt`UpcL^0drm>bOA=U)PsohlW=aKH_Y<4) b^EHXrjy619*jm>krhFmH~PkTB5{RR(HPo}F)!R#lm9VwRDXR#B0ZYL;kHnQWSym}*uCF`cPqa$~jY O=7#EAzRdyAmiGW-4k`2i diff --git a/.gradle/7.1/executionHistory/executionHistory.lock b/.gradle/7.1/executionHistory/executionHistory.lock index 89333587bf041b693cb9edaf6055e8a44efc137d..c98cdd428d7f30f00e031982775b0ae9ab17097b 100644 GIT binary patch literal 17 VcmZQJ-Ffa%$-@Ly1~6a}001||1a1HT literal 17 VcmZQJ-Ffa%$-@Ly1~6b^2LLy`1Z4mK diff --git a/.gradle/7.1/fileHashes/fileHashes.bin b/.gradle/7.1/fileHashes/fileHashes.bin index 7bba79aaaf14400356ada7976f5fa11052f6f4a0..e472d9ed966628069659b93bbbe6a35947e8d01b 100644 GIT binary patch delta 1775 zcmZ9KdrVVz6vtc3!w6l=yId%=7HkXXjiq0{> z6DJwd1sKU-VZekDVAvUP3^NBCAg>vGK-2;nf{uX*ySKl4|JhA$&iQ?Q-{1F~d+u+n ziP_o9Y~9IYo`hYzbZ+&Hp~kLP)2$54qsxMFo>5Y_XB+08URsNwL9;T1UOrHjP_tuo3drbpr!@m6p>IP^7Q)yK}PtZ^zWh|z7-$b|m zquI4bh^OS!{GRJSVV^x&YC=3Y2JX7!oKH8>ql8~yLo6{F*jNrHATY<~2-6xd!(}*% zsko06S44(y-se!T7do(W+?U3B+xDp^{s?MLfXqW6S>-J662%+Ul;r|leogQ$?-nnJ z8cvcoM0td8OoL8~cwZ{g>fb;fVZh2aHmNF_XAn$wrwv$j=f>K1iyJ9^2Fg7I`>YqM z_uFq>5+Rs`(_)+A2a#ZGa6?@8mgaWsupnN6CKPdf6*PDVxa{0+!5!gu-3X>MLa&EP z;?|zkUe>XG0>RXH+5syRac7-Re~Gx^6dp{%SfE` z46-~`l3@3lq0Yub)PObhv^Y4oFXM1#pN?3%VxSD zgX&p-hvo;njIH%ISCq&^w}a+~OnUEX`(LTHbxfMe%dJlJE!15^`V=Rc$D~vm-~JR1 zBc6T|JUwpj!`rzDNTao-HSuSLe{2aKOGiAh2i_20rxBf1E#oz!L5jMA>z z8Tj_F&+yVwKLFkzw z{{yAs`M(j=U85b&7Dw>oH%rqH*UM;5M+RfdM4Rwmx3&-Vv2X7G(3KsqgOK_WuaJDX zj{ar$at?%?{-s9PHkEFYGZ@T@%6X9!^0Rk@n&@p-l`oEK;cj$*J&{n?X_FhY#94N9 zFcBBXdU0G2c1je(lo&Y3oylVc@RJ9iL?_1}SxM33gmm6#5^4#lZGsDtPl0y=20cob zuz8kw$LQgyfA>;^r zLjfm7;G`z=J>aj#U@*bOZr(Q-ongL)9cuDSBp8Ujeg!d0v-AN>D=;v`IolHp>XO^u zhZQ;TbIj6V5XBI`%`E*3c`(KRS2)3{!in4+2ZuPz?gUj~77Q_#a}S{`#xl1#=t9Xe zm_x}+;KyQ+ueMab02OMC$ISm?d#Xaga~o+W+z?d|GaxUKZw)A8Ek8dMN@4@Jm1fx_ Ks>6yRV!(f3?Xc4T delta 145 zcmdnKm+|^4#tkMCjLwryB@!mD1!7xC!^v%u%P03rc}{*Ol`uI?+I{j->59prG7^*L z${0?5CL=ysS5{(jFA(pQ^_XlbmoWLLoX2Ead5Otqs)FQXHbwEt tzKRl)YZVhFe^vCD+^Qrod8?8H&wnUjU|@^fsQ5#Cqrm~e&5j;oya2TgII{o% diff --git a/.gradle/7.1/fileHashes/fileHashes.lock b/.gradle/7.1/fileHashes/fileHashes.lock index 341b18bb5a211e6d6f02d3db39ef07811e85ca36..d8c858007a1727b75aa7fd64ed256a8f45b17e46 100644 GIT binary patch literal 17 VcmZR6t*}YBa<=Ot1~A|=0{}3R1QP%N literal 17 VcmZR6t*}YBa<=Ot1~A}#3ji@k1jzsZ diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 9a1a8499a6277fa89f99899c599f32502f0e144f..93a297b6c4c6df713d71de5c92dfcf110b15d6f9 100644 GIT binary patch literal 17 VcmZR6_T&GuLYbG|3}C?G2mnSB1&sgz literal 17 VcmZR6_T&GuLYbG|3}C>b3IIj+1#tiX diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin index a1e82dea0735b659fed512e8d61884e246590de4..1aa694615d74724d1b3c098578fb9731a9443e81 100644 GIT binary patch delta 444 zcmeC5&Ukqy;|3E6NypClB1W%+XNxj`fzQGJP%zn4VuHqei-YS$F69?PB)yNqBv)r~ z{V|ocv4D#APu?q`Ah7QG)AEfR=U+ojT0i-!goVJKuD4EotnurhDql`!m2A+s_)_;k z_SK9ssNh1Fu~#0rzZ2WDp&e>M`s7+kMgG^{)}^j3j)tn;Jb9|*28WmTk~YtltxAC^ zl!qDcdWOkz?UP%>q2k>z@gMu9KE3NYZ93GD>yvGzG6c9*_f3i^csUEIc<$u6QX3-7 z&6KV`GGsjl6%2)$V4YF_al+1kUZ}V;T>Og6q(djlPea9dVd8Fe7v{cn_-qFe_x?TE zRr-WLrkTo{DF5kfP{oFmS!EOi@;kYgN delta 71 zcmV-N0J#6tnE{WN0kAX}0WXtH7?6_<85om288DND8F-T|8X1#b8mE&@8(@>g8>o}b d9Ke&M9T=0<9fAS`d9fk*7qKv)6SF}`P6L)o8Yln& diff --git a/.idea/misc.xml b/.idea/misc.xml index 84c523c..8fcbe9d 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 797acea..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/build/classes/java/main/com/example/AddressBook.class b/build/classes/java/main/com/example/AddressBook.class index ef0e26af860dc5c1addbc2d7e34b0b06490c040a..1fbe22c3919011b5ddc370490ba8991fe0d954a9 100644 GIT binary patch delta 48 zcmbPky2y0HZ&qdP>RN@2#1e(P#N-Tx)XcopA_d2kl%mw);#7t7)U=|+^pefOY%L-H Dy^#@< delta 37 scmZ2vI^A@`Z&nF~>RN@w;_TEEg|z%4g~U9C#FUhx)Z*gJa%?Rk01PS(cK`qY diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin index 13048685948d635e400600fdbc4a9b6c1f875659..ed4c6c34f972e2c32c21ff465a8c25fc0ab9c509 100644 GIT binary patch delta 41 wcmeyhi1F7V#tAwCjgN1Awyx<^{1vz`?P08_&_)~MKOU^ZZmn7c5exr?XAh$t^t7>X2BLffs0B?~FiU0rr diff --git a/src/main/java/com/example/AddressBook.java b/src/main/java/com/example/AddressBook.java index 244cb7f..ea57564 100644 --- a/src/main/java/com/example/AddressBook.java +++ b/src/main/java/com/example/AddressBook.java @@ -64,7 +64,7 @@ public class AddressBook extends AbstractBehavior { Random random = new Random(); int index = random.nextInt(customers.size()); ActorRef addressOf = customers.get(index); - getContext().getLog().info("{} asked for an address CAR: {} ", msg.nameFragender, msg.truckReference.path().name()); + getContext().getLog().info("{} hat nach einer Addresse gefragt CAR: {} ", msg.nameFragender, msg.truckReference.path().name()); msg.fragender.tell(new Customer.AddressMessage(addressOf, msg.truckReference)); return this; } diff --git a/src/main/java/com/example/AkkaStart.java b/src/main/java/com/example/AkkaStart.java index 61d6744..009b0ea 100644 --- a/src/main/java/com/example/AkkaStart.java +++ b/src/main/java/com/example/AkkaStart.java @@ -1,3 +1,7 @@ + +/* +Martrikelnummer der Gruppenmitglieder: Olha Grubryn (), Egor Rutkowski(225064), Nikola Kramaric (238498), Dennis Ruppel (238503) +*/ package com.example; import akka.actor.typed.ActorSystem; diff --git a/src/main/java/com/example/DeliveryCar.java b/src/main/java/com/example/DeliveryCar.java index c91e5ad..640e7cf 100644 --- a/src/main/java/com/example/DeliveryCar.java +++ b/src/main/java/com/example/DeliveryCar.java @@ -51,6 +51,7 @@ public class DeliveryCar extends AbstractBehavior { .build(); } + //Nachricht, um Pakete zu beladen von DistributionCenter z.B. private Behavior onLoadMessage(LoadMessage msg) { pakete.addAll(msg.pakete); getContext().getLog().info("Laden: {} Pakete wurden in den LKW geladen.", msg.pakete.size()); @@ -58,6 +59,8 @@ public class DeliveryCar extends AbstractBehavior { return this; } + + //Die Nachricht, die den Paket, vom Kunden abholt und in den Wagen lädt private Behavior onPickupResponse(PickupResponse rsp) { if (rsp.paket != null && rsp.paket.inhalt != null && pakete.size() < maxCapacity) { pakete.add(rsp.paket); @@ -67,6 +70,7 @@ public class DeliveryCar extends AbstractBehavior { return this; } + //Prüft, ob der Wagen schon alle Addressen durchgegangen ist und geht zum Verteilerzentrum, sonst. geht dieser seine Route weiter private Behavior onCheckStop(CheckStop stop) { if (globalIndex >= route.size()) { getContext().getLog().info("Rückkehr: Der LKW kehrt zum Verteilzentrum zurück mit {} Paketen.", pakete.size()); @@ -86,21 +90,26 @@ public class DeliveryCar extends AbstractBehavior { return this; } + //Methode, um die Autos zu "starten" private Behavior onStartRoute(StartRoute msg) { globalIndex = 0; scheduleNextStopCheck(Duration.ofSeconds(3)); // Start checking the first stop after 3 seconds return this; } + // private Behavior onClear(Clear clear) { pakete.clear(); return this; } + //Sendet eine Nachricht an Customer bzw. an einen Addressaten, wo der Wagen steht, und fragt ob ein Paket von denen geliefert werden soll private void sendPickupMessage(ActorRef customer) { customer.tell(new Customer.PickUpMessage(getContext().getSelf(), "Der LKW kann das Paket abholen.")); } + + //Liefert Paket aus, die im Wagen ist private void deliverPackages(ActorRef customer) { pakete.removeIf(paket -> { if (paket.empfaenger.equals(customer)) { @@ -111,6 +120,7 @@ public class DeliveryCar extends AbstractBehavior { }); } + //Private Methode für den Timer private void scheduleNextStopCheck(Duration duration) { timers.startSingleTimer(new CheckStop(), duration); }