Hello,
you need to put together these things:
1) the incoming and outgoing lanes to a traffic light (this defines a 
connection)
2) the id of the traffic light and the link index that controlls the above
connection
3) vehicles that passed the incoming lane in the last time step
4) the state of the traffic light

You can get 1) and 2) by iterating over all traffic lights using
traci.trafficlights.getIDList()
traci.trafficlights.getControlledLinks()
You can get 4) by using traci.trafficlights.getRedYellowGreenState()
3) is a bit more difficult, since the vehicles may pass multiple lanes in one
time step. If the incoming lane is long enough (in relation to vehicle speed)
you can just use traci.lane.getLastStepVehicleIDs().
Otherwise you will have to add an induction loop and use
traci.inductionloop.getLastStepVehicleIDs()


regards,
Jakob

PS: Also see http://sumo.dlr.de/trac.wsgi/ticket/1760. If this was implemented,
it could also be used for your purpose. (We happily accept patches)


On 09/03/2015 04:36 AM, atoo a.a. (aaa1n13) wrote:
> Hello Everyone,
>
>
> Please how can i know the position or coordinate of traffic light position by 
> the stop line side.
>
> My aim is to know when a vehicle runs red light.
>
> Though if there is some other way out, i will be glad for your help.
>
>
> Thanks
>
> Aondoseer
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> sumo-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sumo-user


------------------------------------------------------------------------------
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

Reply via email to