From 8f914c4c74502dd468f61b8f7eefe5d601b9794c Mon Sep 17 00:00:00 2001 From: rakow Date: Wed, 15 May 2024 13:41:21 +0200 Subject: [PATCH] warn if number of lanes does not match --- .../application/prepare/network/params/ApplyNetworkParams.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contribs/application/src/main/java/org/matsim/application/prepare/network/params/ApplyNetworkParams.java b/contribs/application/src/main/java/org/matsim/application/prepare/network/params/ApplyNetworkParams.java index e8f5123626e..29f9c86f57e 100644 --- a/contribs/application/src/main/java/org/matsim/application/prepare/network/params/ApplyNetworkParams.java +++ b/contribs/application/src/main/java/org/matsim/application/prepare/network/params/ApplyNetworkParams.java @@ -169,6 +169,9 @@ private void applyChanges(Link link, Feature ft) { modified = true; } + if (ft.features().getOrDefault("num_lanes", link.getNumberOfLanes()) != link.getNumberOfLanes()) + log.warn("Number of lanes for link {} does not match the feature file", link.getId()); + int totalCap = BigDecimal.valueOf(link.getNumberOfLanes() * perLane).setScale(0, RoundingMode.HALF_UP).intValue(); link.setCapacity(totalCap); }