Skip to content

faq 73891851

Billy Charlton edited this page Sep 5, 2018 · 2 revisions

Public Transport: trains labeled as cars

by Alessandra on 2016-07-13 09:14:56


Dear Matsim Users,
I'm simulating the public transport but, when I visualized on Via, the trains are drawn/colored/labeled as cars, and I don't understand why.

These are extracts from my input and output files


INPUT - CONFIG

<module name="scenario" >

<param name="useTransit" value="true" />

<param name="useVehicles" value="true" />

</module>

 

<module name="strategy">

<param name="ModuleProbability_4" value="0.1" />
<param name="Module_4" value="ChangeTripMode" />  <!-- I tried before ChangeLegMode -->

 

</module>


<module name="ChangeMode">
<param name="modes" value="car, pt, walk, bike" />
</module>

<module name="transit">
<param name="transitScheduleFile" value="&INBASE;/transitSchedule_L6.xml" />
<param name="vehiclesFile" value="&INBASE;/transitVehicles.xml" />
<param name="transitModes" value="pt" />

</module>

 

INPUT - NETWORK

<link id="1000333" from="533615952" to="533615952" length="10.0" freespeed="7.4" capacity="20.0" permlanes="1.0" oneway="1" modes="train" /> <!-- da="Reina Elisenda" a="Reina Elisenda" -->
<link id="1000334" from="533615952" to="323191073" length="570.0" freespeed="7.4" capacity="20.0" permlanes="1.0" oneway="1" modes="train" /> <!-- da="Reina Elisenda" a="Sarria" -->
<link id="1000335" from="323191073" to="330414111" length="453.8" freespeed="7.4" capacity="20.0" permlanes="1.0" oneway="1" modes="train" /> <!-- da="Sarria" a="Les Tres Torres" -->
<link id="1000336" from="330414111" to="1116623921" length="427.5" freespeed="7.4" capacity="20.0" permlanes="1.0" oneway="1" modes="train" /> <!-- da="Les Tres Torres" a="La Bonanova" →
etc...

INPUT - TRANSIT SCHEDULE

<transitRoute id="from Placa Catalunya to Reina Elisenda">
<transportMode>train</transportMode>

<routeProfile>

<stop refId="6039" departureOffset="00:00:00" />
<stop refId="6035" arrivalOffset="00:00:01" departureOffset="00:00:21" />
<stop refId="6031" arrivalOffset="00:03:11" departureOffset="00:03:31" />
etc....

</routeProfile>


<route>

<link refId="1000352" />
<link refId="1000351" />
etc...</route>


<departures>

<departure id="1" departureTime="05:45:00" vehicleRefId="tr_6001" />
<departure id="2" departureTime="05:50:00" vehicleRefId="tr_6002" />
<departure id="3" departureTime="05:55:00" vehicleRefId="tr_6003" />
etc...

 

 

INPUT - TRANSIT VEHICLES

<vehicleType id="2">
<description>train</description> <capacity> <seats persons="192"/>
<standingRoom persons="1020"/> </capacity> <length meter="108.0"/>
</vehicleType>

 


<vehicle id="tr_6001" type="2"/>
<vehicle id="tr_6002" type="2"/>
<vehicle id="tr_6003" type="2"/>
etc..



OUTPUT - EVENTS (after 10 iterations)

<event time="0.0" type="TransitDriverStarts" driverId="pt_tr_6016_2" vehicleId="tr_6016" transitLineId="Linea Treno L6" transitRouteId="from Placa Catalunya to Reina Elisenda" departureId="220" />
<event time="0.0" type="departure" person="pt_tr_6016_2" link="1000352" legMode="car" />
<event time="0.0" type="PersonEntersVehicle" person="pt_tr_6016_2" vehicle="tr_6016" />
<event time="0.0" type="TransitDriverStarts" driverId="pt_tr_6004_2" vehicleId="tr_6004" transitLineId="Linea Treno L6" transitRouteId="from Reina Elisenda to Placa Catalunya" departureId="220" />
<event time="0.0" type="departure" person="pt_tr_6004_2" link="1000333" legMode="car" />

 


Comments: 1


Re: Public Transport: trains labeled as cars

by Kai Nagel on 2016-08-09 09:14:48

(proxying for Marcel Rieser)

Dear all

I'm simulating the public transport but, when I visualized on Via, the trains are drawn/colored/labeled as cars, and I don't understand why.
This is indeed the case, and has to do with some historical reasons in MATSim. As Haitam pointed out, it is a known issue and we hope to fix it for the next release.
When I added pt mode to the QSim Main Modes, I ended up with two exceptions:
“pt” is the mode for the passengers to use Public Transport. The transit vehicles should actually use a different mode, more something like “bus”, “train”, “subway”, “tram”, etc.
In the transitSchedule.xml, one can define a transportMode, see http://www.matsim.org/docs/tutorials/transit. Ideally, MATSim would use that mode, but instead currently just uses “car” every time.
But, Via can fix this! These are the steps to follow:
- Load the Network, Vehicles, TransitSchedule and TransitStats layer in Via (requires the transit plugin for Via, included in the educational licenses).
- At the TransitStats-Layer, click on the triangle in the upper right to get a menu with additional commands. Select “Merge TransportModes to Vehicles”, as shown in the picture:
Via will then overwrite the “car” mode of transit vehicles with the transportMode specified in the transitSchedule.xml.
After that, you can use the correct modes to visualize the different types of vehicles differently.
Hope this helps!
Regards,
Marcel

--------------------------------
Marcel Rieser
Senozon AG
Schaffhauserstrasse 331
8050 Zürich
Schweiz / Switzerland
Tel: +41 44 520 14 62
www.senozon.com
See More from Haitam Lrb

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev_______________________________________________
matsim-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matsim-devel

Clone this wiki locally