Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default network routing algorithm to SpeedyALT #2827

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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