Adapt calculation/generation of number inhabitants #8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's this about?
While working on PR#7, I came across data from Zensus2011 to improve the generation of occupant number per flat. As with the other PR: if this doesn't fit your schedule/plan, I completely understand a refusal.
How was it handled before?
Previously, the number of occupants was selected on random from 2-5 (SFH&TH) or 1-4 (MFH&AB).
What was the problem with this implementation?
There really was no problem per se. I just found data that supported a more differentiated selection to represent the conditions in Germany.
How is it implemented now?
Zensus 2011 data lists the number of flats with a certan number of occupants (1 to 6+), sorted by the number of flats per building. The latter helps to sort the values according to the building type (SFH, TH, MFH, AB).
Considering SFH, taking the number of flats with 1 occupant and dividing it by the number of flats in SFH-buildings in total gives us the probability of a single person living in a flat of a SFH-type building. This is calculated for all building types. The corresponding probability values of a building type are then used to select the number of occupants in each flat of the building.
The category "6+ occupants" is considered as 6 occupants. Only 2.3/0.9/0.8 percent (!) of the flats of SFH-/MFH-/AB-type buildings fall into that category, respectively.