Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Time elapsed since the last green switch

Yes. This should work.

Am Do., 11. Apr. 2019 um 14:29 Uhr schrieb Kamble Akash Ankush cs17m018 <cs17m018@xxxxxxxxxxxxxxxx>:
What if I change the duration in current program in the following way rather than setPhaseDuration():

        currTLS = traci.trafficlight.getCompleteRedYellowGreenDefinition(tlsID)
        currTLS[0].phases[phaseToChange].duration = myValue
        currTLS[0].phases[phaseToChange].minDur = myValue
        currTLS[0].phases[phaseToChange].maxDur = myValue
        traci.trafficlight.setCompleteRedYellowGreenDefinition(tlsID, currTLS[0])

Will this allow getPhaseDuration() to give out valid (and changed) duration value?

On Thu, Apr 11, 2019 at 3:37 PM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
getPhaseDuration alway returns the default duration of that phase in the current program.
- if you load another program with changed durations it will work
- if you use trafficlight.setPhaseDuration you are changing the duration only for the current cycle and so getPhaseDuration will return an invalid value for that cycle.


Am Do., 11. Apr. 2019 um 11:27 Uhr schrieb Kamble Akash Ankush cs17m018 <cs17m018@xxxxxxxxxxxxxxxx>:
Will it not work if the duration of one or more phases is changed?


On Thu, Apr 11, 2019 at 12:16 AM Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
If you did not modify the phase duration from its default, then:
previousSwitch = traci.trafficlight.getNextSwitch(tlsiD) - traci.trafficlight.getPhaseDuration(tlsID)

regards,
Jakob

Am Mi., 10. Apr. 2019 um 18:55 Uhr schrieb Kamble Akash Ankush cs17m018 <cs17m018@xxxxxxxxxxxxxxxx>:
Hi,
    Can I get the amount of time elapsed since a particular phase of tls program started? TraCI allows to get the time at which the next switch is going to happen but not previous one. How can I get that?
Thanks in advance.
_______________________________________________
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
_______________________________________________
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