Alejandro Rodriguez
Alejandro Rodriguez

Reputation: 51

Bus stops and routes in SUMO

I recently started using SUMO traffic simulator and I am trying to simulate an intermodal network. I've been able of launch a simulation with cars and buses using vTypeDistribution and randomTrips.py. Now I am trying to simulate a realistic public transport network using ptlines2flows.py. I am able to obtain all the bus stops and trips, but not to obtain the routes. In fact I get multiple warnings like this: Warning: busStop '25902051' for vehicle '55_subway_L4:0' on lane '497770366_0' is not downstream the current route. and 0 vehicles are loaded. Also, I get this error:

Error: Vehicle '39_bus_73:0' is not allowed on any lane of via edge '45100166#0'.

It seems that the program tries to put a bus in metro/underground lines.

I attach my bash script where I do everything:

#!/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

Would you be so kind to help me? I would really appreciate it, I've been stucked with this a few days...

Upvotes: 0

Views: 814

Answers (1)

Alejandro Rodriguez
Alejandro Rodriguez

Reputation: 51

I got it finally, the problem was in the network and lanes permissions. Apparently, if you import an OpenStreetMap file, SUMO assignes permissions to highway.services road type only to bicicles, pedestrians and delivery vehicles. To modify this, you have to change the road access permissions in the typemap file you are using. Those are located in $SUMO_HOME/data/typemap. The file used by default is called osmNetconvert.typ.xml, then you can change the permissions adding or removing vehicle type, it looks like this:

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

Once the permissions are correct, there was no problem running the simulation.

Upvotes: 2

Related Questions