matsim-code-examples icon indicating copy to clipboard operation
matsim-code-examples copied to clipboard

Multiple plans calibration

Open MAlbertini95 opened this issue 5 years ago • 6 comments

Dear MATSim crew, I’m trying to build a scenario for my thesis, so I choose a case study: by now, I have extracted the xml network from OSM. For Demand construction, I used PopGen and Actitopp to generate a set of 5 plans for agent, which now I have to translate in .xml format. What I would like to do is then calibrate this plans with traffic counts using Cadyts. For constructing the plans, I had a commuter matrix representing the city at 12 zones ( not too big as the city is 112k residents) and according to this matrix, I assigned random commuting destinations using Traffic Zones ( desired resolution ), coherent with upper spatial resolution, but still to be calibrated thoroughly; later I draw casual coordinates by overlapping Traffic Zone data and Land use data. So I’d like to calibrate this set of 5 plans in order to represents real situation. My question are: • Is this idea feasible? • Do you have a population.xml file with different plans to use as reference? ( Do I have to set as just one schedule? ) • How about modes, in your pubblications I read about the integration, is it necessary to set at first only cars? • And, last one, it would be interesting to simulate also <18 people, for whom by now I have the schedule, is this possible? I have some infos like the possession of license and age which I like to introduce in the population.xml file, is it possible to use them as conditions for choosing transport mode in MATSim? Thank in advance, hope you can help. Best Regards,

MAlbertini95 avatar Sep 30 '19 22:09 MAlbertini95

I'm no expert in Cadyts, so I can only comment on the other things:

Do you have a population.xml file with different plans to use as reference? ( Do I have to set as just one schedule? )

If you run a simple example for a few iterations, the output_plans.xml should contain multiple plans per agent. In XML, it is very simple by just having multiple plan-tags per person, something like this:

<person id="..." >
  <plan> <!-- this is the first plan -->
    <activity type="home" end_time="..." ... />
    <leg mode="car" ..../>
    ....
    <activity type="home" />
  </plan>
  <plan> <!-- this is the second plan -->
    <activity type="home" end_time="..." ... />
    <leg mode="car" ..../>
    ....
    <activity type="home" />
  </plan>
  ... <!-- additional plans could go here -->
</person>

How about modes, in your publications I read about the integration, is it necessary to set at first only cars?

To get started with a new scenario, it's easier to start very simple, e.g. only car-traffic, and add additional modes at a later stage when you know that the basic setup works and runs fine. It's easier to debug at the beginning, as there are less opportunities to make mistakes when you only have car. But once you mastered this setup, you can set any mode for the legs in the initial demand creation as your model will support.

it would be interesting to simulate also <18 people, for whom by now I have the schedule, is this possible? I have some infos like the possession of license and age which I like to introduce in the population.xml file, is it possible to use them as conditions for choosing transport mode in MATSim?

Yes. The SubtourModeChoice module has a configuration parameter considerCarAvailability, which when set to true will disallow agents using "car" when they have an attribute hasLicense which is set to no, or when they have an attribute carAvail set to never. (The names and values must be exactly like this, which has historic reasons).

mrieser avatar Oct 07 '19 12:10 mrieser

Thank you for the answer, it's been very useful. So I generated the population/plans.xml .. I wonder if you could please tell me how to practically integrate Cadyts and Matsim: as I understood I have to copy add the dependency in the pom.xml file and then? Lastly, which is the best tool for considering AV taxis and analysing the output? Are there any other modules useful for simulating traffic/managing the taxi service? Thank you and Best Regards

MAlbertini95 avatar Oct 19 '19 18:10 MAlbertini95

Lastly, which is the best tool for considering AV taxis and analysing the output? Are there any other modules useful for simulating traffic/managing the taxi service?

One option is to use the DVRP module. You can find some more detailed info on this topic here: https://github.com/matsim-org/matsim-maas

michalmac avatar Oct 19 '19 20:10 michalmac

Hello @mrieser, Sorry for opening this topic. I have looked at the SubtourModeChoice module implementation, but I don't see where the car driving license is considered.

https://github.com/matsim-org/matsim-libs/blob/675d96bbd7333a50ebdde3af34bf53b5d6ed24d9/matsim/src/main/java/org/matsim/core/population/algorithms/ChooseRandomLegModeForSubtour.java#L177 and https://github.com/matsim-org/matsim-libs/blob/675d96bbd7333a50ebdde3af34bf53b5d6ed24d9/matsim/src/main/java/org/matsim/core/population/algorithms/ChooseRandomLegMode.java

Can you point me where this checking is performed?

Best, Azise

diallitoz avatar Sep 15 '22 09:09 diallitoz

Hi Azise,

The allowed modes are determined by the PermissibleModesCalculator:

https://github.com/matsim-org/matsim-libs/blob/675d96bbd7333a50ebdde3af34bf53b5d6ed24d9/matsim/src/main/java/org/matsim/core/population/algorithms/ChooseRandomLegModeForSubtour.java#L147

https://github.com/matsim-org/matsim-libs/blob/675d96bbd7333a50ebdde3af34bf53b5d6ed24d9/matsim/src/main/java/org/matsim/core/population/algorithms/PermissibleModesCalculatorImpl.java#L57

This is then passed to the method you are pointing at. I hope this helps.

balacmi avatar Sep 15 '22 14:09 balacmi

Hi Milos,

Thank you for your answer.

This is what I m looking for :)

diallitoz avatar Sep 16 '22 12:09 diallitoz