diff --git a/src/test/java/org/matsim/run/RunIntegrationTest.java b/src/test/java/org/matsim/run/RunIntegrationTest.java index 3457f39..202fb75 100644 --- a/src/test/java/org/matsim/run/RunIntegrationTest.java +++ b/src/test/java/org/matsim/run/RunIntegrationTest.java @@ -2,15 +2,20 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; +import org.matsim.api.core.v01.population.Population; import org.matsim.application.MATSimApplication; +import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.events.EventsUtils; +import org.matsim.core.population.PopulationUtils; import org.matsim.simwrapper.SimWrapperConfigGroup; import org.matsim.testcases.MatsimTestUtils; import org.matsim.utils.eventsfilecomparison.ComparisonResult; +import org.matsim.utils.eventsfilecomparison.EventsFileFingerprintComparator; +import java.beans.EventHandler; import java.io.File; import static org.assertj.core.api.Assertions.assertThat; @@ -24,30 +29,55 @@ public class RunIntegrationTest { public void runScenario() { String output = utils.getOutputDirectory(); - +// Config config = ConfigUtils.loadConfig("input/v1.0/test_lausitz-v1.0-25pct.config.xml"); - config.global().setNumberOfThreads(1); - config.qsim().setNumberOfThreads(1); + config.global().setNumberOfThreads(2); + config.qsim().setNumberOfThreads(2); config.controller().setLastIteration(1); + config.routing().setRoutingRandomness(0); config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(output); ConfigUtils.addOrGetModule(config, SimWrapperConfigGroup.class).defaultDashboards = SimWrapperConfigGroup.Mode.disabled; - - +// +// MATSimApplication.execute(LausitzScenario.class, config, "run", "--1pct" ); +//////// ////// -//// -// EventsUtils.createEventsFingerprint(utils.getOutputDirectory()+"lausitz-1pct.output_events.xml.gz", -// utils.getInputDirectory()+"astarlandmark_lausitz.fp.zst"); +// EventsUtils.createEventsFingerprint(output+"lausitz-1pct.output_events.xml.gz", +// utils.getInputDirectory()+"speedy_lausitz.fp.zst"); + EventsUtils.assertEqualEventsFingerprint( - new File("test/output/org/matsim/run/RunIntegrationTest/runScenario/", "lausitz-1pct.output_events.xml.gz"), - new File(utils.getInputDirectory(), "astarlandmark_lausitz.fp.zst").toString() + new File(output, "lausitz-1pct.output_events.xml.gz"), + new File( utils.getInputDirectory(),"speedy_lausitz.fp.zst").toString() ); +// EventsManager manager = EventsUtils.createEventsManager(); +// RandomnessEventHandler testEvents = new RandomnessEventHandler(); +// manager.addHandler(testEvents); +// +// EventsUtils.readEvents(manager,new File("./output_dijkstra_thread1/", "lausitz-1pct.output_events.xml.gz").toString()); +// +// manager.finishProcessing(); +// +// testEvents.writePath("./output_dijkstra_thread1/"+"freight_7532_path.txt"); +// +// Population pop1 = PopulationUtils.readPopulation("./output_speedy_thread1_norandom/"+"lausitz-1pct.output_plans.xml.gz"); +// Population pop2 = PopulationUtils.readPopulation("./output_speedy_thread2_norandom/"+"lausitz-1pct.output_plans.xml.gz"); +// boolean result = PopulationUtils.comparePopulations(pop1,pop2); +// +// System.out.println(result); + +// var Result = EventsFileFingerprintComparator.createFingerprintHandler( +// new File("./output_speedy_thread1_norandom/", "lausitz-1pct.output_events.xml.gz").toString(), +// new File("./output_speedy_thread4_norandom/", "speedy_lausitz.fp.zst").toString()); +// +// System.out.println(Result.getComparisonMessage()); +// +// System.out.println(Result.getComparisonResult()); } } diff --git a/test/input/org/matsim/run/RunIntegrationTest/runScenario/speedy_lausitz.fp.zst b/test/input/org/matsim/run/RunIntegrationTest/runScenario/speedy_lausitz.fp.zst new file mode 100644 index 0000000..4a68085 Binary files /dev/null and b/test/input/org/matsim/run/RunIntegrationTest/runScenario/speedy_lausitz.fp.zst differ