matsim-org / matsim-code-examples

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

Inquiry about vehicle initialization #245

Closed LittleStone650 closed 4 years ago

LittleStone650 commented 4 years ago

When I searched the manual, I didn't find the configuration about vehicle initialization, so I would like to inquire about the vehicle initialization. (1) We all know that the number of cars and buses in a city are limited. I want to know where the number of these vehicles can be defined in matsim. (2) The initial position of the vehicle. Where was the initial position of the private car when it was first run? Family? Where is the initial position of the taxi, the bus, as well as the subway? (3)Passengers need to buy tickets to enter, so what is the current ticketing model of pt? This work helps us understand the profitability of urban public transportation.

Another question is, does Matsim support interaction between multiple modes of transportation? For example, some people may need to walk to a bicycle station first, then ride to a subway station, take a subway and then transfer to a bus, then walk to a bicycle station, and then ride for a while to return the bicycle before finally walking to the company. How to complete the transfer and interaction of various transportation modes in matsim.

Janekdererste commented 4 years ago

Our userguide contains information for most of your questions.

  1. Chapter 6.6 and 7 will help you understand vehicles. By default each agent receives one vehicle for each available type during the simulation. It is also possible to define your own vehicles in a vehicle file, but you have to manually assign these vehicles to your agents before the simulation is started
  2. Chapter 16 describes how pt is modelled. For each run a new vehicle is created and is therefore located at the starting point of a line
  3. There is no explicit ticketing modell in matism. Ticket prices are modelled via the ASCs for PT. One could for example add a dailyMonetaryConstant to reflect the price of a monthly pass or a disutility-constant which is added for each PT-Trip to model single passes.
  4. Inter-modal-routing is possible in principle but not yet stable.
kainagel commented 4 years ago

The reference to the userguide is a good one. I think that that document also states that matsim is currently not very good on initial vehicle positions. There are various levels of automagical fixes which, e.g., place the vehicle where it is first needed. This fails when the same vehicle is shared by multiple persons, and this also means that pt (public transport) vehicles do not start/end at the depot.

For passenger cars/bicycles/..., one could try the following:

For pt vehicles, I don't know. One should have the bus/train drivers as normal synthetic persons who first travel to the depot, pick up their vehicle, etc. This is somewhere on the todo list, but it feels like a lot of complicated retrofitting. The relevant concept in German is called "Umlauf", and in consequence the MATSim class is called UmlaufBuilder. See https://en.wikipedia.org/wiki/Working_timetable . One would need to modify the TransitQSimEngine that it somehow takes such complete bus/train driver plans as input. I.e. get schedule (e.g. from GTFS), translate into matsim schedule, generate "Umläufe" from that, and then add trips from/to depot. Can't say how hard this would be; in principle, there is already TransitQSimEngine#createAndScheduleVehicleAndDriver, which looks like doing the right thing.

The the "intermodal" question: This is more or less addressed in the development head of matsim. It should also be in the next release, matsim-12. Please expect that there will be remaining issues/bugs/kinks; it is not an easy thing.

I am also closing this since it is an older question. Could you please open another issue if you want to continue this discussion, referring to this here? (Also, could you please make separate issues per question; a paragraph starting with "Another question is ..." makes it difficult for us to trace things item by item. Thanks.)