If your switching algorithm does not care about the direction from which the vehicles are coming, then yes.
Am Mo., 15. Okt. 2018 um 15:21 Uhr schrieb Oesch, T. Sean <[email protected] >: > What I would like to do is change the phase of the light based on the type > of vehicles in each lane. Could I do something like the following > pseudocode? Or would I need to use getControlledLinks to do this fluidly? > > > lanes = trafficlight.getControlledLanes(id) > > for incomingLane in lanes: > > carTypes[incomingLane] = incomingLane.getVehicles.getTypeList() > > setLightPhase(carTypes) > > > Sean Oesch > Security Researcher & Software Architect > CISR Group at Oak Ridge National Laboratory > Leader Blockchain Initiative > ------------------------------ > *From:* Jakob Erdmann <[email protected]> > *Sent:* Monday, October 15, 2018 2:36 AM > *To:* Oesch, T. Sean; sumo developer discussions > *Subject:* re: [sumo-dev] Most efficient way to iterate all traffic > lights and view vehicle types incoming? > > Every traffic light supports retrieval of incoming lanes via method > traffic. trafficlight.getControlledLanes (a list of ids) > You can use this to iterate over all vehicles on these lanes and figure > out their types. If you need to correlated lanes with green phasesyou can > use getControlledLinks but you first need to get a good understanding of > how traffic lights are modelled in sumo to make use of the returned values > ( > http://sumo.dlr.de/wiki/Simulation/Traffic_Lights#Signal_state_definitions > ) > > regards, > Jakob > > > >> Hey guys, >> >> >> >> I figured out how to iterate all traffic lights using TraCI - pretty >> straight forward. But what is the most efficient way to view vehicle types >> on each incoming lane at each traffic light??? Putting induction loops on >> the incoming lanes of every light seems inefficient and I do not see a way >> to correlate the induction loops with the light for easy lookup. >> > >
_______________________________________________ sumo-dev 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-dev
