matsim-org / matsim-code-examples

A repository containing code examples around MATSim
GNU General Public License v3.0
81 stars 177 forks source link

'route type: generic' What does this mean? #225

Open shenlonghu opened 4 years ago

shenlonghu commented 4 years ago

In output_plan.xml, when 'leg mode=walk or PT', the 'route type=generic'. What does this mean? why i can't see the path of each agent.

mrieser commented 4 years ago

Most likely this means that agents using walk or pt are teleported, in which case the agents do not have a route, as the travel time is only estimated based on the beeline distance between origin and destination.

For having exact routes for pt, you would need to enable public transport ("transit") in the config.xml and provide it the transitSchedule and transitVehicles.

shenlonghu commented 4 years ago

Am I able to make pedestrains' trip has exact routes in MATSim? I am doing a University Campus traffic model, and I think walk is a important traffic mode here.

kainagel commented 4 years ago

@shenlonghu Yes, should be possible. As a starting point, see http://ci.matsim.org:8080/job/MATSim-Book/ws/partOne-latest.pdf Chap. 7.1. There will be a couple of issues: (1) walk is handled in multiple special ways in MATSim. The reason is that one needs connections between activity locations and the network, and often they are not in the data model, so they are computed on the fly. I often call this "bushwhacking walk", and it is denoted as access_walk or egress_walk or transit_walk or non_network_walk or sometimes simple walk. Unfortunately, the implementation is not totally clean. So I would strongly recommend to name the network walking mode you are interested in something else, e.g. networkWalk. (2) You will have to attribute the network with that mode. The above-mentioned chapter 7.1 should explain how this is done.

In terms of building the model, I would recommend something like the following:

  1. Build a simple model using only car as a network mode. (in router, in qsim, as discussed in ch.7.1). Make it work.
  2. Replace "car" by "networkWalk" everywhere. Your first try presumably won't work because you don't have attributed the links in the network file ... each link needs to have <link ... modes="networkWalk" ... />. Add that and make it work.
  3. Try to re-add "car", i.e. use car,networkWalk everywhere including in the network file.

Actually, https://github.com/matsim-org/matsim-code-examples/blob/11.x/src/main/java/org/matsim/codeexamples/integration/RunMultipleModesExample.java should be an example. Note that it is made for 11.x, so unfortunately it won't work for the 10.0 release. I think that it is possible to make work with 10.0, but finding the right combination of config settings is not totally easy. If you prefer 10.0, let me know and I will try to back-port the example. Otherwise, please consider using a weekly 11.x release.

Please keep us posted how it goes.