Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/scenario-cutout' into scenario-c…
Browse files Browse the repository at this point in the history
…utout
  • Loading branch information
Aleksander1234519 committed Dec 3, 2024
2 parents 4b4675a + a1143a2 commit 8bec2c4
Show file tree
Hide file tree
Showing 717 changed files with 51,424 additions and 7,105 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/deploy-dtds.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: deploy-dtds-on-website

on:
push:
branches:
- master
pull_request:
types:
- closed
paths:
- matsim/src/main/resources/dtd
- 'matsim/src/main/resources/dtd/**'

jobs:
rsync-dtds:
if: github.event.pull_request.merged == true # only if PR closed by merging
name: sync DTDs to website
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: rsync dtds
uses: burnett01/[email protected]
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/full-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest]
#os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Prepare git
Expand Down
6 changes: 3 additions & 3 deletions contribs/accessibility/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>matrixbasedptrouter</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>roadpricing</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>net.sf.trove4j</groupId>
Expand Down Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>analysis</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.matsim.contrib</groupId>-->
Expand Down
2 changes: 1 addition & 1 deletion contribs/analysis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>roadpricing</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.osgeo</groupId>
Expand Down
18 changes: 9 additions & 9 deletions contribs/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,37 @@
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>otfvis</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>osm</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>sumo</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>analysis</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>emissions</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>noise</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>freight</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
<exclusions>
<!-- Logging levels are all messed up without this exclusion -->
<exclusion>
Expand All @@ -87,7 +87,7 @@
<dependency>
<groupId>com.github.matsim-org</groupId>
<artifactId>gtfs2matsim</artifactId>
<version>fc8b13954d</version>
<version>47b0802a29</version>
<exclusions>
<!-- Exclude unneeded dependencies and these with known CVE -->
<exclusion>
Expand Down Expand Up @@ -151,7 +151,7 @@
<dependency>
<groupId>org.matsim.contrib</groupId>
<artifactId>dvrp</artifactId>
<version>2025.0-SNAPSHOT</version>
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,12 +440,17 @@ public static Path matchInput(String name, Path dir) {
if (path.isPresent())
return path.get();

// Match more general pattern at last
path = matchPattern(".+\\.[a-zA-Z0-9]*_" + name + "\\..+", dir);
// Match more general pattern
path = matchPattern(".+\\.[a-zA-Z0-9\\-]*_" + name + "\\..+", dir);
if (path.isPresent())
return path.get();

throw new IllegalArgumentException("Could not match input file: " + name);
// Even more permissive pattern
path = matchPattern(".+[a-zA-Z0-9_.\\-]*(_|\\.)" + name + ".+", dir);
if (path.isPresent())
return path.get();

throw new IllegalArgumentException("Could not match input file: %s (in %s)".formatted(name, dir));
}

private static Optional<Path> matchSuffix(String suffix, Path dir) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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",
Expand Down Expand Up @@ -67,7 +66,7 @@ public class NoiseAnalysis implements MATSimAppCommand {

@CommandLine.Option(names = "--consider-activities", split = ",", description = "Considered activities for noise calculation." +
" Use asterisk ('*') for acttype prefixes, if all such acts shall be considered.", defaultValue = "home*,work*,educ*,leisure*")
private Set<String> considerActivities;
private Set<String> consideredActivities;

@CommandLine.Option(names = "--noise-barrier", description = "Path to the noise barrier File", defaultValue = "")
private String noiseBarrierFile;
Expand All @@ -87,10 +86,19 @@ public Integer call() throws Exception {
boolean overrideParameters = ! ConfigUtils.hasModule(config, NoiseConfigGroup.class);
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!");
noiseParameters.setConsideredActivitiesForReceiverPointGridArray(considerActivities.toArray(String[]::new));
noiseParameters.setConsideredActivitiesForDamageCalculationArray(considerActivities.toArray(String[]::new));
if (overrideParameters){
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(consideredActivities.toArray(String[]::new));
noiseParameters.setConsideredActivitiesForDamageCalculationArray(consideredActivities.toArray(String[]::new));

{
//the default settings are now actually the same as what we 'override' here, but let's leave it here for clarity.
Set<String> ignoredNetworkModes = CollectionUtils.stringArrayToSet( new String[]{TransportMode.bike, TransportMode.walk, TransportMode.transit_walk, TransportMode.non_network_walk} );
noiseParameters.setNetworkModesToIgnoreSet( ignoredNetworkModes );

String[] hgvIdPrefixes = {"lkw", "truck", "freight"};
noiseParameters.setHgvIdPrefixesArray( hgvIdPrefixes );
}

//use actual speed and not freespeed
noiseParameters.setUseActualSpeedLevel(true);
Expand Down Expand Up @@ -181,7 +189,7 @@ private Config prepareConfig() {
config.transit().setTransitScheduleFile(null);
config.transit().setVehiclesFile(null);
config.plans().setInputFile(ApplicationUtils.matchInput("plans", input.getRunDirectory()).toAbsolutePath().toString());
config.facilities().setInputFile(null);
config.facilities().setInputFile(ApplicationUtils.matchInput("facilities", input.getRunDirectory()).toAbsolutePath().toString());
config.eventsManager().setNumberOfThreads(null);
config.eventsManager().setEstimatedNumberOfEvents(null);
//ts, aug '24: not sure if and why we need to set 1 thread
Expand Down
Loading

0 comments on commit 8bec2c4

Please sign in to comment.