Ejemplo n.º 1
0
    def test_best(self):
        objective = jit.TaxiSharingObjective()

        self.assertEqual(
            tuple(self.route.planned_trips)[1],
            objective.best(*self.route.planned_trips),
        )
Ejemplo n.º 2
0
    def test_stop(self):
        objective = jit.TaxiSharingObjective()

        self.assertEqual(
            (2.0, ),
            objective.optimization_function(self.stop),
        )
Ejemplo n.º 3
0
    def test_planning_trip(self):
        objective = jit.TaxiSharingObjective()

        self.assertEqual(
            (2.0, ),
            objective.optimization_function(self.planned_trip),
        )
Ejemplo n.º 4
0
    def test_route(self):
        objective = jit.TaxiSharingObjective()

        self.assertEqual(
            (20.0, ),
            objective.optimization_function(self.route),
        )
Ejemplo n.º 5
0
 def test_creation(self):
     objective = jit.TaxiSharingObjective()
     self.assertEqual("Taxi-Sharing", objective.name)