Skip to content

Commit

Permalink
added runPoint1pctParkingIntegrationTest and correct event files to i…
Browse files Browse the repository at this point in the history
…nput
  • Loading branch information
zlukich committed Jan 29, 2024
1 parent f92ed80 commit 497365d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/test/java/org/matsim/run/RunLeipzigIntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.nio.file.Path;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class RunLeipzigIntegrationTest {
Expand Down Expand Up @@ -62,24 +63,36 @@ public final void runPoint1pctIntegrationTest() {

@Test
public final void runPoint1pctParkingIntegrationTest() {
Path output = Path.of("output-parking-test/it-1pct");
String output = utils.getOutputDirectory();

Config config = ConfigUtils.loadConfig("input/v1.3/leipzig-v1.3-10pct.config.xml");
config.global().setNumberOfThreads(1);
config.qsim().setNumberOfThreads(1);
config.controler().setLastIteration(0);
config.controler().setLastIteration(1);
config.controler().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists);
config.controler().setOutputDirectory(output.toString());
config.controler().setOutputDirectory(utils.getOutputDirectory());
ConfigUtils.addOrGetModule(config, SimWrapperConfigGroup.class).defaultDashboards = SimWrapperConfigGroup.Mode.disabled;
config.plans().setInputFile(URL + "leipzig-v1.2-0.1pct.plans-initial.xml.gz");

MATSimApplication.execute(RunLeipzigScenario.class, config, "run", "--1pct", "--drt-area", exampleShp, "--post-processing", "disabled",
"--parking-cost-area", "input/v" + RunLeipzigScenario.VERSION + "/parkingCostArea/Bewohnerparken_2020.shp",
"--parking", "--intermodality", "drtAsAccessEgressForPt");

assertThat(output)
assertThat(Path.of(output))
.exists()
.isNotEmptyDirectory();
new ParkingLocation().execute("--directory", output.toString());

assertThat(EventsUtils.compareEventsFiles(
new File(utils.getOutputDirectory(), "leipzig-1pct.output_events.xml.gz").toString(),
new File(utils.getClassInputDirectory(), "runPoint1pctParkingIntegrationTest_events.xml.zst").toString()
)).isEqualTo(EventsFileComparator.Result.FILES_ARE_EQUAL);


Network network = NetworkUtils.readNetwork(utils.getOutputDirectory() + "/" + config.controler().getRunId() + ".output_network.xml.gz");
assertTrue(network.getLinks().get(Id.createLinkId("24232899")).getFreespeed() < 12.501000000000001);
assertTrue(network.getLinks().get(Id.createLinkId("24675139")).getFreespeed() < 7.497);

new ParkingLocation().execute("--directory", output);
}

@Test
Expand Down
Binary file not shown.

0 comments on commit 497365d

Please sign in to comment.