Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] detecor attributes in output file

Hi Hao,

Thanks a lot for your help. I’ve tried getVehicleData(), but I get the same result as laststepMeanSpeed and laststepVehiclNumber, and this result is different from the output file.
As for the occupancy, it’s used to calculate the variable speed limit of the section upstream. I need to use the mean speed and occupancy to determine the speed limit of the detector upstream. 

Best,
Wenxuan
  


On 02/15/2020 10:20Hao Zhou<zhouhaoseu@xxxxxxxxxx> wrote:
Hi Wenxuan, 

I have the same question about the laststepMeanSpeed or getLastStepVehicleNumber, I'm afraid it might lead to some bias when we have small simulation time steps or very high speed.

Have you tried getVehicleData() and use the returned dictionary to count unique vehicles? 
It seems to be an old problem https://www.eclipse.org/lists/sumo-user/msg01632.htmlI saw Jakob was suggesting the getVehicleData() function. It is more clear to users. I also tried getLastStepVehicleIDs before, but not the meanSpeed function. 

By the way, may I ask why you are computing the occupancy? If you want the passing flow rate, or simply estimating the mean speed of passing vehicles, maybe we have better options.  

Best,
Hao

On February 14, 2020 at 7:05 PM, wangwenxuan <wangwenxuan@xxxxxxxxxxxxx> wrote:


Thank you both for your explanation.  I’ve tried the way by Hao. However, the mean speed of detector in every 30s is different from the speed value in output file. I can't figure it out. Could you please check the attachment ? 
Best Regards,
Wenxuan Wang

On 02/12/2020 01:46Jakob Erdmann<namdre.sumo@xxxxxxxxx> wrote:
Currently, there is no way to access aggregated output values via TraCI so you either have to aggregate them manually at runtime (as explained by Hao) or read them from the output file.
You can connect the output file directly to your program by using a socket address instead of a file path. In this case you would receive the aggregated values at each interval end. See https://sumo.dlr.de/docs/Basics/Using_the_Command_Line_Applications.html#writing_files

regards,
Jakob

Am Mi., 12. Feb. 2020 um 00:34 Uhr schrieb Hao Zhou <zhouhaoseu@xxxxxxxxxx>:
That’s a great question. I did some search before and end up using a workaround which manually computes those values by using traci’s value retrieval for induction loops. The idea is to retrieve the ID of vehicles on those loop sectors at last time step and current step. This is a bit cumbersome. I hope some smart guys can light us up. 

Best,
Hao

On Feb 11, 2020, at 5:42 PM, wangwenxuan <wangwenxuan@xxxxxxxxxxxxx> wrote:




Hello, 
I want to acquire some attributes in output file of detector, such as the speed or the occupancy during the interval period. Should I get these attributes by reading the output file? Is  there any other way? It seems that I can’t acquire them by TraCI.
Thank you very much!

Best Regards!
Wenxuan Wang

_______________________________________________
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
_______________________________________________
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
_______________________________________________
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