Hi Jin,
With the command traci.vehicle.setType() you are assigning a new vehicle-type to the vehicle. So you are changing from AudiTT vehicle-type to AudiA2,
this means that not only the car following model will be changed but also all other parameters of vehicle-type, for example the maxSpeed.
I think there is no other way to change the car following model in Traci. You can check the following links for more information:
https://sumo.dlr.de/docs/TraCI/Change_Vehicle_State.html
https://sumo.dlr.de/docs/TraCI/Vehicle_Value_Retrieval.html
https://sumo.dlr.de/docs/TraCI/Change_VehicleType_State.html
Regards,
Giuliana
From: sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx]
On Behalf Of J
Sent: Montag, 7. September 2020 10:36
To: sumo-user@xxxxxxxxxxx
Subject: [sumo-user] Not sure I post question in right place(change sumo v_type problem)
Hope this email finds you well
I know we can use traci.vehicle.setType("a new type") to change the car-following mode, but is there any way to preserve the same ID name
with different car-follow-type.
For example, in the route file:
<vType id="AudiTT" maxSpeed="15.00"
carFollowModel="IDM"/>
<vType id="AudiA2" maxSpeed="15.00"
carFollowModel="Krauss"/>
<vehicle id="vehicle_0" type="AudiTT" depart="0.00" route="route_0" />
For example, in the route file: I have a vtype "AudiTT" with IDM model and Audio A2 with Krauss model
when I change the type for "vehicle_0" the whole thing has been changed
is there a way to assign "Krauss" to Audi TT with Traci python in runtime?