Skip to content

Refactored function AdaptToJunctionLeader#11583

Open
Domsall wants to merge 2 commits intoeclipse-sumo:mainfrom
Domsall:AdapJuncLead
Open

Refactored function AdaptToJunctionLeader#11583
Domsall wants to merge 2 commits intoeclipse-sumo:mainfrom
Domsall:AdapJuncLead

Conversation

@Domsall
Copy link
Contributor

@Domsall Domsall commented Sep 13, 2022

this should not change any model except EIDM (one EIDM test changed as expected)

Signed-off-by: Dominik Salles <dominik.salles@fkfs.de>
Signed-off-by: Dominik Salles <dominik.salles@fkfs.de>
@namdre
Copy link
Contributor

namdre commented Sep 13, 2022

As far as I understood, the goal of this PR is to eliminate the line vsafeLeader = MAX2(vsafeLeader, vStop); since this confuses EIDM. Why then is it ok for the line vsafeLeader = MAX2(vsafeLeader, MIN2(v2, vStop)); to remain ?

@Domsall
Copy link
Contributor Author

Domsall commented Sep 13, 2022

That is exact the line I had the most problems with...
The workaround was to add CURRENT_WAIT to the stopSpeed-calls. The EIDM will then check in finalizeSpeed, if the stopSpeed-calls were the reason for the next speed update. The EIDM still does not know anything about v2, which could theoretically cause some weird behavior. Nevertheless, I could not find any cases, where this was a problem (yet).

In all other cases, the changes work as expected for the EIDM (with CURRENT as input for stopSpeed).

@namdre
Copy link
Contributor

namdre commented Sep 14, 2022

Frankly, I find the current code in that function hard to read and this PR isn't helping (by adding some redundancy). I'll try to think of ways to refactor the original to both improve readability and get rid of the MAX calls.

@Domsall
Copy link
Contributor Author

Domsall commented Sep 14, 2022

Yes, I had a hard time understanding/changing it all, too. But it works great by comparing, if the vehicle's following speed is sufficient or if the vehicle needs to stop at the junction.

Thanks in advance!

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