Answer prose round 1: one name for a place holding most of a postal code's land, the decision leaves the seeding to the code, and the test says what it checks

This commit is contained in:
2026-10-11 16:38:42 +02:00
committed by Lillem4n
parent 9360447254
commit 7f5a0cb63c
8 changed files with 21 additions and 24 deletions
+1 -1
View File
@@ -129,7 +129,7 @@ def localities(cache, counties):
def drawn(places, share):
"""The share of the places with people, each drawn with odds by its population: Efraimidis and Spirakis's weighted
sampling without replacement. Each place's random number is seeded by its code, so a place added or dropped from
sampling without replacement. Each place's random number is seeded by its code, so a place added to or dropped from
the sources moves only the places near the cut."""
peopled = [code for code, p in places.items() if p["population"] > 0]
key = {code: math.log(1 - random.Random(code).random()) / places[code]["population"] for code in peopled}