From 5d094ec17c3ec00a4d87898d3edf38d8fa3d7ad2 Mon Sep 17 00:00:00 2001 From: Kai Nagel Date: Wed, 16 Oct 2024 20:53:00 +0200 Subject: [PATCH] typical vehicle categories for noise analysis --- .../analysis/noise/NoiseAnalysis.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/contribs/application/src/main/java/org/matsim/application/analysis/noise/NoiseAnalysis.java b/contribs/application/src/main/java/org/matsim/application/analysis/noise/NoiseAnalysis.java index 3976a35c21b..a3f321c7f38 100644 --- a/contribs/application/src/main/java/org/matsim/application/analysis/noise/NoiseAnalysis.java +++ b/contribs/application/src/main/java/org/matsim/application/analysis/noise/NoiseAnalysis.java @@ -7,6 +7,7 @@ import org.locationtech.jts.geom.Envelope; import org.matsim.api.core.v01.Coord; import org.matsim.api.core.v01.Scenario; +import org.matsim.api.core.v01.TransportMode; import org.matsim.application.ApplicationUtils; import org.matsim.application.CommandSpec; import org.matsim.application.MATSimAppCommand; @@ -20,6 +21,7 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.scenario.ScenarioUtils; +import org.matsim.core.utils.collections.CollectionUtils; import org.matsim.core.utils.geometry.CoordinateTransformation; import org.matsim.core.utils.io.IOUtils; import picocli.CommandLine; @@ -28,10 +30,7 @@ import java.nio.file.Path; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.*; @CommandLine.Command( name = "noise-analysis", @@ -88,10 +87,18 @@ public Integer call() throws Exception { NoiseConfigGroup noiseParameters = ConfigUtils.addOrGetModule(config, NoiseConfigGroup.class); if(overrideParameters){ - log.warn("no NoiseConfigGroup was configured before. Will set some standards. You should check the next lines in the log file!"); + log.warn("no NoiseConfigGroup was configured before. Will set some standards. You should check the next lines in the log file and the output_config.xml!"); noiseParameters.setConsideredActivitiesForReceiverPointGridArray(considerActivities.toArray(String[]::new)); noiseParameters.setConsideredActivitiesForDamageCalculationArray(considerActivities.toArray(String[]::new)); + { + Set set = CollectionUtils.stringArrayToSet( new String[]{TransportMode.bike, TransportMode.walk, TransportMode.transit_walk, TransportMode.non_network_walk} ); + noiseParameters.setNetworkModesToIgnoreSet( set ); + } + { + String[] set = new String[]{"freight"}; + noiseParameters.setHgvIdPrefixesArray( set ); + } //use actual speed and not freespeed noiseParameters.setUseActualSpeedLevel(true); //use the valid speed range (recommended by IK)