minor improvements

* Deleted unnecessary files.
* Refactored code.
* Fixed minor bug vehicle ligths sync
This commit is contained in:
Joel Moriana 2020-03-05 10:56:37 +01:00 committed by Marc Garcia Puig
parent e8eb09b062
commit 9308838c40
7 changed files with 33 additions and 8576 deletions

View File

@ -1,521 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- generated on Tue Mar 3 12:46:05 2020 by Eclipse SUMO duarouter Version 1.4.0
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/duarouterConfiguration.xsd">
<input>
<net-file value="Town01.net.xml"/>
<route-files value="trips.trips.xml"/>
</input>
<output>
<output-file value="Town01.rou.xml"/>
<alternatives-output value="Town01.rou.alt.xml"/>
</output>
</configuration>
-->
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
<vType id="passenger" vClass="passenger"/>
<vehicle id="0" type="passenger" depart="0.00">
<routeDistribution last="0">
<route cost="60.02" probability="1.00000000" edges="-21.0.00 -9.0.00 -10.0.00 -17.0.00 4.0.00 22.0.00 21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="1" type="passenger" depart="1.00">
<routeDistribution last="0">
<route cost="37.87" probability="1.00000000" edges="24.0.00 -12.0.00 18.0.00 17.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="2" type="passenger" depart="2.00">
<routeDistribution last="0">
<route cost="56.55" probability="1.00000000" edges="-17.0.00 4.0.00 22.0.00 21.0.00 2.0.00 1.0.00 -16.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="3" type="passenger" depart="3.00">
<routeDistribution last="0">
<route cost="12.51" probability="1.00000000" edges="-18.0.00 -19.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="4" type="passenger" depart="4.00">
<routeDistribution last="0">
<route cost="49.91" probability="1.00000000" edges="-24.0.00 5.0.00 2.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="5" type="passenger" depart="5.00">
<routeDistribution last="0">
<route cost="68.95" probability="1.00000000" edges="-16.0.00 -17.0.00 -18.0.00 -19.0.00 -7.0.00 -1.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="6" type="passenger" depart="6.00">
<routeDistribution last="0">
<route cost="37.12" probability="1.00000000" edges="18.0.00 17.0.00 10.0.00 9.0.00 -22.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="7" type="passenger" depart="7.00">
<routeDistribution last="0">
<route cost="31.59" probability="1.00000000" edges="22.0.00 21.0.00 2.0.00 1.0.00 -16.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="8" type="passenger" depart="8.00">
<routeDistribution last="0">
<route cost="25.35" probability="1.00000000" edges="25.0.00 -2.0.00 -21.0.00 -9.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="9" type="passenger" depart="9.00">
<routeDistribution last="0">
<route cost="55.20" probability="1.00000000" edges="-12.0.00 18.0.00 17.0.00 16.0.00 -1.0.00 -25.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="10" type="passenger" depart="10.00">
<routeDistribution last="0">
<route cost="34.60" probability="1.00000000" edges="-16.0.00 10.0.00 25.0.00 -2.0.00 -21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="11" type="passenger" depart="11.00">
<routeDistribution last="0">
<route cost="45.83" probability="1.00000000" edges="12.0.00 23.0.00 22.0.00 -9.0.00 -10.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="12" type="passenger" depart="12.00">
<routeDistribution last="0">
<route cost="27.67" probability="1.00000000" edges="-24.0.00 -6.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="13" type="passenger" depart="13.00">
<routeDistribution last="0">
<route cost="59.48" probability="1.00000000" edges="-24.0.00 -6.0.00 -7.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="14" type="passenger" depart="14.00">
<routeDistribution last="0">
<route cost="83.94" probability="1.00000000" edges="22.0.00 21.0.00 2.0.00 -25.0.00 9.0.00 -22.0.00 -23.0.00 -24.0.00 5.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="15" type="passenger" depart="15.00">
<routeDistribution last="0">
<route cost="82.00" probability="1.00000000" edges="24.0.00 23.0.00 22.0.00 21.0.00 2.0.00 1.0.00 0.0.00 19.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="16" type="passenger" depart="16.00">
<routeDistribution last="0">
<route cost="22.08" probability="1.00000000" edges="24.0.00 23.0.00 22.0.00 21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="17" type="passenger" depart="17.00">
<routeDistribution last="0">
<route cost="119.66" probability="1.00000000" edges="0.0.00 6.0.00 24.0.00 -12.0.00 -19.0.00 -7.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="18" type="passenger" depart="18.00">
<routeDistribution last="0">
<route cost="27.12" probability="1.00000000" edges="25.0.00 -2.0.00 -21.0.00 -22.0.00 -23.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="19" type="passenger" depart="19.00">
<routeDistribution last="0">
<route cost="37.70" probability="1.00000000" edges="-25.0.00 9.0.00 -22.0.00 -4.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="20" type="passenger" depart="20.00">
<routeDistribution last="0">
<route cost="29.10" probability="1.00000000" edges="-6.0.00 19.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="21" type="passenger" depart="21.00">
<routeDistribution last="0">
<route cost="54.27" probability="1.00000000" edges="21.0.00 2.0.00 1.0.00 -16.0.00 -17.0.00 -18.0.00 12.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="22" type="passenger" depart="22.00">
<routeDistribution last="0">
<route cost="66.94" probability="1.00000000" edges="-2.0.00 -3.0.00 24.0.00 23.0.00 22.0.00 21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="23" type="passenger" depart="23.00">
<routeDistribution last="0">
<route cost="8.93" probability="1.00000000" edges="21.0.00 2.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="24" type="passenger" depart="24.00">
<routeDistribution last="0">
<route cost="3.02" probability="1.00000000" edges="18.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="25" type="passenger" depart="25.00">
<routeDistribution last="0">
<route cost="55.80" probability="1.00000000" edges="-6.0.00 19.0.00 18.0.00 17.0.00 10.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="26" type="passenger" depart="26.00">
<routeDistribution last="0">
<route cost="50.73" probability="1.00000000" edges="-24.0.00 -6.0.00 19.0.00 18.0.00 17.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="27" type="passenger" depart="27.00">
<routeDistribution last="0">
<route cost="3.71" probability="1.00000000" edges="17.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="28" type="passenger" depart="28.00">
<routeDistribution last="0">
<route cost="16.14" probability="1.00000000" edges="4.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="29" type="passenger" depart="29.00">
<routeDistribution last="0">
<route cost="56.35" probability="1.00000000" edges="-12.0.00 -19.0.00 6.0.00 24.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="30" type="passenger" depart="30.00">
<routeDistribution last="0">
<route cost="54.48" probability="1.00000000" edges="24.0.00 -12.0.00 18.0.00 17.0.00 10.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="31" type="passenger" depart="31.00">
<routeDistribution last="0">
<route cost="54.86" probability="1.00000000" edges="24.0.00 23.0.00 -4.0.00 -18.0.00 12.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="32" type="passenger" depart="32.00">
<routeDistribution last="0">
<route cost="68.47" probability="1.00000000" edges="-24.0.00 -6.0.00 19.0.00 12.0.00 23.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="33" type="passenger" depart="33.00">
<routeDistribution last="0">
<route cost="31.86" probability="1.00000000" edges="21.0.00 2.0.00 -25.0.00 9.0.00 -22.0.00 -23.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="34" type="passenger" depart="34.00">
<routeDistribution last="0">
<route cost="71.46" probability="1.00000000" edges="16.0.00 0.0.00 19.0.00 18.0.00 17.0.00 10.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="35" type="passenger" depart="35.00">
<routeDistribution last="0">
<route cost="67.15" probability="1.00000000" edges="-19.0.00 -7.0.00 -1.0.00 -2.0.00 -21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="36" type="passenger" depart="36.00">
<routeDistribution last="0">
<route cost="51.26" probability="1.00000000" edges="-12.0.00 18.0.00 4.0.00 22.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="37" type="passenger" depart="37.00">
<routeDistribution last="0">
<route cost="61.37" probability="1.00000000" edges="12.0.00 23.0.00 22.0.00 21.0.00 2.0.00 -25.0.00 9.0.00 -22.0.00 -23.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="38" type="passenger" depart="38.00">
<routeDistribution last="0">
<route cost="56.55" probability="1.00000000" edges="-17.0.00 4.0.00 22.0.00 21.0.00 2.0.00 1.0.00 -16.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="39" type="passenger" depart="39.00">
<routeDistribution last="0">
<route cost="98.54" probability="1.00000000" edges="-3.0.00 -6.0.00 19.0.00 12.0.00 -24.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="40" type="passenger" depart="40.00">
<routeDistribution last="0">
<route cost="31.24" probability="1.00000000" edges="18.0.00 4.0.00 -23.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="41" type="passenger" depart="41.00">
<routeDistribution last="0">
<route cost="68.22" probability="1.00000000" edges="-12.0.00 18.0.00 17.0.00 10.0.00 25.0.00 1.0.00 -16.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="42" type="passenger" depart="42.00">
<routeDistribution last="0">
<route cost="51.43" probability="1.00000000" edges="19.0.00 18.0.00 4.0.00 22.0.00 21.0.00 2.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="43" type="passenger" depart="43.00">
<routeDistribution last="0">
<route cost="86.73" probability="1.00000000" edges="-3.0.00 24.0.00 23.0.00 22.0.00 21.0.00 2.0.00 -25.0.00 9.0.00 -22.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="44" type="passenger" depart="44.00">
<routeDistribution last="0">
<route cost="27.87" probability="1.00000000" edges="22.0.00 -9.0.00 -10.0.00 16.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="45" type="passenger" depart="45.00">
<routeDistribution last="0">
<route cost="50.26" probability="1.00000000" edges="-10.0.00 16.0.00 0.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="46" type="passenger" depart="46.00">
<routeDistribution last="0">
<route cost="2.56" probability="1.00000000" edges="21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="47" type="passenger" depart="47.00">
<routeDistribution last="0">
<route cost="55.03" probability="1.00000000" edges="12.0.00 23.0.00 22.0.00 -9.0.00 25.0.00 -2.0.00 -21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="48" type="passenger" depart="48.00">
<routeDistribution last="0">
<route cost="89.30" probability="1.00000000" edges="-1.0.00 -25.0.00 -10.0.00 -17.0.00 -18.0.00 -19.0.00 -7.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="49" type="passenger" depart="49.00">
<routeDistribution last="0">
<route cost="38.38" probability="1.00000000" edges="-2.0.00 -21.0.00 -9.0.00 -10.0.00 16.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="50" type="passenger" depart="50.00">
<routeDistribution last="0">
<route cost="80.68" probability="1.00000000" edges="0.0.00 19.0.00 18.0.00 17.0.00 16.0.00 -1.0.00 -2.0.00 -21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="51" type="passenger" depart="51.00">
<routeDistribution last="0">
<route cost="70.68" probability="1.00000000" edges="12.0.00 23.0.00 22.0.00 21.0.00 -3.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="52" type="passenger" depart="52.00">
<routeDistribution last="0">
<route cost="38.37" probability="1.00000000" edges="5.0.00 -21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="53" type="passenger" depart="53.00">
<routeDistribution last="0">
<route cost="25.53" probability="1.00000000" edges="-1.0.00 -25.0.00 9.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="54" type="passenger" depart="54.00">
<routeDistribution last="0">
<route cost="45.86" probability="1.00000000" edges="1.0.00 -16.0.00 10.0.00 9.0.00 21.0.00 2.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="55" type="passenger" depart="55.00">
<routeDistribution last="0">
<route cost="47.46" probability="1.00000000" edges="16.0.00 -1.0.00 -25.0.00 -10.0.00 -17.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="56" type="passenger" depart="56.00">
<routeDistribution last="0">
<route cost="62.92" probability="1.00000000" edges="-24.0.00 5.0.00 2.0.00 1.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="57" type="passenger" depart="57.00">
<routeDistribution last="0">
<route cost="45.08" probability="1.00000000" edges="-25.0.00 9.0.00 -22.0.00 -4.0.00 17.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="58" type="passenger" depart="58.00">
<routeDistribution last="0">
<route cost="58.40" probability="1.00000000" edges="-6.0.00 19.0.00 18.0.00 17.0.00 16.0.00 -1.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="59" type="passenger" depart="59.00">
<routeDistribution last="0">
<route cost="38.56" probability="1.00000000" edges="10.0.00 25.0.00 -2.0.00 -21.0.00 -9.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="60" type="passenger" depart="60.00">
<routeDistribution last="0">
<route cost="52.03" probability="1.00000000" edges="-10.0.00 -17.0.00 -18.0.00 -19.0.00 6.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="61" type="passenger" depart="61.00">
<routeDistribution last="0">
<route cost="27.22" probability="1.00000000" edges="-19.0.00 6.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="62" type="passenger" depart="62.00">
<routeDistribution last="0">
<route cost="66.93" probability="1.00000000" edges="-10.0.00 -17.0.00 4.0.00 22.0.00 21.0.00 2.0.00 1.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="63" type="passenger" depart="63.00">
<routeDistribution last="0">
<route cost="40.08" probability="1.00000000" edges="18.0.00 17.0.00 16.0.00 -1.0.00 -2.0.00 -21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="64" type="passenger" depart="64.00">
<routeDistribution last="0">
<route cost="91.72" probability="1.00000000" edges="0.0.00 6.0.00 24.0.00 23.0.00 22.0.00 -9.0.00 -10.0.00 -17.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="65" type="passenger" depart="65.00">
<routeDistribution last="0">
<route cost="61.18" probability="1.00000000" edges="-12.0.00 -19.0.00 -7.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="66" type="passenger" depart="66.00">
<routeDistribution last="0">
<route cost="79.94" probability="1.00000000" edges="-3.0.00 -6.0.00 19.0.00 18.0.00 17.0.00 16.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="67" type="passenger" depart="67.00">
<routeDistribution last="0">
<route cost="62.65" probability="1.00000000" edges="9.0.00 -22.0.00 -4.0.00 -18.0.00 12.0.00 23.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="68" type="passenger" depart="68.00">
<routeDistribution last="0">
<route cost="35.57" probability="1.00000000" edges="-21.0.00 -22.0.00 -4.0.00 -18.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="69" type="passenger" depart="69.00">
<routeDistribution last="0">
<route cost="54.29" probability="1.00000000" edges="10.0.00 25.0.00 1.0.00 -16.0.00 -17.0.00 -18.0.00 -19.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="70" type="passenger" depart="70.00">
<routeDistribution last="0">
<route cost="79.30" probability="1.00000000" edges="12.0.00 -24.0.00 -6.0.00 -7.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="71" type="passenger" depart="71.00">
<routeDistribution last="0">
<route cost="57.57" probability="1.00000000" edges="-23.0.00 -12.0.00 18.0.00 17.0.00 10.0.00 25.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="72" type="passenger" depart="72.00">
<routeDistribution last="0">
<route cost="29.12" probability="1.00000000" edges="-1.0.00 -2.0.00 -21.0.00 -22.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="73" type="passenger" depart="73.00">
<routeDistribution last="0">
<route cost="52.69" probability="1.00000000" edges="-3.0.00 -6.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="74" type="passenger" depart="74.00">
<routeDistribution last="0">
<route cost="90.68" probability="1.00000000" edges="5.0.00 -21.0.00 -22.0.00 -23.0.00 -24.0.00 -6.0.00 19.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="75" type="passenger" depart="75.00">
<routeDistribution last="0">
<route cost="74.63" probability="1.00000000" edges="-4.0.00 17.0.00 16.0.00 0.0.00 19.0.00 18.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="76" type="passenger" depart="76.00">
<routeDistribution last="0">
<route cost="22.47" probability="1.00000000" edges="2.0.00 -25.0.00 -10.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="77" type="passenger" depart="77.00">
<routeDistribution last="0">
<route cost="74.85" probability="1.00000000" edges="4.0.00 -23.0.00 -12.0.00 -19.0.00 6.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="78" type="passenger" depart="78.00">
<routeDistribution last="0">
<route cost="49.57" probability="1.00000000" edges="19.0.00 18.0.00 17.0.00 16.0.00 -1.0.00 -2.0.00 -21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="79" type="passenger" depart="79.00">
<routeDistribution last="0">
<route cost="58.92" probability="1.00000000" edges="25.0.00 -2.0.00 -3.0.00 24.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="80" type="passenger" depart="80.00">
<routeDistribution last="0">
<route cost="58.52" probability="1.00000000" edges="17.0.00 10.0.00 9.0.00 -22.0.00 -23.0.00 -12.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="81" type="passenger" depart="81.00">
<routeDistribution last="0">
<route cost="75.51" probability="1.00000000" edges="-18.0.00 12.0.00 23.0.00 22.0.00 21.0.00 -3.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="82" type="passenger" depart="82.00">
<routeDistribution last="0">
<route cost="37.76" probability="1.00000000" edges="-22.0.00 -23.0.00 -24.0.00 -6.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="83" type="passenger" depart="83.00">
<routeDistribution last="0">
<route cost="35.39" probability="1.00000000" edges="17.0.00 16.0.00 -1.0.00 -2.0.00 -21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="84" type="passenger" depart="84.00">
<routeDistribution last="0">
<route cost="99.74" probability="1.00000000" edges="-6.0.00 19.0.00 18.0.00 17.0.00 16.0.00 -1.0.00 -2.0.00 -3.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="85" type="passenger" depart="85.00">
<routeDistribution last="0">
<route cost="22.00" probability="1.00000000" edges="10.0.00 9.0.00 21.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="86" type="passenger" depart="86.00">
<routeDistribution last="0">
<route cost="64.56" probability="1.00000000" edges="-10.0.00 16.0.00 0.0.00 19.0.00 18.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="87" type="passenger" depart="87.00">
<routeDistribution last="0">
<route cost="52.24" probability="1.00000000" edges="-4.0.00 17.0.00 10.0.00 9.0.00 -22.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="88" type="passenger" depart="88.00">
<routeDistribution last="0">
<route cost="45.40" probability="1.00000000" edges="-18.0.00 12.0.00 23.0.00 22.0.00 -9.0.00 25.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="89" type="passenger" depart="89.00">
<routeDistribution last="0">
<route cost="63.25" probability="1.00000000" edges="23.0.00 22.0.00 21.0.00 2.0.00 -25.0.00 9.0.00 -22.0.00 -23.0.00 -12.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="90" type="passenger" depart="90.00">
<routeDistribution last="0">
<route cost="69.76" probability="1.00000000" edges="4.0.00 -23.0.00 -24.0.00 5.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="91" type="passenger" depart="91.00">
<routeDistribution last="0">
<route cost="32.71" probability="1.00000000" edges="10.0.00 9.0.00 21.0.00 2.0.00 -25.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="92" type="passenger" depart="92.00">
<routeDistribution last="0">
<route cost="36.87" probability="1.00000000" edges="-19.0.00 6.0.00 24.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="93" type="passenger" depart="93.00">
<routeDistribution last="0">
<route cost="49.39" probability="1.00000000" edges="-22.0.00 -4.0.00 -18.0.00 12.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="94" type="passenger" depart="94.00">
<routeDistribution last="0">
<route cost="42.88" probability="1.00000000" edges="24.0.00 23.0.00 22.0.00 -9.0.00 -10.0.00 -17.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="95" type="passenger" depart="95.00">
<routeDistribution last="0">
<route cost="41.08" probability="1.00000000" edges="25.0.00 1.0.00 -16.0.00 -17.0.00 -18.0.00 -19.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="96" type="passenger" depart="96.00">
<routeDistribution last="0">
<route cost="41.90" probability="1.00000000" edges="-21.0.00 -22.0.00 -23.0.00 -24.0.00 -6.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="97" type="passenger" depart="97.00">
<routeDistribution last="0">
<route cost="54.86" probability="1.00000000" edges="2.0.00 1.0.00 -16.0.00 -17.0.00 -18.0.00 12.0.00 23.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="98" type="passenger" depart="98.00">
<routeDistribution last="0">
<route cost="15.77" probability="1.00000000" edges="-16.0.00 10.0.00"/>
</routeDistribution>
</vehicle>
<vehicle id="99" type="passenger" depart="99.00">
<routeDistribution last="0">
<route cost="23.52" probability="1.00000000" edges="10.0.00 9.0.00 -22.0.00"/>
</routeDistribution>
</vehicle>
</routes>

