sumo icon indicating copy to clipboard operation
sumo copied to clipboard

While looking at the "mapTrace" function, I have a question.

Open JamesPsh opened this issue 3 years ago • 1 comments

I have a question while checking the role of the variable "gapPenalty" in the "mapTrace" function. in "tools/sumolib/route.py"

When I look at line 137 in route.py, "gapPenalty" works only once for the first time, and after that, it does not seem to work because it is greater than 0. Is "gapPenalty" valid only once for the first time?

**SUMO-version: 1.14.1

JamesPsh avatar Aug 08 '22 00:08 JamesPsh

It looks like the code is meant to be used with a constant gapPenalty value and the default of -1 causes this constant to be initialized. It does look somewhat strange since advance may vary over the course of all data points so the initialization is somewhat unpredictable.

namdre avatar Aug 09 '22 07:08 namdre

you are right the gapPenalty should be adapted every time

behrisch avatar Aug 23 '22 16:08 behrisch