Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] GetControlledLinks() returns null reference

Hello,
this might either be a problem with the value of 'tllogic' in your code or a bug in the C# client (which is not directly supported by the core development team).
The following python client code works fine on your networks and returns '3' for each of your defined tlLogics.

for tlID in traci.trafficlight.getIDList():
    print(tlID, len(traci.trafficlight.getControlledLinks(tlID)))

Note, that your networks are highly unusual and will not correctly model common vehicle interactions. In your network, cars will pass through each other if they happen to be on the intersection at the same time.
Instead of modelling the connections across a junction as "normal" edges, they should be modeled as "connections" that are all part of the same junction.
Also, parallel lanes of the same road should be modeled as lanes of the same edge since otherwise, lane-changing will not be possible.

regards,
Jakob


Am Mo., 4. Juli 2022 um 14:38 Uhr schrieb Akrima Huzaifa <akrimaamirka@xxxxxxxxx>:
Greetings team, 
I am trying to fetch no of states(length)/Links from a sumo(TraCI) with the help of function "GetControlledLinks()" (snippet attached below). The thing is when I do so for my "Round1" TL(network attached) it works fine(returns 3) but with the same network but different TL Logic(with the same phases and states) returns null while it should return 3 too. IDK why sumo is not returning me the values for "Round2" or any other round other than "Round1". 
PS: All linkIndexes are used in connections(i.e. 0.1,2).  

Code Snippet (Unity)C#:
        client = new TraCIClient();
        client.Connect("*.*.*.1", ***1);
...
Debug.Log("Akrima=========NoOfSignals: " + client.TrafficLight.GetControlledLinks(tllogic).Content.NumberOfSignals);
...

Network files attached 

Thank you!
--
Best Regards,
Akrima Huzaifa Akhtar

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top