File diff suppressed because it is too large Load Diff

View File

@ -1,107 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- generated on 2020-03-03 12:44:57.141872 by randomTrips.py v1_5_0+0340-c5c5ce5a4d
options: -n Town01.net.xml -e 100 <doubleminus>vehicle-class passenger
-->
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
<vType id="passenger" vClass="passenger"/>
<trip id="0" depart="0.00" from="-21.0.00" to="21.0.00" type="passenger"/>
<trip id="1" depart="1.00" from="24.0.00" to="17.0.00" type="passenger"/>
<trip id="2" depart="2.00" from="-17.0.00" to="-16.0.00" type="passenger"/>
<trip id="3" depart="3.00" from="-18.0.00" to="-19.0.00" type="passenger"/>
<trip id="4" depart="4.00" from="-24.0.00" to="2.0.00" type="passenger"/>
<trip id="5" depart="5.00" from="-16.0.00" to="-1.0.00" type="passenger"/>
<trip id="6" depart="6.00" from="18.0.00" to="-22.0.00" type="passenger"/>
<trip id="7" depart="7.00" from="22.0.00" to="-16.0.00" type="passenger"/>
<trip id="8" depart="8.00" from="25.0.00" to="-9.0.00" type="passenger"/>
<trip id="9" depart="9.00" from="-12.0.00" to="-25.0.00" type="passenger"/>
<trip id="10" depart="10.00" from="-16.0.00" to="-21.0.00" type="passenger"/>
<trip id="11" depart="11.00" from="12.0.00" to="-10.0.00" type="passenger"/>
<trip id="12" depart="12.00" from="-24.0.00" to="-6.0.00" type="passenger"/>
<trip id="13" depart="13.00" from="-24.0.00" to="-7.0.00" type="passenger"/>
<trip id="14" depart="14.00" from="22.0.00" to="5.0.00" type="passenger"/>
<trip id="15" depart="15.00" from="24.0.00" to="19.0.00" type="passenger"/>
<trip id="16" depart="16.00" from="24.0.00" to="21.0.00" type="passenger"/>
<trip id="17" depart="17.00" from="0.0.00" to="-7.0.00" type="passenger"/>
<trip id="18" depart="18.00" from="25.0.00" to="-23.0.00" type="passenger"/>
<trip id="19" depart="19.00" from="-25.0.00" to="-4.0.00" type="passenger"/>
<trip id="20" depart="20.00" from="-6.0.00" to="19.0.00" type="passenger"/>
<trip id="21" depart="21.00" from="21.0.00" to="12.0.00" type="passenger"/>
<trip id="22" depart="22.00" from="-2.0.00" to="21.0.00" type="passenger"/>
<trip id="23" depart="23.00" from="21.0.00" to="2.0.00" type="passenger"/>
<trip id="24" depart="24.00" from="18.0.00" to="18.0.00" type="passenger"/>
<trip id="25" depart="25.00" from="-6.0.00" to="10.0.00" type="passenger"/>
<trip id="26" depart="26.00" from="-24.0.00" to="17.0.00" type="passenger"/>
<trip id="27" depart="27.00" from="17.0.00" to="17.0.00" type="passenger"/>
<trip id="28" depart="28.00" from="4.0.00" to="4.0.00" type="passenger"/>
<trip id="29" depart="29.00" from="-12.0.00" to="24.0.00" type="passenger"/>
<trip id="30" depart="30.00" from="24.0.00" to="10.0.00" type="passenger"/>
<trip id="31" depart="31.00" from="24.0.00" to="12.0.00" type="passenger"/>
<trip id="32" depart="32.00" from="-24.0.00" to="23.0.00" type="passenger"/>
<trip id="33" depart="33.00" from="21.0.00" to="-23.0.00" type="passenger"/>
<trip id="34" depart="34.00" from="16.0.00" to="10.0.00" type="passenger"/>
<trip id="35" depart="35.00" from="-19.0.00" to="-21.0.00" type="passenger"/>
<trip id="36" depart="36.00" from="-12.0.00" to="22.0.00" type="passenger"/>
<trip id="37" depart="37.00" from="12.0.00" to="-23.0.00" type="passenger"/>
<trip id="38" depart="38.00" from="-17.0.00" to="-16.0.00" type="passenger"/>
<trip id="39" depart="39.00" from="-3.0.00" to="-24.0.00" type="passenger"/>
<trip id="40" depart="40.00" from="18.0.00" to="-23.0.00" type="passenger"/>
<trip id="41" depart="41.00" from="-12.0.00" to="-16.0.00" type="passenger"/>
<trip id="42" depart="42.00" from="19.0.00" to="2.0.00" type="passenger"/>
<trip id="43" depart="43.00" from="-3.0.00" to="-22.0.00" type="passenger"/>
<trip id="44" depart="44.00" from="22.0.00" to="16.0.00" type="passenger"/>
<trip id="45" depart="45.00" from="-10.0.00" to="0.0.00" type="passenger"/>
<trip id="46" depart="46.00" from="21.0.00" to="21.0.00" type="passenger"/>
<trip id="47" depart="47.00" from="12.0.00" to="-21.0.00" type="passenger"/>
<trip id="48" depart="48.00" from="-1.0.00" to="-7.0.00" type="passenger"/>
<trip id="49" depart="49.00" from="-2.0.00" to="16.0.00" type="passenger"/>
<trip id="50" depart="50.00" from="0.0.00" to="-21.0.00" type="passenger"/>
<trip id="51" depart="51.00" from="12.0.00" to="-3.0.00" type="passenger"/>
<trip id="52" depart="52.00" from="5.0.00" to="-21.0.00" type="passenger"/>
<trip id="53" depart="53.00" from="-1.0.00" to="9.0.00" type="passenger"/>
<trip id="54" depart="54.00" from="1.0.00" to="2.0.00" type="passenger"/>
<trip id="55" depart="55.00" from="16.0.00" to="-17.0.00" type="passenger"/>
<trip id="56" depart="56.00" from="-24.0.00" to="1.0.00" type="passenger"/>
<trip id="57" depart="57.00" from="-25.0.00" to="17.0.00" type="passenger"/>
<trip id="58" depart="58.00" from="-6.0.00" to="-1.0.00" type="passenger"/>
<trip id="59" depart="59.00" from="10.0.00" to="-9.0.00" type="passenger"/>
<trip id="60" depart="60.00" from="-10.0.00" to="6.0.00" type="passenger"/>
<trip id="61" depart="61.00" from="-19.0.00" to="6.0.00" type="passenger"/>
<trip id="62" depart="62.00" from="-10.0.00" to="1.0.00" type="passenger"/>
<trip id="63" depart="63.00" from="18.0.00" to="-21.0.00" type="passenger"/>
<trip id="64" depart="64.00" from="0.0.00" to="-17.0.00" type="passenger"/>
<trip id="65" depart="65.00" from="-12.0.00" to="-7.0.00" type="passenger"/>
<trip id="66" depart="66.00" from="-3.0.00" to="16.0.00" type="passenger"/>
<trip id="67" depart="67.00" from="9.0.00" to="23.0.00" type="passenger"/>
<trip id="68" depart="68.00" from="-21.0.00" to="-18.0.00" type="passenger"/>
<trip id="69" depart="69.00" from="10.0.00" to="-19.0.00" type="passenger"/>
<trip id="70" depart="70.00" from="12.0.00" to="-7.0.00" type="passenger"/>
<trip id="71" depart="71.00" from="-23.0.00" to="25.0.00" type="passenger"/>
<trip id="72" depart="72.00" from="-1.0.00" to="-22.0.00" type="passenger"/>
<trip id="73" depart="73.00" from="-3.0.00" to="-6.0.00" type="passenger"/>
<trip id="74" depart="74.00" from="5.0.00" to="19.0.00" type="passenger"/>
<trip id="75" depart="75.00" from="-4.0.00" to="18.0.00" type="passenger"/>
<trip id="76" depart="76.00" from="2.0.00" to="-10.0.00" type="passenger"/>
<trip id="77" depart="77.00" from="4.0.00" to="6.0.00" type="passenger"/>
<trip id="78" depart="78.00" from="19.0.00" to="-21.0.00" type="passenger"/>
<trip id="79" depart="79.00" from="25.0.00" to="24.0.00" type="passenger"/>
<trip id="80" depart="80.00" from="17.0.00" to="-12.0.00" type="passenger"/>
<trip id="81" depart="81.00" from="-18.0.00" to="-3.0.00" type="passenger"/>
<trip id="82" depart="82.00" from="-22.0.00" to="-6.0.00" type="passenger"/>
<trip id="83" depart="83.00" from="17.0.00" to="-21.0.00" type="passenger"/>
<trip id="84" depart="84.00" from="-6.0.00" to="-3.0.00" type="passenger"/>
<trip id="85" depart="85.00" from="10.0.00" to="21.0.00" type="passenger"/>
<trip id="86" depart="86.00" from="-10.0.00" to="18.0.00" type="passenger"/>
<trip id="87" depart="87.00" from="-4.0.00" to="-22.0.00" type="passenger"/>
<trip id="88" depart="88.00" from="-18.0.00" to="25.0.00" type="passenger"/>
<trip id="89" depart="89.00" from="23.0.00" to="-12.0.00" type="passenger"/>
<trip id="90" depart="90.00" from="4.0.00" to="5.0.00" type="passenger"/>
<trip id="91" depart="91.00" from="10.0.00" to="-25.0.00" type="passenger"/>
<trip id="92" depart="92.00" from="-19.0.00" to="24.0.00" type="passenger"/>
<trip id="93" depart="93.00" from="-22.0.00" to="12.0.00" type="passenger"/>
<trip id="94" depart="94.00" from="24.0.00" to="-17.0.00" type="passenger"/>
<trip id="95" depart="95.00" from="25.0.00" to="-19.0.00" type="passenger"/>
<trip id="96" depart="96.00" from="-21.0.00" to="-6.0.00" type="passenger"/>
<trip id="97" depart="97.00" from="2.0.00" to="23.0.00" type="passenger"/>
<trip id="98" depart="98.00" from="-16.0.00" to="10.0.00" type="passenger"/>
<trip id="99" depart="99.00" from="10.0.00" to="-22.0.00" type="passenger"/>
</routes>

