chore: use 1s STEP

This commit is contained in:
js0ny 2025-12-06 05:09:16 +00:00
parent acf9d132f7
commit 0ce7faaa07
5 changed files with 1304 additions and 1348 deletions

View file

@ -23,7 +23,10 @@ public record DroneEvent(
double latitude,
double longitude,
String timestamp) {
final static int STEP = 1; // seconds between events
// Helper method that converts from DeliveryPathResponse to List<DroneEvent>
public static List<DroneEvent> fromPathResponse(DeliveryPathResponse resp) {
List<DroneEvent> events = new java.util.ArrayList<>();
for (var p : resp.dronePaths()) {
@ -57,7 +60,7 @@ public record DroneEvent(
coord.lat(),
coord.lng(),
timestamp.toString()));
timestamp = timestamp.plusSeconds(1); // Increment timestamp for each event
timestamp = timestamp.plusSeconds(STEP); // Increment timestamp for each event
}
}
}
@ -80,7 +83,7 @@ public record DroneEvent(
coord.lat(),
coord.lng(),
current.toString()));
current = current.plusSeconds(1);
current = current.plusSeconds(STEP);
}
}
}