def test_various_dominates(self): labela = LabelTimeBoardingsAndRoute(departure_time=1481520618, arrival_time_target=1481521300, n_boardings=1, movement_duration=681, first_leg_is_walk=True) labelb = LabelTimeBoardingsAndRoute(departure_time=1481520618, arrival_time_target=1481521215, n_boardings=1, movement_duration=597, first_leg_is_walk=True) self.assertTrue(labelb.dominates(labela)) self.assertFalse(labela.dominates(labelb))
def test_dominates_less_movement_duration(self): labela = LabelTimeBoardingsAndRoute(departure_time=1, arrival_time_target=10, movement_duration=0, n_boardings=1, first_leg_is_walk=False) labelb = LabelTimeBoardingsAndRoute(departure_time=1, arrival_time_target=10, movement_duration=1, n_boardings=1, first_leg_is_walk=False) self.assertFalse(labelb.dominates(labela)) self.assertTrue(labela.dominates(labelb))
def test_dominates_earlier_departure_time(self): label2 = LabelTimeBoardingsAndRoute(departure_time=1, arrival_time_target=10, movement_duration=0, n_boardings=1, first_leg_is_walk=False) label5 = LabelTimeBoardingsAndRoute(departure_time=0, arrival_time_target=10, movement_duration=0, n_boardings=1, first_leg_is_walk=False) self.assertTrue(label2.dominates(label5)) self.assertFalse(label5.dominates(label2))
def test_dominates_less_movement_duration_when_arrival_time_not_the_same( self): # a should dominate b as the travel time is shorter labela = LabelTimeBoardingsAndRoute(departure_time=1, arrival_time_target=9, movement_duration=1, n_boardings=1, first_leg_is_walk=False) labelb = LabelTimeBoardingsAndRoute(departure_time=1, arrival_time_target=10, movement_duration=0, n_boardings=1, first_leg_is_walk=False) self.assertFalse(labelb.dominates(labela)) self.assertTrue(labela.dominates(labelb))