Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Does the command "traci.vehicle.getContextSubscriptionResults()" always lose some vehicles?

Please check the result returned by subscribeContext against the list of vehicles returned by traci.vehicle.getIDList.
There may also be a mismatch due to 'teleporting' vehicles. They are still listed as 'active' in the vehicle counter but are not on any lane and thus not returned by the subscription.
You can track telepoorts by computing a running sum of the values returned by
traci.simulation.getStartingTeleportNumber and traci.simulation.getEndingTeleportNumber

regards,
Jakob


Am Di., 18. Juni 2019 um 05:36 Uhr schrieb Chason <chenxiang_chason@xxxxxxxx>:
Hello:

I tried to get all vehicles' information in my simulation through "traci.vehicle.getContextSubscriptionResults()" command, but things didn't go well.

When the traffic number is large, the subscription command always returns fewer vehicles than the actual number running in sumo-gui.

My codes like that:
"
traci.vehicle.subscribeContext('ego', traci.constants.CMD_GET_VEHICLE_VARIABLE, 900000, [traci.constants.VAR_POSITION], 0, 2147483647)

...

sumo_vehicles = traci.vehicle.getContextSubscriptionResults('ego')
"

I also tried "traci.junction.getContextSubscriptionResults()", but the result is same.

Please help me to solve this problem.

Many thanks.
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top