예제 #1
0
    def test_best(self):
        objective = jit.TaxiSharingObjective()

        self.assertEqual(
            tuple(self.route.planned_trips)[1],
            objective.best(*self.route.planned_trips),
        )
예제 #2
0
    def test_stop(self):
        objective = jit.TaxiSharingObjective()

        self.assertEqual(
            (2.0, ),
            objective.optimization_function(self.stop),
        )
예제 #3
0
    def test_planning_trip(self):
        objective = jit.TaxiSharingObjective()

        self.assertEqual(
            (2.0, ),
            objective.optimization_function(self.planned_trip),
        )
예제 #4
0
    def test_route(self):
        objective = jit.TaxiSharingObjective()

        self.assertEqual(
            (20.0, ),
            objective.optimization_function(self.route),
        )
예제 #5
0
 def test_creation(self):
     objective = jit.TaxiSharingObjective()
     self.assertEqual("Taxi-Sharing", objective.name)