View File

@ -45,22 +45,26 @@ class BridgeHelper(object):
# (http://sumo.sourceforge.net/userdoc/Purgatory/Vehicle_Values.html#angle)
yaw = -1 * in_rotation.yaw + 90
length = 2.0 * extent.x
out_location = (in_location.x - math.cos(math.radians(yaw)) *
(length / 2.0), in_location.y -
math.sin(math.radians(yaw)) * (length / 2.0),
in_location.z)
out_location = (
in_location.x - math.cos(math.radians(yaw)) * (length / 2.0),
in_location.y - math.sin(math.radians(yaw)) * (length / 2.0),
in_location.z
)
out_rotation = (in_rotation.pitch, in_rotation.yaw, in_rotation.roll)
# Applying offset sumo-carla net.
out_location = (out_location[0] - offset[0],
out_location[1] - offset[1], out_location[2])
out_location = (
out_location[0] - offset[0],
out_location[1] - offset[1],
out_location[2]
)
out_rotation = out_rotation
# Transform to carla reference system (left-handed system).
return carla.Transform(
carla.Location(out_location[0], -out_location[1], out_location[2]),
carla.Rotation(out_rotation[0], out_rotation[1] - 90,
out_rotation[2]))
carla.Rotation(out_rotation[0], out_rotation[1] - 90, out_rotation[2])
)
@staticmethod
def get_sumo_transform(in_carla_transform, extent):
@ -73,22 +77,26 @@ class BridgeHelper(object):
# From center to front-center-bumper (carla reference system).
yaw = -1 * in_rotation.yaw
length = 2.0 * extent.x
out_location = (in_location.x + math.cos(math.radians(yaw)) *
(length / 2.0), in_location.y -
math.sin(math.radians(yaw)) * (length / 2.0),
in_location.z)
out_location = (
in_location.x + math.cos(math.radians(yaw)) * (length / 2.0),
in_location.y - math.sin(math.radians(yaw)) * (length / 2.0),
in_location.z
)
out_rotation = (in_rotation.pitch, in_rotation.yaw, in_rotation.roll)
# Applying offset carla-sumo net
out_location = (out_location[0] + offset[0],
out_location[1] - offset[1], out_location[2])
out_location = (
out_location[0] + offset[0],
out_location[1] - offset[1],
out_location[2]
)
out_rotation = out_rotation
# Transform to sumo reference system.
return carla.Transform(
carla.Location(out_location[0], -out_location[1], out_location[2]),
carla.Rotation(out_rotation[0], out_rotation[1] + 90,
out_rotation[2]))
carla.Rotation(out_rotation[0], out_rotation[1] + 90, out_rotation[2])
)
@staticmethod
def _get_recommended_carla_blueprint(sumo_actor):

