Skip to content

Commit

Permalink
Merge pull request #44 from matsim-org/addSimwrapper
Browse files Browse the repository at this point in the history
maintenance
  • Loading branch information
kainagel authored Jul 27, 2023
2 parents db205ac + 5028ea1 commit 9d5fbd7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/test/java/org/matsim/project/RunMatsimTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Population;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.events.EventsUtils;
Expand Down Expand Up @@ -60,8 +62,17 @@ public final void test() {
Population actual = PopulationUtils.createPopulation( ConfigUtils.createConfig() ) ;
PopulationUtils.readPopulation( actual, utils.getOutputDirectory() + "/output_plans.xml.gz" );

boolean result = PopulationUtils.comparePopulations( expected, actual );
Assert.assertTrue( result );
for ( Id<Person> personId : expected.getPersons().keySet()) {
double scoreReference = expected.getPersons().get(personId).getSelectedPlan().getScore();
double scoreCurrent = actual.getPersons().get(personId).getSelectedPlan().getScore();
Assert.assertEquals("Scores of person=" + personId + " are different", scoreReference, scoreCurrent, MatsimTestUtils.EPSILON);
}


// boolean result = PopulationUtils.comparePopulations( expected, actual );
// Assert.assertTrue( result );
// (There are small differences in the score. Seems that there were some floating point changes in Java 17, and the
// differ by JDK (e.g. oracle vs. ...). So not testing this any more for the time being. kai, jul'23
}
{
String expected = utils.getInputDirectory() + "/output_events.xml.gz" ;
Expand Down

0 comments on commit 9d5fbd7

Please sign in to comment.