Ejemplo n.º 1
0
 def test_realistic_road(self):
     # Test Case 2 (more realistic road)
     road = build_road(14, [80, 60, 40, 20])
     lane_change_cost = 1.0 / 100.0
     init = [len(road) - 1, 0]
     goal = [len(road) - 1, len(road[0]) - 1]
     cost = 0.293333333333
     
     self.assertAlmostEqual(cost, plan(road=road, 
                                       lane_change_cost=lane_change_cost,
                                       goal=goal,
                                       init=init), 10)
Ejemplo n.º 2
0
 def test_fast_left_lane(self):
     # Test Case 1 (FAST left lane)
     road = build_road(8, [100, 10, 1])
     lane_change_cost = 1.0 / 1000.0
     init = [len(road) - 1, 0]
     goal = [len(road) - 1, len(road[0]) - 1]
     cost = 1.244
     
     self.assertAlmostEqual(cost, plan(road=road, 
                                       lane_change_cost=lane_change_cost,
                                       goal=goal,
                                       init=init), 3)
Ejemplo n.º 3
0
    def test_realistic_road(self):
        # Test Case 2 (more realistic road)
        road = build_road(14, [80, 60, 40, 20])
        lane_change_cost = 1.0 / 100.0
        init = [len(road) - 1, 0]
        goal = [len(road) - 1, len(road[0]) - 1]
        cost = 0.293333333333

        self.assertAlmostEqual(
            cost,
            plan(road=road,
                 lane_change_cost=lane_change_cost,
                 goal=goal,
                 init=init), 10)
Ejemplo n.º 4
0
    def test_fast_left_lane(self):
        # Test Case 1 (FAST left lane)
        road = build_road(8, [100, 10, 1])
        lane_change_cost = 1.0 / 1000.0
        init = [len(road) - 1, 0]
        goal = [len(road) - 1, len(road[0]) - 1]
        cost = 1.244

        self.assertAlmostEqual(
            cost,
            plan(road=road,
                 lane_change_cost=lane_change_cost,
                 goal=goal,
                 init=init), 3)