【问题标题】:Bus stops and routes in SUMOSUMO 的巴士站和路线
【发布时间】:2021-01-14 15:01:42
【问题描述】:

我最近开始使用 SUMO 交通模拟器,我正在尝试模拟一个多式联运网络。 我已经能够使用 vTypeDistribution 和 randomTrips.py 启动汽车和公共汽车的模拟。 现在我正在尝试使用 ptlines2flows.py 模拟一个真实的公共交通网络。 我能够获得所有的公交车站和行程,但不能获得路线。事实上,我收到了多个这样的警告: 警告:车道 '497770366_0' 上车辆 '55_subway_L4:0' 的 busStop '25902051' 不在当前路线下游。 和 0 辆车被装载。另外,我收到此错误:

错误:车辆 '39_bus_73:0' 不允许在 via edge '45100166#0' 的任何车道上行驶。

该程序似乎试图将公共汽车放在地铁/地铁线路中。

我将我的 bash 脚本附在我做所有事情的地方:

#!/bin/bash
source autosumo_parameters.sh

# 1. Links and folder creations
mkdir -p ${folder}
cd ${folder}
ln -sf ../$map .    # Link to where is the map (downloaded manually at the moment)
rm ${conf_file}

# 2. Create SUMO network from .osm map
#netconvert --osm-files ${map} --output-file ${network} --geometry.remove --roundabouts.guess --ramps.guess --junctions.join --tls.guess-signals --tls.discard-simple --tls.join

netconvert --osm-files ${map} --output-file ${network} --osm.stop-output.length 15 --ptstop-output ${ptstops_out} --ptline-output ${ptlines_out} --osm.elevation --geometry.remove --roundabouts.guess --ramps.guess --junctions.join --tls.guess-signals --tls.discard-simple --tls.join


# 2.2 Create public transport schedules
python3 /home/alejandro/Documentos/sumoDocs/pythonScripts/ptlines2flows.py -n ${network} -s ${ptstops_out} -l ${ptlines_out} -o ${ptroutes} -p 300 --min-stops 1 --use-osm-routes --verbose

#python3 $SUMO_HOME/tools/ptlines2flows.py -n ${network} -s ${ptstops_out} -l ${ptlines_out} -o ${ptroutes} -p 300 --min-stops 1 --use-osm-routes --verbose

# 3. Create SUMO simulation configuration file
  echo "<?xml version='1.0' encoding='iso-8859-1'?>

<configuration xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='http://sumo.dlr.de/xsd/duarouterConfiguration.xsd'>

    <input>
        <net-file value='${network}'/>
        <route-files value='${ptroutes}'/>
    <additional-files value='${ptstops_out}'/>
    </input>

    <output>
        <emission-output value='${emi_out}'/>
    <fcd-output value='${fcd_out}'/>
    </output>

    <time>
        <begin value='${begin_time}'/>
        <end value='${end_time}'/>
    </time>
 
    <processing>
        <time-to-teleport value='${teleport}'/>
    </processing>

</configuration>" > $conf_file
#fi

#sumo -c $conf_file --fcd-output $fcd_out --emission-output $emi_out --device.emissions.period "20.0" 
sumo -c $conf_file --ignore-route-errors
echo " \n sumo done"

# Open the configuration file in sumo-gui to launch the simulation
#sumo-gui $conf_file

# traceExporter.py converts fcd-output file to different file formats: OMNET, Shawn, ns2/ns3, PHEM
python3 $SUMO_HOME/tools/traceExporter.py --fcd-input $fcd_out --omnet-output fcd_to_omnet.xml #--kml-output fcd_to_kml.xml

你愿意帮我吗?我真的很感激,我已经被这个困扰了几天......

【问题讨论】:

  • 我对这个模拟器不熟悉,但我敢打赌,如果你分享代码而不是截图会很有帮助。
  • 不要发布代码截图。以文字形式发布!
  • 对不起!!在一分钟内上传全文编辑:现在它已修复!

标签: python openstreetmap omnet++ veins sumo


【解决方案1】:

我终于明白了,问题出在网络和通道权限上。显然,如果您导入 OpenStreetMap 文件,SUMO 将仅将 Highway.services 道路类型的权限分配给自行车、行人和送货车辆。 要修改它,您必须更改您正在使用的类型映射文件中的道路访问权限。这些位于 $SUMO_HOME/data/typemap 中。默认使用的文件名为osmNetconvert.typ.xml,然后可以更改权限添加或删除车辆类型,如下所示:

<type id="highway.service"        numLanes="1" speed="5.56"  priority="1"  oneway="false" allow="delivery pedestrian bicycle bus"/>

一旦权限正确,运行模拟就没有问题了。

【讨论】:

    猜你喜欢
    • 2020-06-28
    • 1970-01-01
    • 1970-01-01
    • 2020-09-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-03-22
    • 2012-01-23
    相关资源
    最近更新 更多