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>
11 lines
1.1 KiB
JSON
11 lines
1.1 KiB
JSON
{
|
|
"merknad": "Stiliserte tall, ikke norske. Domstolen er modellens tall i måned 24 i avsnitt 9.5 (sim.py, koordinert regel) ganget med 1000: prognose for innstrømningen 0,13432, kapasitet 0,10/0,95, restanse over målet 0,27316. Restansen 588,95 er dette overskuddet pluss 3 x kapasiteten; modellens kø i samme måned er 564,4, fordi sim.py regner målet som (3 - m_D) x kapasiteten. De andre leddene er satt under full utnyttelse for å vise diagnosen. Styringen er regime A i notatet og brukes bare av forlop.py.",
|
|
"styring": {"forsinkelse": 3, "reaktivitet": 3},
|
|
"ledd": [
|
|
{"navn": "Politi", "innstromning": 150, "kapasitet": 175, "restanse": 300, "maal_tid": 2},
|
|
{"navn": "Påtale", "innstromning": 140, "kapasitet": 160, "restanse": 200, "maal_tid": 1.5, "maks_andel_utenom": 0.1},
|
|
{"navn": "Domstol", "innstromning": 134.32, "kapasitet": 105.263, "restanse": 588.95, "maal_tid": 3,
|
|
"prognose_innstromning": 134.32, "maks_andel_utenom": 0.2},
|
|
{"navn": "Kriminalomsorg", "innstromning": 90, "kapasitet": 100, "restanse": 150, "maal_tid": 2}
|
|
]
|
|
}
|