View File

@ -81,7 +81,7 @@ class CarlaSimulation(object):
return False
vehicle.set_transform(transform)
if lights is not None or self.args.sync_vehicle_lights:
if lights is not None and self.args.sync_vehicle_lights:
vehicle.set_light_state(carla.VehicleLightState(lights))
def synchronize_walker(self, walker_id, transform):

View File

@ -97,15 +97,16 @@ class SumoSimulation(object):
if args.sumo_host is None or args.sumo_port is None:
logging.info('Starting new sumo server...')
if self.sumo_gui:
logging.info('Remember to press the play button in sumo-gui to start the simulation')
traci.start([
sumo_binary,
"-c", args.sumo_cfg_file,
'--step-length', str(args.step_length),
'--lateral-resolution', '0.25'
'--lateral-resolution', '0.25',
'--collision.check-junctions'
])
if self.sumo_gui:
logging.info('Remember to press the play button to start the simulation')
else:
logging.info('Connection to sumo server. Host: {} Port: {}'.format(self.host, self.port))
traci.init(host=self.host, port=self.port)
@ -122,7 +123,6 @@ class SumoSimulation(object):
@staticmethod
def subscribe(actor_id):
# TODO(joel): Add velocity, acceleration?
traci.vehicle.subscribe(actor_id, [
traci.constants.VAR_TYPE, traci.constants.VAR_VEHICLECLASS,
traci.constants.VAR_COLOR, traci.constants.VAR_LENGTH,
@ -136,7 +136,6 @@ class SumoSimulation(object):
def unsubscribe(actor_id):
traci.vehicle.unsubscribe(actor_id)
# TODO(joel): Review this is correct.
def get_net_offset(self):
offset = traci.simulation.convertGeo(0, 0)
return (-offset[0], -offset[1])
@ -162,7 +161,8 @@ class SumoSimulation(object):
]
transform = carla.Transform(
carla.Location(location[0], location[1], location[2]),
carla.Rotation(rotation[0], rotation[1], rotation[2]))
carla.Rotation(rotation[0], rotation[1], rotation[2])
)
signals = results[traci.constants.VAR_SIGNALS]
extent = carla.Vector3D(length / 2.0, width / 2.0, height / 2.0)
@ -195,7 +195,7 @@ class SumoSimulation(object):
yaw = transform.rotation.yaw
traci.vehicle.moveToXY(vehicle_id, "", 0, x, y, angle=yaw, keepRoute=2)
if signals is not None or self.args.sync_vehicle_lights:
if signals is not None and self.args.sync_vehicle_lights:
traci.vehicle.setSignals(vehicle_id, signals)
def synchronize_walker(self, walker_id, transform):

