Skip to main content

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


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,


Back to the top