You can also use --statistic-output and multiply the number of arrived
vehicles ('inserted' - 'running') with vehicleTripStatistic attribute
'routeLength' .
Am Sa., 13. Feb. 2021 um 01:37 Uhr schrieb Lokesh Das <[email protected]
>:
> Hi Abdullah,
>
> You can use the tripinfo.xml file to calculate the total distance traveled
> by all vehicles at the end of the simulation. The tripinfo file contains
> the total travel distance for every vehicle which has finished its trip.
> You just need to parse it.
>
> Thanks,
>
> On Fri, Feb 12, 2021 at 3:26 PM . Abdullah <[email protected]> wrote:
>
>> Hi,
>>
>> I am trying to calculate the total distance travelled by all vehicles in
>> a network from start to end of a simulation. Currently, I am doing the
>> following after every simulation step: get the list of all vehicle ids
>> using traci.vehicle.getIDList() and then iterate over the list and
>> call traci.vehicle.getDistance(vehid) and save this value to add up later.
>>
>> This becomes very slow as the number of vehicles increases over time. If
>> I do this once at the end of the simulation then I lose the information
>> about vehicles that have reached their destination between start and end.
>>
>> I was wondering if there is a way of finding the total distance travelled
>> once at the end of the simulation that also takes into account of all the
>> vehicles that have left the network.
>>
>> --
>> Thank you.
>> Abdullah
>> _______________________________________________
>> sumo-user mailing list
>> [email protected]
>> To unsubscribe from this list, visit
>> https://www.eclipse.org/mailman/listinfo/sumo-user
>>
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user