Skip to content

Update controller.py#185

Open
Bernicorn wants to merge 1 commit intoFarama-Foundation:masterfrom
Bernicorn:patch-1
Open

Update controller.py#185
Bernicorn wants to merge 1 commit intoFarama-Foundation:masterfrom
Bernicorn:patch-1

Conversation

@Bernicorn
Copy link
Copy Markdown

implemented the IDM longitudinal controller

@eleurent
Copy link
Copy Markdown
Collaborator

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.

@Bernicorn
Copy link
Copy Markdown
Author

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.

@eleurent
Copy link
Copy Markdown
Collaborator

eleurent commented Apr 29, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants