HighwayEnv
HighwayEnv copied to clipboard
custom environment
Hello! Can I control all the background vehicles myself, for example, by using a prediction model to output the trajectories of background vehicles, while the main vehicle uses IDM?
"Can environments that are not for reinforcement learning purposes be constructed?"
Hello! Can I control all the background vehicles myself, for example, by using a prediction model to output the trajectories of background vehicles, while the main vehicle uses IDM?
It's not natively supported, but you can edit an environment and set the class of other vehicles in the scene (created in env._make_vehicles()
) as Vehicle
, and then at any time you can control them by setting their vehicle.action['acceleration']
and vehicle.action['steering']
, for vehicle in env.road.vehicles
"Can environments that are not for reinforcement learning purposes be constructed?"
Likewise, it's not really natively supported as this project is mostly intended for RL, but the code can be adapted. You can make a custom environment without any ego-vehicle (to be controlled), simply populate the scenes with other vehicles and call env.simulate()
Thank you very much for your response!