コード例 #1
0
    def setUp(self) -> None:
        self.vehicle = generate_one_vehicle()
        self.position = generate_one_position()
        stop0 = jit.Stop(self.vehicle, self.position, None)

        stop1 = jit.Stop(self.vehicle, generate_one_position(), stop0)
        stop0.following = stop1

        stop2 = jit.Stop(self.vehicle, generate_one_position(), stop1)
        stop1.following = stop2

        stop3 = jit.Stop(self.vehicle, generate_one_position(), stop2)
        stop2.following = stop3

        stop4 = jit.Stop(self.vehicle, generate_one_position(), stop3)
        stop3.following = stop4

        stops = [stop0, stop1, stop2, stop3, stop4]
        self.stops = stops

        self.route = jit.Route(self.vehicle, self.stops)
        self.planning = jit.Planning({self.route})

        self.job = jit.Job(generate_trips(10), objective_cls=jit.DialARideObjective)
        self.fleet = jit.Fleet(generate_vehicles(10))
        self.algorithm = jit.NaiveAlgorithm(self.fleet, self.job)
        self.result = jit.Result(self.algorithm, self.planning, computation_time=float(0.0))
コード例 #2
0
ファイル: test_routes.py プロジェクト: PhilippeGalvan/jinete
 def test_route(self):
     vehicle = generate_one_vehicle()
     route = jit.Route(vehicle)
     self.assertIsInstance(route.identifier, str)
     self.assertEqual(list(), list(route.planned_trips))
     self.assertEqual(vehicle, route.vehicle)
コード例 #3
0
ファイル: test_stops.py プロジェクト: PhilippeGalvan/jinete
 def setUpClass(cls) -> None:
     cls.vehicle = generate_one_vehicle()
     cls.position = generate_one_position()