Skip to content

Commit

Permalink
Merge pull request #595 from Farama-Foundation/bugfix-593
Browse files Browse the repository at this point in the history
Fix starting position of vehicles in parking env
  • Loading branch information
eleurent committed Apr 27, 2024
2 parents c7ee099 + 731f877 commit af23919
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion highway_env/envs/parking_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ def _create_vehicles(self) -> None:
# Controlled vehicles
self.controlled_vehicles = []
for i in range(self.config["controlled_vehicles"]):
x0 = (i - self.config["controlled_vehicles"] // 2) * 10
vehicle = self.action_type.vehicle_class(
self.road, [i * 20, 0], 2 * np.pi * self.np_random.uniform(), 0
self.road, [x0, 0], 2 * np.pi * self.np_random.uniform(), 0
)
vehicle.color = VehicleGraphics.EGO_COLOR
self.road.vehicles.append(vehicle)
Expand Down

0 comments on commit af23919

Please sign in to comment.