Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Clarification on the use of add fucntion

Please note, that added vehicles may not immdiatelly become visible in the simulation gui if the space for their insertion is occupied.
Also, the function traci.vehicle.getIDList only contains visible vehicles.
To obtain the list of all "defined" vehicles. you can use the function
traci.vehicle.getLoadedIDList.

Am Fr., 10. März 2023 um 08:51 Uhr schrieb m.barthauer@xxxxxxxxxxx <m.barthauer@xxxxxxxxxxx>:

Hi,

 

are you absolutely certain that there is no vehicle with the same ID? Vehicle IDs have to be unique throughout the simulation. Some sources where to look:

  • IDs of additional vehicles from route files
  • check the active vehicle IDs repeatedly by calling traci.vehicle.getIDList()
  • if you wrap the traci.vehicle.call in a loop, be sure to generate unique vehicle IDs (e.g. by adding a counter variable at the end of the ID)

Best regards

Mirko

 

 

 

 

-----Original-Nachricht-----

Betreff: [sumo-user] Clarification on the use of add fucntion

Datum: 2023-03-10T05:26:45+0100

Von: "Zedric Banger II (zbanger)" <zbanger@xxxxxxxxxxx>

An: "sumo-user@xxxxxxxxxxx" <sumo-user@xxxxxxxxxxx>

 

 

 

Dear Mirko, 
 
Whenever I try to use the add function, I get the error, "The vehicle 'name' to add already exists." even though that vehicle DOES NOT exist. I know the routeID, but I can't figure out how to fix the error. 
 
Best Regards.
 

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top