HighwayEnv
HighwayEnv copied to clipboard
Update controller.py
implemented the IDM longitudinal controller
Hello Bernicorn,
I do not understand the purpose of this PR, since the IDM longitudinal controller is already implemented in https://github.com/eleurent/highway-env/blob/3ef36a0fb17f91769ecac9581206bd51cce41108/highway_env/vehicle/behavior.py#L12 which is a subclass of ControlledVehicle
.
First of all i´m a beginner in python and programming. That was my first try to do this^^ Still three months ago, we talked about it in issue #133 and you asked about it to make a pull request. I´ve added the feature, that the controller is deactivated during the lanechange. Thats why i made this new function. If the controller is activated during a lanechange, the controller protect the agent from an crash. If the agent will do any critical decisions, like an dangerous lanechange, he will get no penalty for it.
Right, okay. However, your proposed change results in duplicated code, which is not ideal. I think that a better solution would be to propose a new ActionType, which uses the existing IDMVehicle behavioral model for the ego-vehicle, and executes lateral actions.
I'll propose an updated version