SEMCOG / semcog_urbansim

7 stars 6 forks source link

Probability-based building type callback #12

Closed pksohn closed 6 years ago

pksohn commented 6 years ago

This PR implements an alternative callback function for the form_to_btype_callback parameter in the urbansim_parcels add_buildings function. This replaces the random_type callback that was used previously.

Where random_type selected a truly random allowed building type, the new function probable_type assigns a building type to new buildings based on probabilities for each type. The probabilities reflect the proportions of building types for each form in each large area in each simulation year. The register_btype_distributions registers a dictionary as an Orca injectable with the proportions mentioned above.

pksohn commented 6 years ago

Please let me know if you have any feedback, corrections, or general code review comments!

Eh2406 commented 6 years ago

Ping, I'm excited to try this. So I am hoping you can straighten out my confusion with the nits above.

pksohn commented 6 years ago

I just added a new commit to register building type distributions for every large area. Please take a look.

Eh2406 commented 6 years ago

Looks good to me, I will run a full run with this tonight! :-)