a-b-street / abstreet

Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit
https://a-b-street.github.io/docs/
Apache License 2.0
7.78k stars 347 forks source link

Make proletariat robot model configurable #805

Open bezdna opened 3 years ago

bezdna commented 3 years ago

image this image for building = apartments and have 645 drivers, 1 cyclist and 22 other. I believe that for different regions there should be a different distribution, for example for Ukraine, 50 cars, 1 bicyclist, 300 workers, 200 pensioners. that is, there are much fewer cars in traffic, but more public transport in the morning and evening, and 200 for retirees at any time.

you can also take into account the number of storeys of buildings and the number of apartments, because sometimes there is this data in the OCM, and not just the area.

that is, to make the setting more general and not take very accurate data, say, from mobile operators or someone else.

Robinlovelace commented 3 years ago

Hi @bezdna do you have any more details? E.g. what have you done so far and which settings would you like to see. At present this issue does not contain enough detail for it to be useful.

bezdna commented 3 years ago

have you done so far and which settings would you like to see. At present this issue does not contain enough detail for it to be useful.

updated proposal

Robinlovelace commented 3 years ago

Great to see the detail. If you can list the steps you took to get to that screenshot, e.g. for which city, which scenario, and where is that building, that could also be useful.

bezdna commented 3 years ago

this geoJSON https://gist.github.com/bezdna/5e44b8e901db30950356b5a315c86b0b this building https://www.openstreetmap.org/way/398544650 scenario: home to work

it is certainly possible to find real scenarios, but it takes a lot of time and effort, and can also cost a lot of money. My opinion is that using data from the OSM and slightly modifying them, you can generate quite adequate data for small and medium-sized cities.

for example, knowledge about the number of children in the garden, it can be perfectly assumed that parents should be brought there by car or in another way at a certain time.

Knowing the approximate number of workers at the plant, you can also take them into account when constructing scenarios.

Well, and the last group, there are, say, roads that leave the script graph (people work elsewhere.) for these points of the graph it would be good to determine the number of people (transport) in the form of a number or percentage of the number of inhabitants of a particular area that is being analyzed.

dabreegster commented 3 years ago

Hello, thank you for the ideas! This home-to-work scenario uses the "proletariat robot" activity model that @matkoniecz started some time ago. The key idea of it is just what you said -- just by looking at OSM building tags, we could get pretty far generating a reasonable number of people in different homes and assigning them a workplace.

The logic to assign a number of people based on OSM building tags is pretty well-contained here: https://github.com/a-b-street/abstreet/blob/7d6b720099fa358ede31f964e8f5b5bc9c262570/map_model/src/make/buildings.rs#L137

To help people rapidly generate travel demand models more tuned to their region, I have a few ideas about how to take this activity model further.

1) We could expose a few settings in a UI, like the typical number of working-age people per square-meter, and keep using the same core logic

2) For people with more advanced OSM knowledge, encourage them to come up with their own logic for estimating number of people per building, using the tags as input. Depending what programming languages they're comfortable with, we could make it more convenient to call a Python or R script, for example

3) We could look into using https://www.worldpop.org/ to estimate population

matkoniecz commented 3 years ago

For people with more advanced OSM knowledge, encourage them to come up with their own logic for estimating number of people per building, using the tags as input.

OSM has: building geometry (taken into account as ground_area_sq_meters), building with most values taken into account ( https://taginfo.openstreetmap.org/keys/building#values ), building:levels

What can be done in software: take into account height building:height tags if building:levels is not tagged. Guess/randomize building values for building=yes (based on what is nearby? based on building size?). Better guess targets.

What can be done in OSM data: map building types and floor count. I recommend https://github.com/streetcomplete/StreetComplete available as an Android app. (it will also ask about lane count and road names if missing and some other info and plenty of info not used by AB).

Map targets like offices/shops/etc.

Map buildings and roads if missing.

matkoniecz commented 3 years ago

Maybe have an ability to specify desire population on a given map as a parameter. And during map generation allocate people until all are placed somewhere?

Lets say that we have toy area with 1000 people, 99 buildings marked building=yes and 1 building=apartments. AB would initially allocate 50 people to single residential building, notice problem and turn random building=yes into building=apartments until all people are allocated.

This would has nice benefit that mapping more detailed OSM data will not require rebalancing density parameters, just would make allocation better matching reality.

matkoniecz commented 3 years ago

Hmmm, maybe objects with address (or address node on them), relatively small and with building=yes can be upgraded to houses? https://www.openstreetmap.org/way/741214623