From 2bd89dc2d66ff4a50c63f328ee8914cbbd38d025 Mon Sep 17 00:00:00 2001 From: nkuehnel Date: Thu, 5 Sep 2024 18:36:26 +0200 Subject: [PATCH 1/2] drt: be less strict with vehicle ids set equality in preplanned scenarios --- .../extension/preplanned/optimizer/PreplannedDrtOptimizer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contribs/drt-extensions/src/main/java/org/matsim/contrib/drt/extension/preplanned/optimizer/PreplannedDrtOptimizer.java b/contribs/drt-extensions/src/main/java/org/matsim/contrib/drt/extension/preplanned/optimizer/PreplannedDrtOptimizer.java index 5dd5f1c8bf7..d3031a3aa50 100644 --- a/contribs/drt-extensions/src/main/java/org/matsim/contrib/drt/extension/preplanned/optimizer/PreplannedDrtOptimizer.java +++ b/contribs/drt-extensions/src/main/java/org/matsim/contrib/drt/extension/preplanned/optimizer/PreplannedDrtOptimizer.java @@ -77,7 +77,7 @@ public PreplannedDrtOptimizer(DrtConfigGroup drtCfg, PreplannedSchedules preplan TravelTime travelTime, TravelDisutility travelDisutility, MobsimTimer timer, DrtTaskFactory taskFactory, EventsManager eventsManager, Fleet fleet, ScheduleTimingUpdater scheduleTimingUpdater) { Preconditions.checkArgument( - fleet.getVehicles().keySet().equals(preplannedSchedules.vehicleToPreplannedStops.keySet()), + fleet.getVehicles().keySet().containsAll(preplannedSchedules.vehicleToPreplannedStops.keySet()), "Some schedules are preplanned for vehicles outside the fleet"); this.mode = drtCfg.getMode(); From 47cd4baf750b8d949bff8b96b63774d1390a2a31 Mon Sep 17 00:00:00 2001 From: Tarek Chouaki Date: Fri, 13 Sep 2024 18:26:28 +0200 Subject: [PATCH 2/2] chore: default zoning params --- .../contrib/zone/skims/DvrpTravelTimeMatrixParams.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contribs/dvrp/src/main/java/org/matsim/contrib/zone/skims/DvrpTravelTimeMatrixParams.java b/contribs/dvrp/src/main/java/org/matsim/contrib/zone/skims/DvrpTravelTimeMatrixParams.java index a12930c5d42..52c3c332f09 100644 --- a/contribs/dvrp/src/main/java/org/matsim/contrib/zone/skims/DvrpTravelTimeMatrixParams.java +++ b/contribs/dvrp/src/main/java/org/matsim/contrib/zone/skims/DvrpTravelTimeMatrixParams.java @@ -20,6 +20,7 @@ package org.matsim.contrib.zone.skims; +import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.PositiveOrZero; import org.matsim.contrib.common.util.ReflectiveConfigGroupWithConfigurableParameterSets; import org.matsim.contrib.common.zones.ZoneSystemParams; @@ -55,6 +56,7 @@ public class DvrpTravelTimeMatrixParams extends ReflectiveConfigGroupWithConfigu + " The unit is seconds. Default value is 0 s (for backward compatibility).") @PositiveOrZero public double maxNeighborTravelTime = 0; //[s] + @NotNull private ZoneSystemParams zoneSystemParams; @@ -101,6 +103,11 @@ public void handleAddUnknownParam(String paramName, String value) { } public ZoneSystemParams getZoneSystemParams() { + if(this.zoneSystemParams == null) { + SquareGridZoneSystemParams squareGridZoneSystemParams = new SquareGridZoneSystemParams(); + squareGridZoneSystemParams.cellSize = 200; + this.zoneSystemParams = squareGridZoneSystemParams; + } return zoneSystemParams; } }