diff --git a/.gradle/7.1/executionHistory/executionHistory.bin b/.gradle/7.1/executionHistory/executionHistory.bin
index b64d7e3..d9218ff 100644
Binary files a/.gradle/7.1/executionHistory/executionHistory.bin and b/.gradle/7.1/executionHistory/executionHistory.bin differ
diff --git a/.gradle/7.1/executionHistory/executionHistory.lock b/.gradle/7.1/executionHistory/executionHistory.lock
index 8933358..c98cdd4 100644
Binary files a/.gradle/7.1/executionHistory/executionHistory.lock and b/.gradle/7.1/executionHistory/executionHistory.lock differ
diff --git a/.gradle/7.1/fileHashes/fileHashes.bin b/.gradle/7.1/fileHashes/fileHashes.bin
index 7bba79a..e472d9e 100644
Binary files a/.gradle/7.1/fileHashes/fileHashes.bin and b/.gradle/7.1/fileHashes/fileHashes.bin differ
diff --git a/.gradle/7.1/fileHashes/fileHashes.lock b/.gradle/7.1/fileHashes/fileHashes.lock
index 341b18b..d8c8580 100644
Binary files a/.gradle/7.1/fileHashes/fileHashes.lock and b/.gradle/7.1/fileHashes/fileHashes.lock differ
diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock
index 9a1a849..93a297b 100644
Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ
diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin
index a1e82de..1aa6946 100644
Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ
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 ef0e26a..1fbe22c 100644
Binary files a/build/classes/java/main/com/example/AddressBook.class and b/build/classes/java/main/com/example/AddressBook.class differ
diff --git a/build/tmp/compileJava/previous-compilation-data.bin b/build/tmp/compileJava/previous-compilation-data.bin
index 1304868..ed4c6c3 100644
Binary files a/build/tmp/compileJava/previous-compilation-data.bin and b/build/tmp/compileJava/previous-compilation-data.bin differ
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);
}