code wiki / (root) / nx_town_quality.nx

nx_town_quality.nx

buildroot/runtime/nx_town_quality.nx

6375 B156 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_town_quality.nx -- per-kind grader for nx_town_layout output. Samples a town's cell-type field on a grid and grades on 5 axes: 0. ROAD_CONNECTIVITY: fraction of cells that are ROAD; target band [10%, 25%] for healthy circulation. 1. BUILDING_DENSITY: fraction of cells that are BUILDING; target [30%, 60%]. 2. PLAZA_PRESENCE: ratio of plaza cells / total; target [2%, 10%]. 3. WALL_INTEGRITY: for walled types, wall cells / perimeter estimate. Skipped for unwalled. 4. ZONE_BALANCE: building_count / (road + plaza + 1) -- catches over-built towns with no public space. EMITS LAYER_VERDICT (kind = NX_LAYER_KIND_TOWN). genealogy_id: morris_1979_urban_form + sjoberg_1960 lineage_id: nx_town_quality_5axis_v1

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_layer_verdict.nx nx_town_quality.nx

imports: nx_syscalls.nxnx_tier.nxnx_layer_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nx_town_quality_grade nx_layer_verdict_init nx_layer_verdict_finalize nx_layer_grade_from_axes nx_lv_axis_verdict _tq_band_score nx_lv_grade_is_valid

structs

none

consts

31const NX_TQ_CELL_VOID: nx_int = 0
32const NX_TQ_CELL_BUILDING: nx_int = 1
33const NX_TQ_CELL_ROAD: nx_int = 2
34const NX_TQ_CELL_PLAZA: nx_int = 3
35const NX_TQ_CELL_WALL: nx_int = 4
37const NX_TQ_Q: nx_int = 16384
39const NX_TQ_AXIS_ROAD_CONN: nx_int = 0
40const NX_TQ_AXIS_BUILDING_DENS: nx_int = 1
41const NX_TQ_AXIS_PLAZA: nx_int = 2
42const NX_TQ_AXIS_WALL_INTEG: nx_int = 3
43const NX_TQ_AXIS_ZONE_BAL: nx_int = 4
44const NX_TQ_AXIS_COUNT: nx_int = 5

functions

49func _tq_band_score(val: nx_int, lo_q: nx_int, hi_q: nx_int) -> nx_int
67func nx_town_quality_grade(
109func main() -> i64