[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [sumo-user] Vehicle type in TraCI
|
whenever you copy a type, the id of the new type must not have been used before. In your case vType_1 already exists because you loaded it from xml.
Dear Jakob,
After your hint, I changed my code as follow:
if step == 20:
traci.vehicle.add('vehicle_0','route_0','vType_0')
if step == 30:
traci.vehicletype.copy('vType_0','vType_1')
traci.vehicle.add('vehicle_1','route_0','vType_1')
simultaneously, I added new type in .rou.xml file :
<vType id="vType_0" vClass="passenger"/>
<vType id="vType_1" vClass="taxi"/>
After running the script, the Error: Answered with error to command 0xc5: could not add type vType_1 stopped the simulation.
Then, what is wrong with my job.
Thank you,
Ali
traci.vehicletype.copy("DEFAULT_VEHTYPE", "newType")
traci.vehicletype.setMaxSpeed("newType") # or whatever attributes you wish to define
traci.vehicle.add("v0", "route_0", "newType")
Hi everyone,
Let me explain what I mean with an example.
traci.vehicle.add('vehicle_0','route_0','vType_0')
This is a piece of my script in which vType has been defined in advance in .rou.file by <vType id="vType_0" vClass="trailer"/> .
I am looking for a method to define vType directly via TraCI without having to pass through the .rou.xml file.
Regards,
Ali
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user