Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Edge or Lane association to Phase

I came out with another approach,

Change the phases of the TL's get current state, and iterate to check the state and the lane.

Best regards,
José

On Wed, 13 Mar 2019 at 10:33, Jose Monreal Bailey <jmonreal@xxxxxxxxx> wrote:
Hi Jakob,

Thank you for the helpful information.
What do you mean by point 1 when you say: find link indices for connections? which are these in the controlledLinks.

As controlledLinks returns an ArrayList with attributes from and to.
This is the complex part, as I don't know if the order of the structure will be the same, what happens in an intersection with 3 edges.

Best regards,
José






On Wed, 13 Mar 2019 at 10:25, Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:
Possibly, there is a misunderstanding.
In SUMO, the phase index maps to the time axis whereas the link index maps to location.

If you want to find out the green phase(s)s for a given lane you have perform the following steps:
1) find link indices for connections from the given lane using getControlledLInks
2) iterate over the phases of the current program and check whether the n'th entry in the state is 'G' or 'g' (where n is an index from above). This marks a phase where that lane has green.

It may help to revisit this part of the documentation:  https://sumo.dlr.de/wiki/Simulation/Traffic_Lights#.3Cphase.3E_Attributes

Am Mi., 13. März 2019 um 11:12 Uhr schrieb Jose Monreal Bailey <jmonreal@xxxxxxxxx>:
>From getControlledLinks I get the links ordered from the bottom and anti-clockwise.
And then if I want to map it to the complete definition to map to the phases, it's much more complex, as its not the same order and direction. 

Is it possible to get the controlled Links, or Lanes with it corresponding TLS Phase program index?

Best regards,
José

On Tue, 12 Mar 2019 at 16:49, Jakob Erdmann <namdre.sumo@xxxxxxxxx> wrote:

Am Di., 12. März 2019 um 13:14 Uhr schrieb Jose Monreal Bailey <jmonreal@xxxxxxxxx>:
Hey everyone,

I am trying to build a hashmap association of edges to the correspondent green phase.

I can get the program definition form the traffic lights, but what is the best way to get the edges from the program, or from the phase if possible?

Best regards,
Jose
_______________________________________________
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