Skip to content

Commit

Permalink
Merge pull request #2827 from matsim-org/2817-default-SpeedyALT
Browse files Browse the repository at this point in the history
Change default network routing algorithm to `SpeedyALT`
  • Loading branch information
mrieser authored Oct 10, 2023
2 parents e89c773 + d454c16 commit b814f36
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void testA() {
PSimConfigGroup pSimConfigGroup = new PSimConfigGroup();
config.addModule(pSimConfigGroup);
pSimConfigGroup.setIterationsPerCycle(20);

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

//identify selector strategies
Expand Down Expand Up @@ -95,12 +95,12 @@ public void testA() {

((Controler) runPSim.getMatsimControler()).addOverridingModule(new AbstractModule() {
@Override
public void install() {
public void install() {
this.bind(TransitEmulator.class).to(NoTransitEmulator.class);
}
});


runPSim.run();
double psimScore = execScoreTracker.executedScore;
logger.info("RunPSim score was " + psimScore);
Expand All @@ -109,15 +109,15 @@ public void install() {
Population popActual = PopulationUtils.createPopulation( config );
PopulationUtils.readPopulation( popActual, outDir + "/output_plans.xml.gz" );
new PopulationComparison().compare( popExpected, popActual ) ;
Assert.assertEquals("RunPsim score changed.", 138.90472630897597d, psimScore, MatsimTestUtils.EPSILON);
Assert.assertEquals("RunPsim score changed.", 138.90474624352407, psimScore, MatsimTestUtils.EPSILON);
// Assert.assertEquals("RunPsim score changed.", 134.54001491094124d, psimScore, MatsimTestUtils.EPSILON);
// Assert.assertEquals("RunPsim score changed.", 134.52369453719413d, psimScore, MatsimTestUtils.EPSILON);
// Assert.assertEquals("RunPsim score changed.", 132.73129073101293d, psimScore, MatsimTestUtils.EPSILON);
}

/**
* For comparison run 2 normal qsim iterations. Psim score should be slightly higher than default Controler score.
*
*
* Prior to implementing routing mode RunPSimTest tested only that psimScore outperformed default Controler on this
* test for executed score by a margin > 1%. In the last commit in matsim master where the test ran, the psim score
* in testA() was 134.52369453719413 and qsim score in testB was 131.84309487251033).
Expand All @@ -134,7 +134,7 @@ public void testB() {
ExecScoreTracker execScoreTracker = new ExecScoreTracker(controler);
controler.addControlerListener(execScoreTracker);
controler.run();

double qsimScore = execScoreTracker.executedScore;
logger.info("Default controler score was " + qsimScore );
// Assert.assertEquals("Default controler score changed.", 131.84309487251033d, qsimScore, MatsimTestUtils.EPSILON);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public enum MobsimType {qsim, JDEQSim, hermes}
private String outputDirectory = "./output";
private int firstIteration = 0;
private int lastIteration = 1000;
private RoutingAlgorithmType routingAlgorithmType = RoutingAlgorithmType.AStarLandmarks;
private RoutingAlgorithmType routingAlgorithmType = RoutingAlgorithmType.SpeedyALT;
private EventTypeToCreateScoringFunctions eventTypeToCreateScoringFunctions = EventTypeToCreateScoringFunctions.IterationStarts;

private boolean linkToLinkRoutingEnabled = false;
Expand Down

0 comments on commit b814f36

Please sign in to comment.