'Customize Variable in vehcile

When using sumo for simulation experiment, I need to add my own parameters to the vehicle.There are Vehicle Type Parameter Defaults such as width and length.But how can i customize the parameter i want to the vehicle and get the parameter through a function.



Solution 1:[1]

You can set and retrieve arbitrary parameters for vehicles (and even for edges, POIs and other elements). In the XML input you would use the syntax

<vehicle id=...>
    <param key="foo" value="bar"/>
</vehicle>

For traci and libsumo there are getParameter / setParameter functions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Michael