Dear Jakob,
Thank you very much! I appreciate your helping very much!
A. First approach.
I solved this problem using the first approach you mentioned. What I did is:
1. Run tools/randomTrips.py …… multiple times with --vehicle-class —prefix
2. Put multiple route files generated in step 1 into *.sumocfg <route-files values=""> with "," between them.
I wrote down my steps since I know you will archive all emails and post them on
Eclipse.org. This might help other people who have same questions. I benefited a lot from those archived historical emails. I'm grateful to you guys for doing it.
B. Second approach.
The command I used when I tried the second approach you mentioned is:
tools/randomTrips.py -n *.net.xml -o *.trips.xml -r *.rou.xml --period 0.2 --additional-file *.add.vtype.xml --fringe-factor 100 —-trip-attributes="type=\"typedist1\""
The add.vtype.xml file is:
<vTypeDistribution id="typedist1" >
<vType id="vTypeCar" maxSpeed="35" vClass="passenger" length="4.5" guiShape="passenger" probability="0.9"/>
<vType id="vTypeBus" maxSpeed="30" vClass="bus" Length="14.63" guiShape="bus" probability="0.1"/>
</vTypeDistribution>
</additional>
But, the content of generated trips.xml and rou.xml are:
<vehicle id="0" depart="0.00">
<routeDistribution last="0">
<route cost="256.65" probability="1.00000000" edges="right1F1 F1E1 F1E1.580.00 E1D1 E1D1.580.00 D1C1 D1C1.580.00 C1C0 C1C0.480.00 C0B0 C0B0.580.00 B0A0 B0A0.580.00 A0left0"/>
</routeDistribution>
</vehicle>
and
<trip id="0" depart="0.00" from="right1F1" to="A0left0"/>.
They both don't have type="" attribute. However in approach one the generate trip/route files have this attribute and they look like <vehicle id="0" depart="0.00" type="bus"> and <trip id="bus0" depart="0.00" from="bottom1B0" to="E2F2.580.00" type="bus"/>. When I run the simulation with second approach files, all vehicles' appearance in sumo gui are passenger vType without bus vType. I select some of them and show type parameters they are all "passenger", no "bus" found.
Could you help to point out which part I did wrong with the second approach? Thank you very much!
Thank you very much!
Have a good day and stay safe!
Sincerely,
Dayuan
The vTypeDistribution approach only works if all the roads in your simulation can be used by all vClasses in the distribution. Otherwise you should use multiple randomTrips calls and add the option --vclass.
The option --trip-attributes should work just the way you wrote it.
On a general note: Whenever you try something according to the documentation and it doesn't work, please describe the way in which you called the tool and the resulting error.
regards,
Jakob
Dear Jakob,
Thank you very much for helping!
I tried the second approach you mentioned before I asked. But when I tried it, I have following addition xml file.
<vTypeDistribution id="typedist1" >
<vType id="vTypeCar" maxSpeed="35" vClass="passenger" length="4.5" guiShape="passenger" probability="0.9"/>
<vType id="vTypeBus" maxSpeed="30" vClass="bus" Length="14.63" guiShape="bus" probability="0.1"/>
</vTypeDistribution>
Could you help to clarify how to set type attribute? I tried randomTrips.py --trip-attributes="type=\"typedist1\"" But it doesn't work.
I think I need a list of parameters which can be put into --trip-attributes="" but I didn't find it.
Thank you very much! I appreciate it very much!
Have a good day!
Sincerely,
Dayuan
If you wish to generated multiple types you either have to
- run randomTrips multiple times with a different type attribute (you also need to set the --prefix option to ensure all vehicles have distinct ids).
- put the types into a vTypeDistribution and put the distribution id into the type attribute
Dear Jacob,
Thank you very much for your helping!
I actually checked the webpage you sent before I asked. It mentions the case with one vType: "<SUMO_HOME>/tools/randomTrips.py -n input_net.net.xml --trip-attributes="type=\"myType\"" --additional-file type.add.xml
--edge-permission passenger"
I'm wondering what if I have multiple vTypes defined in addition.xml. I tried to change it to "…--trip-attributes="type=\"myType1 myType2 myType3 myType3\"" …" but it seems it doesn't work.
Thank you very much!
Have a good day!
Sincerely,
Dayuan
_______________________________________________
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@xxxxxxxxxxxTo 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@xxxxxxxxxxxTo unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________