Skip to content

Commit

Permalink
Merge pull request #3 from jakobrehmann/master
Browse files Browse the repository at this point in the history
switch to matsim 2024.0
  • Loading branch information
jakobrehmann authored Jun 13, 2024
2 parents 8fc48d2 + bd421c8 commit 9bcfd62
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 21
- name: Build with Maven
run: mvn -B package --file pom.xml
29 changes: 18 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<properties>
<!-- release -->
<matsim.version>14.0</matsim.version>
<matsim.version>2024.0</matsim.version>

<!-- PR-labelled release -->
<!--<matsim.version>14.0-PR1452</matsim.version>-->
Expand All @@ -21,8 +21,8 @@

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>

</properties>

Expand Down Expand Up @@ -71,14 +71,6 @@
<version>${matsim.version}</version>
</dependency>

<dependency>
<!-- Include the JUnit testing library. Not transitive. -->
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>

<dependency>
<!--MATSim test infrastructure. Not transitive.-->
<groupId>org.matsim</groupId>
Expand Down Expand Up @@ -108,6 +100,21 @@
<artifactId>osm</artifactId>
<version>${matsim.version}</version>
</dependency>
<!-- JUnit Jupiter Engine to run tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.2</version>
<scope>test</scope>
</dependency>

<!-- JUnit Platform Launcher to launch the JUnit Platform -->
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.9.0</version>
<scope>test</scope>
</dependency>

</dependencies>

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/org/matsim/prepare/CreatePopulation.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

package org.matsim.prepare;

import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.geotools.data.simple.SimpleFeatureIterator;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.Point;
Expand Down Expand Up @@ -47,7 +48,7 @@
*/
public class CreatePopulation {

private static final Logger log = Logger.getLogger(CreatePopulation.class);
private static final Logger log = LogManager.getLogger(CreatePopulation.class);

private int personCounter = 0;
private final Map<String, SimpleFeature> features = new HashMap<>();
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/org/matsim/run/RunSerengetiParkScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
import java.util.HashSet;
import java.util.Set;

import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigGroup;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.groups.PlansCalcRouteConfigGroup;
import org.matsim.core.config.groups.RoutingConfigGroup;
import org.matsim.core.controler.Controler;
import org.matsim.core.controler.OutputDirectoryLogging;
import org.matsim.core.gbl.Gbl;
Expand All @@ -47,7 +48,7 @@

public final class RunSerengetiParkScenario {

private static final Logger log = Logger.getLogger(RunSerengetiParkScenario.class );
private static final Logger log = LogManager.getLogger(RunSerengetiParkScenario.class );


// Demand
Expand Down Expand Up @@ -209,9 +210,9 @@ public static Config prepareConfig( String [] args, ConfigGroup... customModules

// config.controler().setRoutingAlgorithmType( FastAStarLandmarks );

config.plansCalcRoute().setRoutingRandomness( 0. );
config.routing().setRoutingRandomness( 0. );

config.plansCalcRoute().setAccessEgressType(PlansCalcRouteConfigGroup.AccessEgressType.accessEgressModeToLink);
config.routing().setAccessEgressType(RoutingConfigGroup.AccessEgressType.accessEgressModeToLink);
config.qsim().setUsingTravelTimeCheckInTeleportation( true );

ConfigUtils.applyCommandline( config, typedArgs ) ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@
* *********************************************************************** */
package org.matsim.project;

import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.apache.logging.log4j.LogManager;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.matsim.api.core.v01.Scenario;
import org.matsim.core.config.Config;
import org.matsim.core.controler.Controler;
import org.matsim.run.RunSerengetiParkScenario;
import org.matsim.testcases.MatsimTestUtils;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.fail;

/**
* @author ikaddoura
*
*/
public class RunSerengetiParkScenarioTest {

@Rule public MatsimTestUtils utils = new MatsimTestUtils() ;
@RegisterExtension
public MatsimTestUtils utils = new MatsimTestUtils() ;

@Test
public final void test() {
Expand All @@ -51,10 +53,10 @@ public final void test() {
controler.run();

} catch ( Exception ee ) {
Logger.getLogger(this.getClass()).fatal("there was an exception: \n" + ee ) ;
LogManager.getLogger(this.getClass()).fatal("there was an exception: \n" + ee ) ;

// if one catches an exception, then one needs to explicitly fail the test:
Assert.fail();
fail();
}


Expand Down

0 comments on commit 9bcfd62

Please sign in to comment.