Thanks for the quick reply.
I would like to obtain the green or red duration of each link, not the
duration of the phases.
I use the NEMA phase program. Even though the phase is changing, the signal
light in some of the links (turning directions) is kept unchanged. For
example, if the north-through/south-through phase switches to the
north-through/north-left phase, the signal light in the north-through
direction remains green. Therefore, the green duration for the
north-through links is greater than each of the single phases.
So I am wondering if there is a way to get this kind of value via Traci.

Sincerely,
Tianjia Yang

On Fri, May 5, 2023 at 2:21 PM Jakob Erdmann <namdre.s...@gmail.com> wrote:

> trafficlight.getAllProgramLogics will return a list of programs and for
> each program you can retrieve the states and durations for all phases.
>
> Am Fr., 5. Mai 2023 um 18:11 Uhr schrieb Tianjia Yang <
> tianjiayang...@gmail.com>:
>
>> Hi there,
>>
>> I am trying to use Python to control a traffic light based on the
>> duration in seconds of each link. So I need to obtain the current green or
>> red duration for the given link via Traci.
>>
>> I know that GetPhaseDuration can return the duration for the current
>> phase. But I didn't find a way to get the current green or red duration for
>> a given link.
>>
>> Would your please help me with this? Thank you for your time.
>>
>> Sincerely,
>>
>> Tianjia Yang
>>
>> _______________________________________________
>> sumo-user mailing list
>> sumo-user@eclipse.org
>> To unsubscribe from this list, visit
>> https://www.eclipse.org/mailman/listinfo/sumo-user
>>
> _______________________________________________
> sumo-user mailing list
> sumo-user@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
sumo-user@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to