Skip to main content

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

Hi Manos,

 

thank you for notifying us about the bug. It has been documented in Github and fixed immediately.

 

Best regards

Mirko

 

 

 

 

-----Original-Nachricht-----

Betreff: [sumo-user] Bug in mapDetectors.py

Datum: 2023-09-20T00:14:06+0200

Von: "manos kampitakis via sumo-user" <sumo-user@xxxxxxxxxxx>

An: "Sumo project User discussions" <sumo-user@xxxxxxxxxxx>

 

 

 

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