Hi Jakob,

Thank you for replying. In terms of E2-Detector, are you suggesting that I
put a 20m-long E2-detector on the lane to measure the number of vehicles,
or several E2-detectors connected to cover the 20m distance?

Or are you saying putting one normal E2-detector to monitor the flow, but
not the number of vehicles in a 20m-long area directly?

Thanks,
Shuyi

On Thu, Jul 26, 2018 at 12:50 AM Jakob Erdmann <[email protected]>
wrote:

> In my own control scripts I often use explicit list of lanes but you could
> also use
> E2-Detectors generated in advance
> http://sumo.dlr.de/wiki/Tools/Output#generateTLSE2Detectors.py
>
>
> 2018-07-26 9:14 GMT+02:00 Harald Schaefer <[email protected]>:
>
>> Hi Shuyi,
>>
>> there are different approaches to control traffic lights depending on the
>> traffic.
>> One is to look for gaps in the incoming traffic flow (see
>> http://sumo.dlr.de/wiki/Simulation/Traffic_Lights#Improving_Generated_programs_with_knowledge_about_traffic_demand
>> and
>> http://sumo.dlr.de/wiki/Simulation/Traffic_Lights#Actuated_Traffic_Lights
>> )
>> For your approach see also the discussion recently here about "Locating
>> cars around certain coordinates"
>>
>> Best regards, Harald
>>
>>
>> Am 25.07.2018 um 23:43 schrieb Shuyi Yin:
>>
>> Hi SUMO community,
>>
>> I'm using TraCI to control traffic lights and would like the traffic
>> light to know the number of cars approaching it. Also, I'm only interested
>> in counting vehicles that are close enough, i.e. within 20 meters.
>>
>> My current implementation is to get the ID of vehicles on a lane and
>> calculate the distance to the junction. Code is shown as follows. But is
>> there a more efficient way fo doing so?
>>
>> Thanks,
>> Shuyi
>>
>> def numberv(lane):
>>     nb = 0
>>     for k in traci.lane.getLastStepVehicleIDs(lane):
>>         if traci.vehicle.getLanePosition(k) < X-100:
>>              nb += 1
>>     return nb
>>
>>
>>
>>
>> _______________________________________________
>> sumo-user mailing [email protected]
>> To change your delivery options, retrieve your password, or unsubscribe from 
>> this list, visithttps://dev.eclipse.org/mailman/listinfo/sumo-user
>>
>>
>>
>> _______________________________________________
>> sumo-user mailing list
>> [email protected]
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/sumo-user
>>
>>
> _______________________________________________
> sumo-user mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/sumo-user
>
_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

Reply via email to