DLR-VF / TAPAS

MIT License
19 stars 9 forks source link

Generating a model for any city #6

Open dabreegster opened 3 years ago

dabreegster commented 3 years ago

Hi,

I'm interested in using TAPAS to generate reasonable activity models for A/B Street. The wiki link (https://wiki.dlr.de/display/MUD/TAPAS) seems to be down right now, so I'm just skimming the code to figure out what the inputs to the simulation are. I found things like https://github.com/DLR-VF/TAPAS/blob/e7bd4d9175e21f47d92033f68c03f8679036bad7/src/main/java/de/dlr/ivf/tapas/modechoice/TPS_UtilityMNLFullComplexIntermodal.java#L133 suggesting lots of this is hardcoded for Berlin, so I'm not even sure if the intention of the project is to generalize anywhere.

Say I want to generate an activity model for any arbitrary city in the US. I can use OpenStreetMap, the US census, and maybe some city-specific land use / parcel data to figure out rough demographics for the number of people living in each residential building. There are things like the American Commuter Survey that give statistics on what percentage of people commute to work by different modes, and how long their commute is, so that helps tune mode choice a bit. Is this the sort of input that TAPAS takes? What might be missing?

Thanks! -Dustin

schakalakka commented 3 years ago

Hi,

unfortunately the wiki is currently internally hosted and we didn't had the time to move it to the GitHub wiki yet. I created an issue #7 for that.

It is true that there is a lot of hardcoded stuff in there. Further clean up is necessary. But you can use this model for other regions. In fact we use TAPAS for a region in Lower Saxony, Germany too.

If you want to have general idea how the input data should look, have look at the Installer script. It creates a minimal database for a fictional (non-realistic) Berlin region. You can then run it with the sample scenario files provided in the data/Simulations folder Please note the database/tables layout is susceptible to change in the near future.

The most important ones (I probably forgot some): global_* tables which may be used for all regions like:

region based tables for example

If you don't want to run the installer yet you can have a look at the sql_dumps.zip (mainly core_tables and berlin) there are the sql scripts which will be executed in the installer.

Maybe @MHeinrichs can elaborate more on that.

I hope we get the wiki up as soon as possible.

dabreegster commented 3 years ago

Thank you for the information! I'll take a look at the generated DB tables and see how much we could reasonably produce for arbitrary US cities.

MHeinrichs commented 3 years ago

Hi there is a sql-script called core.create_region_based_tables(region character varying, schemaname character varying).

This creates empty tables for your new region. so a sql-query

select core.create_region_based_tables('portland', 'core')

would create all neccessary tables for a simulation regtion called portland in the schema core.

Now you have to fill them with meaningfull data:

  1. You need a spatial partition calles traffic ananlisisi zones (TAZ)
  2. You need Households and Persons for your region geographical distributed (for the beginning: put them in the centers of your TAZ)
  3. You need geo-Locations to perform activities with a reasonable capacity (eg: there are 1000 workplaces in the center of TAZ 2)
  4. You need an activity list derived from a national household survey (we will publish a paper how to import and prepare it soon, there is a old one)
  5. You need traveltimes and distances for your different modes of transport in a OD-matrix. There is a tool called CruisingSpeedGUI in package de.dlr.ivf.tapas.tools.matrixMap. This tool is not localized jet (thus German ;) ) but it can generate averagte traveltime matrices for different terrain-types, which work well for car, foot and bike, but not well for public transport.
  6. You need a lot of "tiny informations", which I forgot to mention. Fell free to ask, we try to find sollutions for it.
dabreegster commented 3 years ago

Sorry for the slow response, and thanks for the details! Next steps on our end will take a little while, and in the meantime we've also come across other possible tools like https://github.com/lcodeca/SUMOActivityGen that we're evaluating.

Step 2 is proving to be tougher than expected for the US; census data is not straightforward to work with. We're trying a simple approach in https://github.com/dabreegster/abstreet/issues/424 that also requires figuring out the population size for a given area, and we can reuse that effort when trying out TAPAS too.

Step 3 should be easy; we have existing code to find all commercial amenities from OpenStreetMap data and classify them into workplace types. Guessing the number of employees might be harder.

We also have contraction hierarchy-powered pathfinding that could help with step 5.