There are two approaches:
1) get the values with minimal effort using existing API
2) extend the API.

Approach 1 is easy to do in this case. However, for large scenarios it may
limit execution speed. See
https://sumo.dlr.de/wiki/TraCI/Interfacing_TraCI_from_Python#Retrieve_the_timeLoss_for_all_vehicles_currently_in_the_network

For approach 2 I would favour extending the API so it allows access to the
value exposed by the 'summary-output'. As shown in the above link it is
easy to compute the running total from these values. The easiest solution
here would be to extend the functionality of function getParameter in
src/libsumo/Simulation.cpp. You could register key
'summary.meanSpeedRelative' to return the value that would be written by
the summary output (MSNet.cpp:744)

regards,
Jakob

Am Mo., 25. Feb. 2019 um 06:28 Uhr schrieb 周大兵 <[email protected]>:

> Hi Jakob:
> Thank you for the quick answer.
> To make the question clear, how should I do if I want to get the instant
> total waiting and loss time, which are shown in the SUMO-GUI game mode, in
> every simulation step via TraCI.
> Thank you in advance for your answer.
>
> Samuel Chou
>
>
>
>
>
> At 2019-02-24 21:52:04, "Jakob Erdmann" <[email protected]> wrote:
>
> Hello,
> the traci documentation is here: https://sumo.dlr.de/wiki/TraCI
> the source code is at src/traci-server
> I recommend that you describe the ways in which you would like to extend
> TraCI because there may be non-obvious ways of achieving these aims with
> the existing API that are easier that rewriting the SUMO code.
>
> regards,
> Jakob
>
> Am So., 24. Feb. 2019 um 08:53 Uhr schrieb 周大兵 <[email protected]>:
>
>> Hello,everyone:
>> I have built the connection between Traci and SUMO, however the
>> interfaces provided by Traci can not meet all my needs, in which case I
>> have to customize the  C++ source code.
>> Are there any documents about Sumo Source code  or how the traci
>> interfaces work , the more detailed, the better?
>> Thank you very much.
>>
>>
>>
>> _______________________________________________
>> sumo-dev mailing list
>> [email protected]
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
>> https://www.eclipse.org/mailman/listinfo/sumo-dev
>>
>
>
>
> _______________________________________________
> sumo-dev mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-dev
>
_______________________________________________
sumo-dev mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-dev

Reply via email to