From 02c4773f797488fde3cf57a074ce855cabbf56cc Mon Sep 17 00:00:00 2001 From: Ricardo Ewert Date: Thu, 8 Feb 2024 22:13:45 +0100 Subject: [PATCH] add warning --- .../freightDemandGeneration/DemandReaderFromCSV.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java index 79d8efddbc1..d991eaa9a6f 100644 --- a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java +++ b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/DemandReaderFromCSV.java @@ -883,9 +883,12 @@ else if (population == null) + " for pickup is not part of the possible links for pickup. Please check!"); if (setLocationsOfDelivery != null) - for (String selectedLinkIdDelivery : setLocationsOfDelivery) - if (!possibleLinksDelivery.containsKey(Id.createLinkId(selectedLinkIdDelivery))) - throw new RuntimeException("The selected link " + selectedLinkIdDelivery + if (numberOfDeliveryLocations < setLocationsOfDelivery.length) + log.warn("You selected more certain locations than the set number of locations. Randomly selected locations will be used."); + else + for (String selectedLinkIdDelivery : setLocationsOfDelivery) + if (!possibleLinksDelivery.containsKey(Id.createLinkId(selectedLinkIdDelivery))) + throw new RuntimeException("The selected link " + selectedLinkIdDelivery + " for delivery is not part of the possible links for delivery. Please check!"); // distribute the demand over the network because no number of jobs is selected