Skip to content

Commit

Permalink
Merge pull request #1 from matsim-scenarios/bump-to-matsim-prxxxx
Browse files Browse the repository at this point in the history
bump to newer MATSim version
  • Loading branch information
simei94 authored Mar 5, 2024
2 parents 7a5883d + ccf6a68 commit 000574b
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 25 deletions.
20 changes: 12 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
<!--<matsim.version>14.0-PR1452</matsim.version>-->

<!-- snapshot == not recommended: rather use PR-labelled release!-->
<!-- FIXME: Decide on version -->
<!-- <version>15.0-SNAPSHOT</version>-->
<version>16.0-PR2918</version>
<version>16.0-PR3123</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down Expand Up @@ -126,12 +125,12 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.4</version>
<version>5.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.4</version>
<version>5.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
Expand All @@ -141,14 +140,19 @@
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>5.1.1</version>
<version>5.2.0</version>
</dependency>


<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -215,7 +219,7 @@
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<!-- avoid out of memory errors: -->
<argLine>@{argLine} -Xmx9500m -Djava.awt.headless=true -Dmatsim.preferLocalDtds=true</argLine>
<argLine>@{argLine} -Djava.awt.headless=true -Dmatsim.preferLocalDtds=true</argLine>
<!--necessary in tu berlin gitlab. BUT not good in other places, so solve by command line switch only where needed. kai, nov'18-->
<!--<useSystemClassLoader>false</useSystemClassLoader>-->
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/matsim/prepare/PrepareNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Integer call() throws Exception {

Network network = NetworkUtils.readNetwork(networkFile);

if (!MexicoCityUtils.isDefined(shp.getShapeFile())) {
if (shp.getShapeFile() == null) {
shp = new ShpOptions(Path.of("input/v1.0/area/area.shp"), null, null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.matsim.core.network.algorithms.TransportModeNetworkFilter;
import org.matsim.core.network.filter.NetworkFilterManager;
import org.matsim.facilities.*;
import org.matsim.prepare.MexicoCityUtils;
import org.opengis.feature.simple.SimpleFeature;
import picocli.CommandLine;

Expand Down Expand Up @@ -66,7 +65,7 @@ public static void main(String[] args) {
@Override
public Integer call() throws Exception {

if (!MexicoCityUtils.isDefined(shp.getShapeFile())) {
if (shp.getShapeFile() == null) {
log.error("Shp file with facility locations is required.");
return 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public Integer call() throws Exception {

final CoordinateTransformation ct = new GeotoolsTransformation(targetCrs, targetCrs);

if (!MexicoCityUtils.isDefined(shp.getShapeFile())) {
if (shp.getShapeFile() == null) {
log.error("Shape file with municipios of ZMVM is required.");
return 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Integer call() throws Exception {

final CoordinateTransformation ct = new GeotoolsTransformation(targetCrs, targetCrs);

if (MexicoCityUtils.isDefined(shp.getShapeFile())) {
if (shp.getShapeFile() == null) {
log.error("Shape file with manzanas is required.");
return 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private static Coord rndCoord(SplittableRandom rnd, double dist, Coord origin) {
@Override
public Integer call() throws Exception {

if (!MexicoCityUtils.isDefined(shp.getShapeFile())) {
if (shp.getShapeFile() == null) {
log.error("Shape file with commuter zones is required.");
return 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static void main(String[] args) {
@Override
public Integer call() throws Exception {

if (!MexicoCityUtils.isDefined(shp.getShapeFile())) {
if (shp.getShapeFile() == null) {
log.error("Shape file with districts for EOD2017 is required.");
return 2;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private void configureSimwrapperCfgGroup(Config config) {

if (sample.isSet()) {
double countScale = allCar ? CAR_FACTOR : 1;
sw.defaultParams().sampleSize = sample.getSample() * countScale;
sw.sampleSize = sample.getSample() * countScale;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/matsim/run/RunMexicoCityScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected Config prepareConfig(Config config) {
sw.defaultParams().shp = "./area/area.shp";

if (sample.isSet()) {
sw.defaultParams().sampleSize = sample.getSample();
sw.sampleSize = sample.getSample();
} else {
log.error("Sample size is not set. Please run the scenario including a set sample size!");
throw new NoSuchElementException();
Expand Down
13 changes: 7 additions & 6 deletions src/test/java/org/matsim/network/NetworkRoutingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import ch.sbb.matsim.config.SwissRailRaptorConfigGroup;
import ch.sbb.matsim.routing.pt.raptor.*;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.locationtech.jts.geom.Geometry;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
Expand Down Expand Up @@ -39,7 +38,9 @@
import java.nio.file.Path;
import java.util.*;

@Ignore
import static org.junit.jupiter.api.Assertions.assertFalse;

@Disabled
public class NetworkRoutingTest {

private final LeastCostPathCalculatorFactory leastCostPathCalculatorFactory = new SpeedyALTFactory();
Expand Down Expand Up @@ -99,7 +100,7 @@ public void runPtNetworkRoutingTest() {

routeOnNetwork(scenario);

coordPairs2Legs.entrySet().stream().forEach(e -> Assert.assertFalse(e.getValue().isEmpty()));
coordPairs2Legs.entrySet().stream().forEach(e -> assertFalse(e.getValue().isEmpty()));
coordPairs2Legs.clear();
}

Expand Down Expand Up @@ -130,7 +131,7 @@ public void runCarNetworkRoutingTest() {

routeOnNetwork(scenario);

coordPairs2Legs.entrySet().stream().forEach(e -> Assert.assertFalse(e.getValue().isEmpty()));
coordPairs2Legs.entrySet().stream().forEach(e -> assertFalse(e.getValue().isEmpty()));
coordPairs2Legs.clear();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.matsim.prepare.opt;

import org.junit.Test;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.matsim.run;

import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.matsim.application.MATSimApplication;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
Expand Down

0 comments on commit 000574b

Please sign in to comment.