Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Optimizing traci.edge.subscribeContext for Vehicle Data Retrieval

Thank you for the example. This was a bug (now fixed): https://github.com/eclipse-sumo/sumo/issues/16422

Am Fr., 28. März 2025 um 15:01 Uhr schrieb Karagounis Vassileios <vkaragounis@xxxxxxxx>:

Hi Jacob,

Thank you for your clear response.

I have attached a simple test that demonstrates that not all cars are being measured correctly

when using 1 meter in "subscribeContext."

Could you please take a look and let me know your thoughts?


Με φιλικούς χαιρετισμούς / Kind Regards


Vasilios Karagounis
Software Engineer
Center for Research and Technology Hellas (CERTH)
Hellenic Institute of Transport (HIT)

CONFIDENTIALITY NOTICE: The information in this  email and any attachments thereto are confidential, except where the  e-mail specifically states that its contents can be disclosed, and is  intended solely for the use of its intended recipient(s). It may also be  subject to legal privilege or otherwise protected from disclosure. If  you are not the intended recipient of this communication, you are hereby  notified that any disclosure, copying, distribution, or use of the  information contained in or attached to this e-mail is strictly  prohibited. Please refrain from disclosing its contents to any third  party, but notify the sender immediately and make sure to delete and  permanently destroy the e-mail (including any attachments thereto) from  your filing systems. Internet communications are not secure and  therefore sender/CERTH does not accept any liability for the contents of  this message and for any damage whatsoever that may be caused by  viruses.


From: Jakob Erdmann <namdre.sumo@xxxxxxxxx>
Sent: 28 March 2025 11:00:39
To: Karagounis Vassileios; Sumo project User discussions
Subject: Re: [sumo-user] Optimizing traci.edge.subscribeContext for Vehicle Data Retrieval
 
In my own tests the subscription works with 1m for straight and curved edges with with one and also with multiple lanes. If you can provide a minimal example where it doesn't work I'll take a look.
If you want to receive the results with a single call then this would be the most efficient way.

However, if you're worried about traci speed then you could switch to libsumo and simply do more calls without any of the communication overhead.
i.e. traci.edge. getLastStepVehicleIDs followed by vehicle.getSpeed for each returned id.

regards,
Jakob

Am Do., 27. März 2025 um 14:05 Uhr schrieb Karagounis Vassileios <vkaragounis@xxxxxxxx>:

Dear Jacob,

thank you for your response. I tried your suggestion be lowering the distance  to 1 meter but

that seems not to work as if i had, for instance 10 meters. Not all vehicles recorded by "subscribeContext".

The frequency that i am calling this function is every second. 

Is this the most efficient way?


Με φιλικούς χαιρετισμούς / Kind Regards

Vasilios Karagounis
Software Engineer
Center for Research and Technology Hellas (CERTH)
Hellenic Institute of Transport (HIT)

CONFIDENTIALITY NOTICE: The information in this  email and any attachments thereto are confidential, except where the  e-mail specifically states that its contents can be disclosed, and is  intended solely for the use of its intended recipient(s). It may also be  subject to legal privilege or otherwise protected from disclosure. If  you are not the intended recipient of this communication, you are hereby  notified that any disclosure, copying, distribution, or use of the  information contained in or attached to this e-mail is strictly  prohibited. Please refrain from disclosing its contents to any third  party, but notify the sender immediately and make sure to delete and  permanently destroy the e-mail (including any attachments thereto) from  your filing systems. Internet communications are not secure and  therefore sender/CERTH does not accept any liability for the contents of  this message and for any damage whatsoever that may be caused by  viruses.


From: sumo-user <sumo-user-bounces@xxxxxxxxxxx> on behalf of Jakob Erdmann via sumo-user <sumo-user@xxxxxxxxxxx>
Sent: 27 March 2025 14:17:21
To: Sumo project User discussions
Cc: Jakob Erdmann
Subject: Re: [sumo-user] Optimizing traci.edge.subscribeContext for Vehicle Data Retrieval
 
The whole shape of the edge is used so you should be able to reduce the context radius to a very low value (i.e. 1m)

Am Do., 27. März 2025 um 12:39 Uhr schrieb Karagounis Vassileios via sumo-user <sumo-user@xxxxxxxxxxx>:


Dear SUMO Community,

I am using the following 'TraCI' command to obtain all vehicles moving on a specific edge while
retrieving their speed and lane ID. As the lane length, I use half of the edge length:

traci.edge.subscribeContext(edgeID,
                             traci.constants.CMD_GET_VEHICLE_VARIABLE,
                             length,
                             [traci.constants.VAR_SPEED, traci.constants.VAR_LANE_ID])

However, I have noticed that some vehicles in my results are actually on different edges. I suspect this is because the distance parameter works as a circular range rather than strictly along the edge.

I have two main questions:

A. Is there a more efficient 'TraCI' call to obtain vehicle data for a specific edge?
B. What would be an optimal value for the distance parameter to improve performance while ensuring only vehicles on the target edge are included?

I appreciate any insights or recommendations.

Με φιλικούς χαιρετισμούς / Kind Regards

Vasilios Karagounis
Software Engineer
Center for Research and Technology Hellas (CERTH)
Hellenic Institute of Transport (HIT)

CONFIDENTIALITY NOTICE: The information in this  email and any attachments thereto are confidential, except where the  e-mail specifically states that its contents can be disclosed, and is  intended solely for the use of its intended recipient(s). It may also be  subject to legal privilege or otherwise protected from disclosure. If  you are not the intended recipient of this communication, you are hereby  notified that any disclosure, copying, distribution, or use of the  information contained in or attached to this e-mail is strictly  prohibited. Please refrain from disclosing its contents to any third  party, but notify the sender immediately and make sure to delete and  permanently destroy the e-mail (including any attachments thereto) from  your filing systems. Internet communications are not secure and  therefore sender/CERTH does not accept any liability for the contents of  this message and for any damage whatsoever that may be caused by  viruses.

_______________________________________________
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