Ejemplo n.º 1
0
 def test_dominates_earlier_departure_time(self):
     label2 = LabelTimeAndRoute(departure_time=1,
                                arrival_time_target=10,
                                movement_duration=0,
                                first_leg_is_walk=False)
     label5 = LabelTimeAndRoute(departure_time=0,
                                arrival_time_target=10,
                                movement_duration=0,
                                first_leg_is_walk=False)
     self.assertTrue(label2.dominates(label5))
     self.assertFalse(label5.dominates(label2))
Ejemplo n.º 2
0
 def test_dominates_less_movement_duration(self):
     labela = LabelTimeAndRoute(departure_time=1,
                                arrival_time_target=10,
                                movement_duration=0,
                                first_leg_is_walk=False)
     labelb = LabelTimeAndRoute(departure_time=1,
                                arrival_time_target=10,
                                movement_duration=1,
                                first_leg_is_walk=False)
     self.assertFalse(labelb.dominates(labela))
     self.assertTrue(labela.dominates(labelb))
Ejemplo n.º 3
0
 def test_does_not_dominate_same(self):
     label2 = LabelTimeAndRoute(departure_time=1,
                                arrival_time_target=10,
                                movement_duration=0,
                                first_leg_is_walk=False)
     label3 = LabelTimeAndRoute(departure_time=1,
                                arrival_time_target=10,
                                movement_duration=0,
                                first_leg_is_walk=False)
     self.assertTrue(label2.dominates(label3))
     self.assertTrue(label3.dominates(label2))
Ejemplo n.º 4
0
 def test_dominates_less_movement_duration_when_arrival_time_not_the_same(
         self):
     # a should dominate b as the travel time is shorter
     labela = LabelTimeAndRoute(departure_time=1,
                                arrival_time_target=9,
                                movement_duration=1,
                                first_leg_is_walk=False)
     labelb = LabelTimeAndRoute(departure_time=1,
                                arrival_time_target=10,
                                movement_duration=0,
                                first_leg_is_walk=False)
     self.assertFalse(labelb.dominates(labela))
     self.assertTrue(labela.dominates(labelb))