Skip to content

Commit

Permalink
add test for shift of departure times
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbischoff committed Oct 16, 2023
1 parent b9b756e commit 121cadc
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ public void testLegTimesAreSetCorrectly() {
Leg leg1 = PopulationUtils.createAndAddLeg( plan, TransportMode.walk );
leg1.setDepartureTime(8.0*3600);
leg1.setTravelTime(1800.);
act = PopulationUtils.createAndAddActivityFromCoord(plan, "work", new Coord(0, 500));
act.setMaximumDuration(8*3600);
Activity act2 = PopulationUtils.createAndAddActivityFromCoord(plan, "work", new Coord(0, 500));
act2.setMaximumDuration(8*3600);
Leg leg2 = PopulationUtils.createAndAddLeg( plan, TransportMode.walk );
leg2.setDepartureTime(16.5*3600);
leg2.setTravelTime(1800.0);
Expand All @@ -267,6 +267,12 @@ public void testLegTimesAreSetCorrectly() {
affectingDuration, new Random(2011),24*3600,false,1);
mutator.run(plan);

double firstActEndTime = act.getEndTime().seconds();
double secondActDuration = act2.getMaximumDuration().seconds();
Assert.assertEquals(firstActEndTime,leg1.getDepartureTime().seconds(), MatsimTestUtils.EPSILON);
Assert.assertEquals(firstActEndTime+secondActDuration+leg1.getTravelTime().seconds(),leg2.getDepartureTime().seconds(), MatsimTestUtils.EPSILON);



}

Expand Down

0 comments on commit 121cadc

Please sign in to comment.