View File

@ -1,145 +0,0 @@
#!/usr/bin/env python
# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Script to randomly spawn vehicles in sumo.
"""
# ==============================================================================
# -- find traci module ---------------------------------------------------------
# ==============================================================================
import glob
import os
import sys
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("please declare environment variable 'SUMO_HOME'")
# ==============================================================================
# -- imports -------------------------------------------------------------------
# ==============================================================================
import argparse
import logging
import random
import sumolib
import traci
# ==============================================================================
# -- main ----------------------------------------------------------------------
# ==============================================================================
def get_random_color():
r = random.randrange(256)
g = random.randrange(256)
b = random.randrange(256)
a = 255
return (r, g, b, a)
def main(args):
try:
if args.sumo_gui is True:
sumo_binary = sumolib.checkBinary('sumo-gui')
else:
sumo_binary = sumolib.checkBinary('sumo')
if args.sumo_host is None or args.sumo_port is None:
logging.info('Starting new sumo server...')
if args.sumo_gui:
logging.info('Remember to press the play button in sumo-gui to start the simulation')
traci.start([
sumo_binary,
"-c", args.sumo_cfg_file,
'--step-length', str(args.step_length),
])
else:
logging.info('Connection to sumo server. Host: {} Port: {}'.format(args.sumo_host, args.sumo_port))
traci.init(host=args.sumo_host, port=args.sumo_port)
traci.setOrder(1)
# Creating a random route to be able to spawn vehicles.
traci.route.add("spawn_route", [traci.edge.getIDList()[0]])
sequential_id = 0
while True:
input('Press a key to spawn a new actor')
# Remove previously spawned vehicle.
if sequential_id > 0:
traci.vehicle.remove('spawn_' + str(sequential_id - 1))
type_id = random.choice(traci.vehicletype.getIDList())
actor_id = 'spawn_' + str(sequential_id)
traci.vehicle.add(actor_id, 'spawn_route', typeID=type_id)
traci.vehicle.setColor(actor_id, get_random_color()) # Randomly select color.
traci.simulationStep()
traci.simulationStep()
sequential_id += 1
logging.info('''Spawned new sumo vehicle:
\tvtype: {vtype:}
\tcolor: {color:}'''.format(
vtype=type_id,
color=traci.vehicle.getColor(actor_id)
)
)
except KeyboardInterrupt:
logging.info('Cancelled by user.')
finally:
traci.close()
if __name__ == '__main__':
argparser = argparse.ArgumentParser(
description=__doc__
)
argparser.add_argument(
'--sumo-host',
metavar='H',
default=None,
help='IP of the sumo host server (default: 127.0.0.1)'
)
argparser.add_argument(
'--sumo-port',
metavar='P',
default=None,
type=int,
help='TCP port to liston to (default: 8813)'
)
argparser.add_argument(
'-c', '--sumo-cfg-file',
default=None,
type=str,
help='sumo configuration file'
)
argparser.add_argument(
'--sumo-gui',
default=True,
help='run the gui version of sumo (default: True)'
)
argparser.add_argument(
'--step-length',
default=0.05,
type=float,
help='set fixed delta seconds (default: 0.05s)'
)
args = argparser.parse_args()
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
main(args)