From ef94068bc3372e6dbb873f9664361aaf6f3591f8 Mon Sep 17 00:00:00 2001 From: olhag Date: Sun, 19 May 2024 13:12:44 +0200 Subject: [PATCH] Timer fixed and no locks --- .../7.1/executionHistory/executionHistory.bin | Bin 80265 -> 80265 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/7.1/fileHashes/fileHashes.bin | Bin 21797 -> 21797 bytes .gradle/7.1/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .gradle/checksums/checksums.lock | Bin 17 -> 17 bytes .../com/example/DeliveryCar$CheckStop.class | Bin 1344 -> 1344 bytes .../com/example/DeliveryCar$LoadMessage.class | Bin 1772 -> 1772 bytes .../example/DeliveryCar$PickupResponse.class | Bin 1586 -> 1586 bytes .../com/example/DeliveryCar$StartRoute.class | Bin 1350 -> 1350 bytes .../java/main/com/example/DeliveryCar.class | Bin 10252 -> 10989 bytes .../DistributionCenter$GenerateRoutes.class | Bin 1083 -> 1083 bytes .../DistributionCenter$StartAllRoutes.class | Bin 500 -> 500 bytes .../main/com/example/DistributionCenter.class | Bin 11535 -> 11367 bytes .../compileJava/previous-compilation-data.bin | Bin 20804 -> 20804 bytes src/main/java/com/example/DeliveryCar.java | 66 +++++++----------- .../java/com/example/DistributionCenter.java | 36 +++------- 17 files changed, 37 insertions(+), 65 deletions(-) diff --git a/.gradle/7.1/executionHistory/executionHistory.bin b/.gradle/7.1/executionHistory/executionHistory.bin index a6c89ef96fa8289c57d5d811234b38b3e7f6db38..c9a290a290879ceeb1b266068396e23d685ee1c6 100644 GIT binary patch delta 658 zcmeDD%+mRprC|%Bpo~&QK}C{rX<0=|QEEm~c11-_ifK+>eo0PJE&~`aZ=C}#@dW87zG}dtYgq@c&?OoldtOEv9nQ=Yjze1%rRf4-^Z=j790O<8|~SkncC z84Xz9g9R7tk&u||Cq1v{v%On#uJOAh@&5HKFMx^+r<+c0Tr5Ai^P2$c-Bl}r`X7`@ zPvs}CR z`a=;$W7eZ!W{eS|D(e+6v(1Q6Nn+R3fV=E-EIuU42i{-mJ+FV!OOP85a7|vYPf_&j z#F=GEi~mj+%$+tVH<@$GRFLHK8d0DxCW4t8MH$s4mM}m5eLLnc(?Yw9vzORcKbZkG zViV7FEipy~(Rk;Rhfn6ROMmFxlVQ8=!2S7PjqzfP5)w>n-rclO*Kk;P;2W#-zI$G) z!5ZI&PCswVXvO*-tni!|qn@bGPDcB>4;CM4m<2zp9lWyQBUmcXgwdSi6<9J DpOHA> delta 604 zcmeDD%+mRprC|%Bpo~&wQn6WCW@>tQTC!P5dTCifQbl@NPM(>0DgziW`b=)DcHP`i zoy#}bY`fofV{OJ4i~^ER&0e2sqYnl3D@~N+8EC+y$=>o!x zhAewQLi6`XN=){Xp4ao)-Yq%T_+65C|N28fi64g3O(!=lmY>}DO@Q_NeRF{-j&1T))=7?mVUd}n6zem1BJah_+*-fea75lG7L0N3ON`xK|A zi!utZ+yj|VEedq>Z4hgND5C|(eXy!cJkzzr7!6n+fW+g(7$qf)zSy6=|5_yF=Q3KU*`V7#)X`HOPY z%o|&NdVK@y?vI+>_{(U!r75E&lbPRbmcy^U-rL1|ih)bt&gcL$gFw`>&X2p&9-s8+ zNOibcekKtpRIrNQ(J8paF>})NblJ`gs+-UD*E5Qq{B?2D>2j`1?Ms-qDY>{p1x5e> literal 17 VcmZQJ-Ffa%$-@Ly1~6cJ0020X1w8-& diff --git a/.gradle/7.1/fileHashes/fileHashes.bin b/.gradle/7.1/fileHashes/fileHashes.bin index 1117e748169768d2b0bb336769a019f30aadf435..e5e9bf737ad924b237795b6be38227f2dec36d07 100644 GIT binary patch delta 604 zcmZ3wigD>G#tofbEEBpyV<-1|>46w&oA-NFFiPx_C`-=S^ycAhyR^-x-h7zGz`)o) zp=ayD&Hg@1n1UXbtYgq@c&?OoldtOEv9nPS+4aX6z(7zQNa+~^2~8kY1Yv>My$Z{# zlh(}Jo_sZ~hMl(ytfR~9Cr}ayBxEPM`bV%#=-K>z@(*v zQzs_}>eT~{oCvX=;R=vObMO-8$G>mKJZ4&GmvQzI`|2l9tur7x*o-iBFs*ra(?(sx zVc~&qtkV1Lc|moohUn0Gi>70;K#(}dTdyW-2T3WM+?}STwlK;1n@ACtQrP4NP|d#} znsw4Qrv?Qvf|S3XygN7n6hOZx%ZErw`0Qk~ulr!}p@v!Tv)aKcE1>#5P7Vz535s_< zdH7^5yYz?7JsGy^4%~-I&W9Mv>W1bbU^IEzew(MQbn(TqDid~5OO8mWju#Lej9(^C g3>H?N8gQ3=j>U&W`M~>2z325q)hvRV>Hsno0DYOuga7~l delta 619 zcmZ3wigD>G#tofbEIr2y-%sxK(gQI*Y~Jrx!6J;=mPuz00~iQ811UXYAfXAwiXbd7mn&!A z&!%I!f;t7lx4)k80_o^E&Q}bS1OjQv$*%qpEIo=eUY=Rcg!4?%qqH#s>_ zuO4U#&|6?|1xTVfxN|{Bm|1hqOXiExEIS|cOoD2ShiG6k!qj2(#s2L5*CHt=H&1%Y zvB0(isv`xWLxTrR$7F#Zagav~Cu;{uDHJHY{J?l+P4gG!sF^pm`~-&&P_hi7S(krv zYETd(NO{rZ-N6YUhQnm}5Gjcn%q)?LuP%L=b0OX6_Q44WP)my^2Zs36CoRw0I@LWs zuE^zpTG6Db)1i_;MIgZH1|-mYExTjc1Ez`snQNZsR$0ie&4TJE0Bc}i{DP^&#CK*U c?`MO$5a)T;?A=!PpgNL(Dmj6e)d8dh03|oDUjP6A diff --git a/.gradle/7.1/fileHashes/fileHashes.lock b/.gradle/7.1/fileHashes/fileHashes.lock index f00e982e630f523290c8b4ee6ef3d7cc28c53d75..bbe791b27a47558ebb82011cf7fbe5225a589a4d 100644 GIT binary patch literal 17 VcmZR6t*}YBa<=Ot1~B0H3;;1p1kL~e literal 17 VcmZR6t*}YBa<=Ot1~A}R3;;0u1bzSj diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 450cc1951d5b5f8b0a96f85ef122286e21e2b9e3..642f185b0c77adf6429c1f88af5a60e5e7b94063 100644 GIT binary patch literal 17 VcmZR6_T&GuLYbG|3}C?g5&%ZH1~dQw literal 17 VcmZR6_T&GuLYbG|3}C=~9RNnA1|k3e diff --git a/.gradle/checksums/checksums.lock b/.gradle/checksums/checksums.lock index c590545901c848ccf92776c498398b6f92064e33..340dbe959e23b22e80689a91ea901eb2be39e06c 100644 GIT binary patch literal 17 UcmZSHc6HyxsH7{$7$86m070?^S^xk5 literal 17 UcmZSHc6HyxsH7{$7$86i070$=RsaA1 diff --git a/build/classes/java/main/com/example/DeliveryCar$CheckStop.class b/build/classes/java/main/com/example/DeliveryCar$CheckStop.class index e2c4eac93a85d8ed82a65281d87e2a52a503bfa6..a104d3d81f3612852b142fe15d10be951cd41d7e 100644 GIT binary patch delta 31 gcmX@Wb%1MwGz+8LWEmDaAQ=rNXR+7=*|%8I0E6WSNB{r; delta 31 gcmX@Wb%1MwGz+8bWEmDaAQ=rNXR+7=*|%8I0E4XvL;wH) diff --git a/build/classes/java/main/com/example/DeliveryCar$LoadMessage.class b/build/classes/java/main/com/example/DeliveryCar$LoadMessage.class index 1987861058fd8f7485bdf9383e5ac2ff77f6b8a3..30183298d0082e7a77cd58f24f75aa24f3a3879d 100644 GIT binary patch delta 41 pcmaFE`-XReGb^LSWEa+4Ao-D1bn0fg}g39guWqwFi>ztZqQ^9BT>y%w-BR delta 37 ncmdnQvx#TJW)?=t$y->0fg}g39guWqwFi>ztZqQ^9BT>y%n%AM diff --git a/build/classes/java/main/com/example/DeliveryCar$StartRoute.class b/build/classes/java/main/com/example/DeliveryCar$StartRoute.class index 6fbaa1b9d79229647b5f771308b41d5f211dc2fe..65ef920dc8e807a7bc7a861bb62c7e68cb9cb510 100644 GIT binary patch delta 35 jcmX@cb&P9+A`7F;WF;0mAejgyMJI1%(E{=xu%rP1sJRJu delta 35 jcmX@cb&P9+A`7GRWF;0mAejgyMJI1%(E{=xu%rP1sC5Z* diff --git a/build/classes/java/main/com/example/DeliveryCar.class b/build/classes/java/main/com/example/DeliveryCar.class index 41bbc1965b30c8f56bec486eac6f2d3e295205c2..9f31e90e04dad3ab0fae90f892c9419edf9c63f7 100644 GIT binary patch literal 10989 zcmcIq349z^dH;X9X1y96UfXgUACYa@kyf(hL-7&WvSs;_E!mFc1IdASv^$d4TJ0)( z_#{mr2jE}`B@jXkaT36Rq^(J9`JyC1n>J|*ZAwcaEp2Hj4QZj2USLA_znR(HS!q`h zbu0aL=e;-Yec$)K`+aX;{^gY~16U)^dQpHv4MjSNQ6i`_1_zBsBan#38WYEc&0ymp zpdN*Ci4c5E8u!+ZiX zhKIvM-&pISS8<@(fp^Fl4mI{ABY{LH8fo0@G@89wfQ1@v)=`T(!Mwa2PYH+=7RSv* za#(PyBcME>b8I99glNl9ucHBr1d}7?k=Y=~4}ADfWD`yAnn$ zv0Le?4~1&-dcoX$liLQ&z+hJ*I_yIcmU_{IHXR$Wi5k=JnU&4lAJXl3J3((3ju zrPz%w4SRI##XiA;ywY~BB5}ml5$zXDC8lVszcC)}YdX}(p?;dK2k#Kf-eQK0pc$z? zaaZ*&%iUCmBGqc3WBdNarRc!{4Y%ufC*CC}&$uCF)`FsV=s5L=Uaj4WgD^Do>Ii^b zo@`CE6sw&clK2GLVI!P0clHUYYTN5P-~61-aVj?KcOa;l$$V*1<&5q!w4VMvfZ;VX8zdtsp~6Ic}xOc<=%G$&Gx) zf$BkXAeN{;o*b&)XT}m{D16+EBx39yPsYA>?^nMR7^Fh=;Xx(d500Y9Azp>i4+$FF zd)`P@i-md_RHKnLLNsGFjIH$4jtf!7@sN&>;5Vsa)c7tlOck4*%eXA_*lqSvj;HXj zipd`nEOuM26|Tlczx2YoeO^3*PiS~l$0rrW8{MR~GR5dLLXoax@q{_VEs~tE$XXmSQJvwKB`n zoV6Z&p4QwR7^v>0=zGl&WvQroM#r=GEutMZ5(9!8vUzBcwTo|PsK0}A8osFGIs7i& zi)#nzNrVzHhUguX^T~LFw3e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H88b#!TOZZ-ghWo~q3au9GJ>F@#6tb_C;TAA3i`AU=E0Wc7l z0|Z$i>eBR_&}TB+!H{5+AOdX=iJ(+gHiK;G1JN4X&EM-3WXZFV z?FgVfh_l}U2>}o^O_^y8^Dur?L!LVai#pzu_yaZ&9k{080(fv7)=AE)I3KNQvpxg{ EO^ioaUjP6A diff --git a/src/main/java/com/example/DeliveryCar.java b/src/main/java/com/example/DeliveryCar.java index 135e7ec..559ff53 100644 --- a/src/main/java/com/example/DeliveryCar.java +++ b/src/main/java/com/example/DeliveryCar.java @@ -1,3 +1,4 @@ +// DeliveryCar.java package com.example; import akka.actor.typed.ActorRef; @@ -50,74 +51,61 @@ public class DeliveryCar extends AbstractBehavior { private Behavior onLoadMessage(LoadMessage msg) { pakete.addAll(msg.pakete); - scheduleNextStopCheck(); + getContext().getLog().info("Geladen {} Pakete in den LKW.", msg.pakete.size()); + scheduleNextStopCheck(Duration.ofSeconds(3)); // Start checking the first stop after 3 seconds return this; } private Behavior onPickupResponse(PickupResponse rsp) { - if (rsp.paket == null || rsp.paket.inhalt == null) { - scheduleNextStopCheck(); - } else { - if (pakete.size() < maxCapacity) { - pakete.add(rsp.paket); - getContext().getLog().info("Current number of packages in the truck: {}", pakete.size()); - } - scheduleNextStopCheck(); + if (rsp.paket != null && rsp.paket.inhalt != null && pakete.size() < maxCapacity) { + pakete.add(rsp.paket); + getContext().getLog().info("Ein Paket abgeholt. Aktuelle Anzahl der Pakete im LKW: {}", pakete.size()); } - + scheduleNextStopCheck(Duration.ofSeconds(1)); // Move to the next stop after 1 second return this; } private Behavior onCheckStop(CheckStop stop) { if (globalIndex >= route.size()) { - getContext().getLog().info("Car is returning to the distribution center."); + getContext().getLog().info("Der LKW kehrt zum Verteilzentrum zurück."); DistributionCenter.ArriveMessage antwort = new DistributionCenter.ArriveMessage(pakete, getContext().getSelf()); getDistributionCenter().tell(antwort); + pakete.clear(); globalIndex = 0; } else { - getContext().getLog().info("I am at {}", route.get(globalIndex).path().name()); - if (pakete.size() >= maxCapacity) { - deliverPackages(); - } else { - sendPickupMessage(); + ActorRef currentStop = route.get(globalIndex); + getContext().getLog().info("Ich bin bei {}", currentStop.path().name()); + deliverPackages(currentStop); + if (pakete.size() < maxCapacity) { + sendPickupMessage(currentStop); } globalIndex++; + scheduleNextStopCheck(pakete.size() >= maxCapacity ? Duration.ofSeconds(1) : Duration.ofSeconds(3)); } - scheduleNextStopCheck(); return this; } - private Behavior onStartRoute(StartRoute msg) { globalIndex = 0; - scheduleNextStopCheck(); + scheduleNextStopCheck(Duration.ofSeconds(3)); // Start checking the first stop after 3 seconds return this; } - private void sendPickupMessage() { - if (globalIndex < route.size()) { - ActorRef nextCustomer = route.get(globalIndex); - nextCustomer.tell(new Customer.PickUpMessage(getContext().getSelf(), "Car can pick up package")); - } else { - getContext().getLog().info("No more customers in the route."); - } + private void sendPickupMessage(ActorRef customer) { + customer.tell(new Customer.PickUpMessage(getContext().getSelf(), "LKW kann Paket abholen")); } - private void deliverPackages() { - if (globalIndex < route.size()) { - ActorRef nextCustomer = route.get(globalIndex); - for (int i = 0; i < pakete.size(); i++) { - Paket paket = pakete.get(i); - if (paket.empfaenger == nextCustomer) { - nextCustomer.tell(new Customer.DeliveryMessage(paket)); - pakete.remove(i); - i--; // Adjust index since an element is removed - } + private void deliverPackages(ActorRef customer) { + pakete.removeIf(paket -> { + if (paket.empfaenger.equals(customer)) { + customer.tell(new Customer.DeliveryMessage(paket)); + return true; } - } + return false; + }); } - private void scheduleNextStopCheck() { - timers.startSingleTimer(new CheckStop(), Duration.ofSeconds(3)); + private void scheduleNextStopCheck(Duration duration) { + timers.startSingleTimer(new CheckStop(), duration); } } diff --git a/src/main/java/com/example/DistributionCenter.java b/src/main/java/com/example/DistributionCenter.java index 82f043d..9fdf470 100644 --- a/src/main/java/com/example/DistributionCenter.java +++ b/src/main/java/com/example/DistributionCenter.java @@ -1,3 +1,4 @@ +// DistributionCenter.java package com.example; import akka.actor.typed.ActorRef; @@ -19,7 +20,6 @@ public class DistributionCenter extends AbstractBehavior lagerraum = new ArrayList<>(); private final List> deliveryCars = new ArrayList<>(); - private DistributionCenter(ActorContext context, ActorRef addressBook) { super(context); this.addressBook = addressBook; @@ -65,8 +65,6 @@ public class DistributionCenter extends AbstractBehavior> customers; @@ -92,14 +90,7 @@ public class DistributionCenter extends AbstractBehavior arrivedPackages = msg.getPakete(); lagerraum.addAll(arrivedPackages); - String arrivedPackagesString = ""; - for (int i = 0; i < arrivedPackages.size(); i++) { - arrivedPackagesString += arrivedPackages.get(i).inhalt; - if (i < arrivedPackages.size() - 1) { - arrivedPackagesString += ", "; // Fügen Sie ein Trennzeichen hinzu, außer für das letzte Paket - } - } - getContext().getLog().info("Angekommene Pakete: {} Anz Packeten in Lager: {}", arrivedPackagesString, lagerraum.size()); + getContext().getLog().info("Angekommene Pakete: {} Anz Packeten in Lager: {}", arrivedPackages.size(), lagerraum.size()); // Entferne zufällig 3 Pakete aus dem Lagerraum und sende sie dem angekommenen Wagen int numPackagesToSend = Math.min(3, lagerraum.size()); @@ -115,8 +106,6 @@ public class DistributionCenter extends AbstractBehavior onGenerateRoutes(GenerateRoutes msg) { List> customers = msg.getCustomers(); generateRoutes(customers); @@ -124,32 +113,28 @@ public class DistributionCenter extends AbstractBehavior> customers) { - // Überprüfen, ob die Kundenliste null oder leer ist if (customers == null || customers.isEmpty()) { getContext().getLog().info("Kundenliste ist leer oder null. Keine Routen generiert."); return; } - // Erstelle vier Lastwagen mit zufälligen Routen - for (int i = 0; i < 2; i++) { - /*List> route = generateRandomRoute(customers); - getContext().spawn(DeliveryCar.create(route), "deliveryCar" + i+1); - getContext().getLog().info("Lieferwagen {} erstellt mit Route: {}", i+1, route.toString());*/ + for (int i = 0; i < 4; i++) { // Erstelle vier Lieferwagen List> route = generateRandomRoute(customers); ActorRef deliveryCar = getContext().spawn(DeliveryCar.create(route), "deliveryCar" + (i + 1)); + deliveryCars.add(deliveryCar); - String RouteStr = ""; + StringBuilder routeStr = new StringBuilder(); for (int j = 0; j < route.size(); j++) { - RouteStr += route.get(j).path().name(); + routeStr.append(route.get(j).path().name()); if (j < route.size() - 1) { - RouteStr += ", "; // Fügen Sie ein Trennzeichen hinzu, außer für das letzte Paket + routeStr.append(", "); } } - getContext().getLog().info("Lieferwagen {} erstellt mit Route: {}", i + 1, RouteStr); + getContext().getLog().info("Lieferwagen {} erstellt mit Route: {}", i + 1, routeStr); deliveryCar.tell(new DeliveryCar.StartRoute()); - } } + private Behavior onStartAllRoutes(StartAllRoutes msg) { for (ActorRef deliveryCar : deliveryCars) { deliveryCar.tell(new DeliveryCar.StartRoute()); @@ -157,10 +142,9 @@ public class DistributionCenter extends AbstractBehavior> generateRandomRoute(List> customers) { List> route = new ArrayList<>(customers); Collections.shuffle(route); return route; } -} \ No newline at end of file +}