Hi Yushen,
I think you can achieve this using TraCi (see
https://sumo.dlr.de/docs/TraCI.html).
You could use induction loops and the command “getLastStepVehicleNumber”
to check how many vehicles entered within the last simulation step. By checking the vehicle IDs with the command “getLastStepVehicleIDs” you could check how many vehicles
with the prefix "A", "B" or "C" entered. See
https://sumo.dlr.de/docs/TraCI/Induction_Loop_Value_Retrieval.html and
https://sumo.dlr.de/docs/Simulation/Output/Induction_Loops_Detectors_(E1).html
This way you can check if the desired weight was reached and then generate a vehicle using the command "add". See
https://sumo.dlr.de/docs/TraCI/Change_Vehicle_State.html
Regards,
Giuliana
Von: sumo-user-bounces@xxxxxxxxxxx <sumo-user-bounces@xxxxxxxxxxx>
Im Auftrag von #LONG YUSHEN#
Gesendet: Montag, 12. Oktober 2020 10:25
An: sumo-user@xxxxxxxxxxx
Betreff: [sumo-user] Generate vehicle according to simulation data
Hi,
Does SUMO support the following trip generation mechanism:
For a certain edge, say edge #1, every 10 vehicles arriving edge #1, generate 1 vehicle staring from edge #1?
A more complicated case is:
I have three types of vehicles, with prefix ‘A’, ‘B’ and ‘C’. Different prefix has different weight, say ‘A’ has 2, ‘B’ has 3 and ‘C’ has 5. Is it possible for a certain edge to generate 1 vehicle for every 20 weight
arriving this edge?
Thanks for your attention.
Best regards,
Yushen
**Disclaimer** The sender of this email does not represent Nanyang Technological University and this email does not express the views or opinions of the University.