Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Bug in mapDetectors.py

Hi all,

It seems that there is a bug in mapDetectors.py in line 99: lanes.sort(). sort() function sorts tuples by default, using the first item in each tuple, but if two distances d for example (first item here) are the same then the second element is the next sorting criteria and so on. The second element is a Lane object thus python throws an error:
TypeError: '<' not supported between instances of 'Lane' and 'Lane'
I put instead: lanes = sorted(lanes, key = lambda x: x[0]) and works fine.

Best regards,
Manos

Back to the top