forlop.py now puts the backlog from the input file straight into the
model at the time the numbers apply, instead of letting the model build
it up itself (which reached at most 15 months and left larger backlogs
"ikke regnet"). It carries its own copy of the simulate_endo loop
(simuler, policies koord and sched) and checks on every run that the
copy matches sim.py bit for bit. sim.py and paper/data are untouched
(22/22 data files identical after a fresh run).
The example file gives the same numbers as before (+19 %, +12 %, 1,31;
8,3 / 0,74 / 1,10 / +31 % / 3,5; 68,7 / 0,65 / 1,26). A copy with
backlog 3000 now gives a course starting at 3 000 (+119 %). The course
is not computed when crime falls below 0,80 or police effort below 0,50
in the model while the backlog is cleared.
Independent review before commit: 8 findings, 7 fixed (the eighth is an
older column-width issue for seven-digit numbers).
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
New script paper/forlop.py reads the same input file as diagnose.py.
It checks whether the steering tolerates its own delay, places the
binding link in the model as the link with a queue, calibrates the size
and start of the increase so that the coordinated rule's first budget
decision sees the numbers in the file, and runs simulate_endo month by
month with and without measures. It also reports what the measure does
to the rest of the chain: police effort, the share diverted, and whether
the bottleneck moves to the links after it.
The example file reproduces section 9.5 and table 10: +19 % now, +12 %
after 12 months, capacity 1,31; 8,3 / 0,74 / 1,10 / 3,5 with measures and
68,7 / 0,65 / 1,26 without. The stability block reproduces section 9.3
with delay 11 and reactivity 3. The script declines to print a time
course when the steering is unstable, when the forecast has not settled
within the horizon, or when the model cannot build the backlog in the
file before the first decision.
sim.py is imported unchanged; paper/data is untouched. diagnose.py gives
identical output for both input files; the bottleneck selection is now a
function so forlop.py can reuse it, and true/false are rejected where a
number is expected. Reviewed by an independent agent; its 14 findings
are addressed.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>