{"abstract":"Migration creates or destroys people when flows are applied sequentially.","category":"Epidemic compartment models","checks":7,"contract":"Each day: local frequency-dependent SIR in each patch using the current patch size, then every compartment exchanges fraction travel of each patch simultaneously; return [S pair, I pair, R pair] rounded 3.","evaluation_group":"w2-epidemic-two-patch-sir","failed_approach":"Forgetting the outflow from patch 1 adds travellers without removing them.","family":"w2-epidemic-two-patch-sir-simultaneous-exchange","id":"FA-65306","implementations":{"attempt":{"sha256":"1df42afc7f559e1831015d49c157e7ed44585c75c7a8e2b251626dd49b76eba5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, pops, i0s, travel, days):\n    s = [float(pops[k] - i0s[k]) for k in range(2)]\n    i = [float(x) for x in i0s]\n    r = [0.0, 0.0]\n    for _ in range(days):\n        n = [s[k] + i[k] + r[k] for k in range(2)]\n        inf = [beta * s[k] * i[k] / n[k] if n[k] > 0 else 0.0 for k in range(2)]\n        rec = [gamma * i[k] for k in range(2)]\n        for k in range(2):\n            s[k] -= inf[k]\n            i[k] += inf[k] - rec[k]\n            r[k] += rec[k]\n        for comp in (s, i, r):\n            a, b = comp[0] * travel, comp[1] * travel\n            comp[0] += b - a\n            comp[1] += a\n    return [[round(x, 3) for x in s], [round(x, 3) for x in i], [round(x, 3) for x in r]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"cbf3f5de93db34dc4b0461ed883369ef82b6a8af548fa1b7b86e55eb403bec27","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, pops, i0s, travel, days):\n    s = [float(pops[k] - i0s[k]) for k in range(2)]\n    i = [float(x) for x in i0s]\n    r = [0.0, 0.0]\n    for _ in range(days):\n        n = [s[k] + i[k] + r[k] for k in range(2)]\n        inf = [beta * s[k] * i[k] / n[k] if n[k] > 0 else 0.0 for k in range(2)]\n        rec = [gamma * i[k] for k in range(2)]\n        for k in range(2):\n            s[k] -= inf[k]\n            i[k] += inf[k] - rec[k]\n            r[k] += rec[k]\n        for comp in (s, i, r):\n            comp[0] += comp[1] * travel - comp[0] * travel\n            comp[1] += comp[0] * travel - comp[1] * travel\n    return [[round(x, 3) for x in s], [round(x, 3) for x in i], [round(x, 3) for x in r]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"ff3cdf895d98a7154256e91647ef57b387f795ea2105f8cb75fb2322caf37f15","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(beta, gamma, pops, i0s, travel, days):\n    s = [float(pops[k] - i0s[k]) for k in range(2)]\n    i = [float(x) for x in i0s]\n    r = [0.0, 0.0]\n    for _ in range(days):\n        n = [s[k] + i[k] + r[k] for k in range(2)]\n        inf = [beta * s[k] * i[k] / n[k] if n[k] > 0 else 0.0 for k in range(2)]\n        rec = [gamma * i[k] for k in range(2)]\n        for k in range(2):\n            s[k] -= inf[k]\n            i[k] += inf[k] - rec[k]\n            r[k] += rec[k]\n        for comp in (s, i, r):\n            a, b = comp[0] * travel, comp[1] * travel\n            comp[0] += b - a\n            comp[1] += a - b\n    return [[round(x, 3) for x in s], [round(x, 3) for x in i], [round(x, 3) for x in r]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])],\n [('regression: city and town',\n   (0.5, 0.2, [1000, 200], [10, 0], 0.05, 10),\n   [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]]),\n  ('control: isolated patches',\n   (0.4, 0.2, [500, 500], [5, 0], 0.0, 8),\n   [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]]),\n  ('regression: high mobility',\n   (0.6, 0.25, [300, 900], [0, 9], 0.3, 6),\n   [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]]),\n  ('regression: both seeded',\n   (0.3, 0.1, [800, 400], [4, 4], 0.1, 12),\n   [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]]),\n  ('control: boundary zero days',\n   (0.5, 0.2, [100, 100], [1, 1], 0.1, 0),\n   [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]]),\n  ('regression: equal patches',\n   (0.5, 0.2, [400, 400], [8, 0], 0.2, 5),\n   [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]]),\n  ('regression: tiny second patch',\n   (0.7, 0.3, [2000, 50], [20, 0], 0.02, 9),\n   [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Deterministic bounded teaching model with a stipulated contract; not a validated scientific or public-health modelling library. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-epidemic-two-patch-sir-simultaneous-exchange","generated_at":"2026-09-29T14:47:32.681785+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Compartmental epidemic calculations drive outbreak forecasts, vaccine targets and hospital planning; a single wrong flow, rate conversion or boundary silently changes every downstream number.","repair":"Restore the simultaneous exchange rule: `a, b = comp[0] * travel, comp[1] * travel / comp[0] += b - a / comp[1] += a - b`.","root_cause":"The second patch exchange uses the already-updated first patch.","sha256":"f4b43744712beb9a68a0a980de5849b8127f43f13a2558de4b5989f9df5b754a","title":"Two-patch SIR with daily migration: simultaneous exchange · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.759,"exit_code":1,"observations":[{"actual":[[638.763,552.634],[76.423,48.388],[53.574,32.89]],"check":"regression: city and town","expected":[[611.99,397.105],[74.874,37.65],[52.607,25.773]],"passed":false},{"actual":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"check":"control: isolated patches","expected":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"passed":true},{"actual":[[1242.173,2016.099],[62.297,101.697],[38.942,63.589]],"check":"regression: high mobility","expected":[[557.673,559.801],[25.331,25.533],[15.766,15.895]],"passed":false},{"actual":[[797.005,1185.958],[49.441,77.246],[23.127,36.223]],"check":"regression: both seeded","expected":[[565.74,538.406],[32.741,32.614],[15.262,15.237]],"passed":false},{"actual":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"check":"control: boundary zero days","expected":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"passed":true},{"actual":[[508.656,797.564],[16.895,21.017],[8.466,10.475]],"check":"regression: equal patches","expected":[[377.224,380.426],[15.15,13.039],[7.625,6.535]],"passed":false},{"actual":[[1242.789,291.335],[242.82,49.833],[216.498,43.292]],"check":"regression: tiny second patch","expected":[[1241.271,264.206],[242.617,45.744],[216.332,39.829]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: city and town\", \"actual\": [[638.763, 552.634], [76.423, 48.388], [53.574, 32.89]], \"expected\": [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]], \"passed\": false}, {\"check\": \"control: isolated patches\", \"actual\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"expected\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"passed\": true}, {\"check\": \"regression: high mobility\", \"actual\": [[1242.173, 2016.099], [62.297, 101.697], [38.942, 63.589]], \"expected\": [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]], \"passed\": false}, {\"check\": \"regression: both seeded\", \"actual\": [[797.005, 1185.958], [49.441, 77.246], [23.127, 36.223]], \"expected\": [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]], \"passed\": false}, {\"check\": \"control: boundary zero days\", \"actual\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"expected\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"passed\": true}, {\"check\": \"regression: equal patches\", \"actual\": [[508.656, 797.564], [16.895, 21.017], [8.466, 10.475]], \"expected\": [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]], \"passed\": false}, {\"check\": \"regression: tiny second patch\", \"actual\": [[1242.789, 291.335], [242.82, 49.833], [216.498, 43.292]], \"expected\": [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.224,"exit_code":1,"observations":[{"actual":[[609.949,389.059],[74.517,36.215],[52.35,24.752]],"check":"regression: city and town","expected":[[611.99,397.105],[74.874,37.65],[52.607,25.773]],"passed":false},{"actual":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"check":"control: isolated patches","expected":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"passed":true},{"actual":[[600.353,607.546],[29.366,30.045],[18.337,18.77]],"check":"regression: high mobility","expected":[[557.673,559.801],[25.331,25.533],[15.766,15.895]],"passed":false},{"actual":[[558.307,526.582],[32.705,32.553],[15.255,15.224]],"check":"regression: both seeded","expected":[[565.74,538.406],[32.741,32.614],[15.262,15.237]],"passed":false},{"actual":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"check":"control: boundary zero days","expected":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"passed":true},{"actual":[[378.669,383.111],[14.196,11.262],[7.135,5.627]],"check":"regression: equal patches","expected":[[377.224,380.426],[15.15,13.039],[7.625,6.535]],"passed":false},{"actual":[[1240.935,260.206],[242.549,44.932],[216.271,39.103]],"check":"regression: tiny second patch","expected":[[1241.271,264.206],[242.617,45.744],[216.332,39.829]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: city and town\", \"actual\": [[609.949, 389.059], [74.517, 36.215], [52.35, 24.752]], \"expected\": [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]], \"passed\": false}, {\"check\": \"control: isolated patches\", \"actual\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"expected\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"passed\": true}, {\"check\": \"regression: high mobility\", \"actual\": [[600.353, 607.546], [29.366, 30.045], [18.337, 18.77]], \"expected\": [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]], \"passed\": false}, {\"check\": \"regression: both seeded\", \"actual\": [[558.307, 526.582], [32.705, 32.553], [15.255, 15.224]], \"expected\": [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]], \"passed\": false}, {\"check\": \"control: boundary zero days\", \"actual\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"expected\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"passed\": true}, {\"check\": \"regression: equal patches\", \"actual\": [[378.669, 383.111], [14.196, 11.262], [7.135, 5.627]], \"expected\": [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]], \"passed\": false}, {\"check\": \"regression: tiny second patch\", \"actual\": [[1240.935, 260.206], [242.549, 44.932], [216.271, 39.103]], \"expected\": [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.344,"exit_code":0,"observations":[{"actual":[[611.99,397.105],[74.874,37.65],[52.607,25.773]],"check":"regression: city and town","expected":[[611.99,397.105],[74.874,37.65],[52.607,25.773]],"passed":true},{"actual":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"check":"control: isolated patches","expected":[[464.204,500.0],[19.812,0.0],[15.984,0.0]],"passed":true},{"actual":[[557.673,559.801],[25.331,25.533],[15.766,15.895]],"check":"regression: high mobility","expected":[[557.673,559.801],[25.331,25.533],[15.766,15.895]],"passed":true},{"actual":[[565.74,538.406],[32.741,32.614],[15.262,15.237]],"check":"regression: both seeded","expected":[[565.74,538.406],[32.741,32.614],[15.262,15.237]],"passed":true},{"actual":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"check":"control: boundary zero days","expected":[[99.0,99.0],[1.0,1.0],[0.0,0.0]],"passed":true},{"actual":[[377.224,380.426],[15.15,13.039],[7.625,6.535]],"check":"regression: equal patches","expected":[[377.224,380.426],[15.15,13.039],[7.625,6.535]],"passed":true},{"actual":[[1241.271,264.206],[242.617,45.744],[216.332,39.829]],"check":"regression: tiny second patch","expected":[[1241.271,264.206],[242.617,45.744],[216.332,39.829]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: city and town\", \"actual\": [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]], \"expected\": [[611.99, 397.105], [74.874, 37.65], [52.607, 25.773]], \"passed\": true}, {\"check\": \"control: isolated patches\", \"actual\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"expected\": [[464.204, 500.0], [19.812, 0.0], [15.984, 0.0]], \"passed\": true}, {\"check\": \"regression: high mobility\", \"actual\": [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]], \"expected\": [[557.673, 559.801], [25.331, 25.533], [15.766, 15.895]], \"passed\": true}, {\"check\": \"regression: both seeded\", \"actual\": [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]], \"expected\": [[565.74, 538.406], [32.741, 32.614], [15.262, 15.237]], \"passed\": true}, {\"check\": \"control: boundary zero days\", \"actual\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"expected\": [[99.0, 99.0], [1.0, 1.0], [0.0, 0.0]], \"passed\": true}, {\"check\": \"regression: equal patches\", \"actual\": [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]], \"expected\": [[377.224, 380.426], [15.15, 13.039], [7.625, 6.535]], \"passed\": true}, {\"check\": \"regression: tiny second patch\", \"actual\": [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]], \"expected\": [[1241.271, 264.206], [242.617, 45.744], [216.332, 39.829]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}