Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Traci trafficlight setLinkState error

thank you for reporting!
This has now been fixed (development version [26189])

2017-09-22 13:13 GMT+02:00 Do Duc Le <doducle91@xxxxxxxxx>:

I tried to set the state of one linkIndex with traci.trafficlights.setLinkState(tlsID,6,"G"), but I get error message

"File "/home/doducle/sumo-0.31.0/tools/traci/", line 202, in setLinkState
    raise TraCIException("Invalid tlsLinkIndex %s for tls '%s' with maximum index %s." % (
NameError: global name 'TraCIException' is not defined"

There are 12 Linkindices in my trafficlight tlsID, so that should not be a problem. I had a quick look at the code of the function setLinkState in the file /sumo-0.32.0/tools/traci/ Could there be a mistake in

"fullState = list(self.getRedYellowGreenState(tlsID))
 if tlsLinkIndex >= len(state):

 ..." ?

I think you have to compare the LinkIndex with the length of fullstate and not state, correct me if I'm wrong.

Best regards,


sumo-user mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top