HighwayEnv icon indicating copy to clipboard operation
HighwayEnv copied to clipboard

Update controller.py

Open Bernicorn opened this issue 3 years ago • 3 comments

implemented the IDM longitudinal controller

Bernicorn avatar Apr 26 '21 09:04 Bernicorn

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.

eleurent avatar Apr 27 '21 09:04 eleurent

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.

Bernicorn avatar Apr 27 '21 11:04 Bernicorn

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

eleurent avatar Apr 29 '21 09:04 eleurent