The approach is sound. See here for subscribing to things in a range around other things: https://sumo.dlr.de/docs/TraCI/Interfacing_TraCI_from_Python.html#context_subscriptions
Am Fr., 2. Sept. 2022 um 19:35 Uhr schrieb Devon Fazekas < [email protected]>: > I have a simple multi-lane road where all vehicles start from the leftmost > edge and drive to the rightmost edge. All the traffic is made of civilian > vehicles with the exception of a single Emergency Vehicle (EV) that enters > the network 10 seconds into the simulation. > > I need vehicles to pull over and slow down to a complete stop when the EV > approaches them from behind, enabling the EV to pass by. I understand that > this behaviour is not native in SUMO, that EVs only cause civilians to slow > down but does not cause them to halt. > > I believe I can use the traci.vehicle.slowDown() method to achieve a > similar result (slowing vehicles gradually to a complete stop), but I need > help with targeting the nearby civilian vehicles. EVs use a blue-light > device which has a built-in signal range, illustrated below. > > The blue-light signal range on an Emergency Vehicle. > > > > I believe the following process should work to achieve the desired > behaviour. > > 1. Subscribe to the EV. > 2. Listen for any civilian vehicle at least 50-meters in front of the > EV (regardless of lane). > 3. Use traci.vehicle.slowDown() on those vehicles to bring them to a > halt. > 4. Once the EV is 50-meters ahead of the halted vehicle, resume their > original speed. > > I’ve never used subscriptions before and I’m having difficulty finding > code examples. Please point out any errors in my approach and/or code > examples on how to achieve this process. > > > _______________________________________________ > sumo-user mailing list > [email protected] > To unsubscribe from this list, visit > https://www.eclipse.org/mailman/listinfo/sumo-user >
_______________________________________________ sumo-user mailing list [email protected] To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
