Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Accesing user defined attributes of vehicles in rou.xml file using TraCI

Extra attributes in the <vehicle> element will always be ignored. To supply custom data you must put it in a parameter sub-element:

<vehicle depart="1" id="veh0" route="right" type="typeWE" problem ="10" >
  <param key="problem" value="10"/>
</vehicle>

Then you will be able to access it using

traci.vehicle.getParameter("veh0", "problem")

Am So., 21. Okt. 2018 um 21:27 Uhr schrieb Onur Berk Töre <onurberk_t@xxxxxxxxxxx>:

I want to access user-defined attributes for vehicles in rou.xml file.
Example:
<vehicle depart="1" id="veh0" route="right" type="typeWE" problem ="10" />

I want to access "problem" using Traci but i could not find any way to achieve this.Closest thing i found is "getParameter()" function and its not doing what i wanted.

Is there a way ?
Open Tracking
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

Back to the top