Farama-Foundation / HighwayEnv

A minimalist environment for decision-making in autonomous driving
https://highway-env.farama.org/
MIT License
2.48k stars 726 forks source link

Add multiple vehicles with different action space #580

Open baimukashev opened 3 months ago

baimukashev commented 3 months ago

Hi, I wanted to add multiple vehicles with different action space to the simulator without using multi-agent setting? for example, I want to spawn multiple IDM vehicles and add another ego with cont action space?

Env seems to have one action space for all vehicles, but is there any ways to do this? self.action_type = action_factory(self, self.config["action"])

Thanks,

eleurent commented 3 months ago

Yes it is possible: the action_type is only relevant for the controlled vehicle(s) (or ego-vehicle). Other (uncontrolled) vehicles in the scenes do not follow this action type. In the environment, the make_vehicles() method should simply create some IDMVehicles and add them to the scene (which is usually the case by default), and these vehicles will follow the IDM model, while you can still set a continuous action space for the ego-vehicle..