FAILURE MAP
← Case archive

FA-65636 / Ecological population dynamics / Open access

Nicholson-Bailey host-parasitoid generations: host equilibrium · case 01

The host equilibrium is understated by a factor lam.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The lam multiplier in H* is omitted.

VERIFIED REPAIR

Restore the host equilibrium rule: `lam * math.log(lam) / ((lam - 1) * a * c)`.

Unsuccessful approach: Dropping c ignores parasitoids per attacked host.

Case contract

Escape fraction exp(-a*P); H' = lam*H*escape and P' = c*H*(1-escape) computed from the same generation; equilibrium [lam*ln(lam)/((lam-1)*a*c), ln(lam)/a] rounded 4 when lam>1, a>0, c>0 else None; return [equilibrium, trajectory of [H,P] rounded 4].

Why this case matters

Population projections set harvest quotas, conservation status and pest-control timing; a wrong update order, boundary or rate conversion silently changes management advice.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(lam, a, c, h0, p0, gens):
    if lam <= 1 or a <= 0 or c <= 0:
        eq = None
    else:
        eq = [round(math.log(lam) / ((lam - 1) * a * c), 4), round(math.log(lam) / a, 4)]
    h, p = float(h0), float(p0)
    traj = []
    for _ in range(gens):
        escape = math.exp(-a * p)
        h, p = lam * h * escape, c * h * (1 - escape)
        traj.append([round(h, 4), round(p, 4)])
    return [eq, traj]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]])],
 [('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])],
 [('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])],
 [('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])],
 [('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: greenhouse whitefly[[13.8629, 13.8629], [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]][[27.7259, 13.8629], [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]Failed
regression: fecund host[[5.0295, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]][[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]Failed
regression: no parasitoids[[8.1093, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]][[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]Failed
regression: no hosts[[6.9315, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]][[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]Failed
control: non-growing host[None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]][None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]Passed
regression: inefficient parasitoid[[109.8612, 109.8612], [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]][[329.5837, 109.8612], [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]Failed
control: invalid search[None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]][None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]Passed

SHA-256 / c22ce82557238bf27b08062cfd168bf22756988a60b46c90705271f80c96db60

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(lam, a, c, h0, p0, gens):
    if lam <= 1 or a <= 0 or c <= 0:
        eq = None
    else:
        eq = [round(lam * math.log(lam) / ((lam - 1) * a), 4), round(math.log(lam) / a, 4)]
    h, p = float(h0), float(p0)
    traj = []
    for _ in range(gens):
        escape = math.exp(-a * p)
        h, p = lam * h * escape, c * h * (1 - escape)
        traj.append([round(h, 4), round(p, 4)])
    return [eq, traj]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]])],
 [('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])],
 [('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])],
 [('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])],
 [('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: greenhouse whitefly[[27.7259, 13.8629], [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]][[27.7259, 13.8629], [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]Passed
regression: fecund host[[20.118, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]][[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]Failed
regression: no parasitoids[[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]][[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]Passed
regression: no hosts[[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]][[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]Passed
control: non-growing host[None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]][None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]Passed
regression: inefficient parasitoid[[164.7918, 109.8612], [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]][[329.5837, 109.8612], [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]Failed
control: invalid search[None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]][None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]Passed

SHA-256 / 776a7af5bb5542a60630f2c331c6a5f7d4eb75db05e8a10af1556ab18bca9729

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(lam, a, c, h0, p0, gens):
    if lam <= 1 or a <= 0 or c <= 0:
        eq = None
    else:
        eq = [round(lam * math.log(lam) / ((lam - 1) * a * c), 4), round(math.log(lam) / a, 4)]
    h, p = float(h0), float(p0)
    traj = []
    for _ in range(gens):
        escape = math.exp(-a * p)
        h, p = lam * h * escape, c * h * (1 - escape)
        traj.append([round(h, 4), round(p, 4)])
    return [eq, traj]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]])],
 [('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])],
 [('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])],
 [('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('regression: no hosts',
   (2.0, 0.1, 1.0, 0, 10, 3),
   [[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])],
 [('regression: greenhouse whitefly',
   (2.0, 0.05, 1.0, 30, 10, 5),
   [[27.7259, 13.8629],
    [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]),
  ('regression: fecund host',
   (5.0, 0.1, 0.8, 20, 5, 4),
   [[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]),
  ('regression: no parasitoids',
   (1.5, 0.1, 1.0, 10, 0, 4),
   [[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]),
  ('control: non-growing host',
   (1.0, 0.1, 1.0, 10, 2, 3),
   [None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]),
  ('regression: inefficient parasitoid',
   (3.0, 0.01, 0.5, 100, 20, 4),
   [[329.5837, 109.8612],
    [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]),
  ('control: invalid search', (2.0, 0.0, 1.0, 10, 2, 3), [None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]),
  ('regression: gregarious parasitoid',
   (2.5, 0.03, 2.0, 40, 8, 5),
   [[25.4525, 30.543],
    [[78.6628, 17.0698], [117.8447, 63.0498], [44.4411, 200.1366], [0.2743, 88.6628], [0.048, 0.5102]]])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: greenhouse whitefly[[27.7259, 13.8629], [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]][[27.7259, 13.8629], [[36.3918, 11.8041], [40.3377, 16.223], [35.848, 22.4138], [23.3768, 24.1595], [13.97, 16.3918]]]Passed
regression: fecund host[[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]][[25.1475, 16.0944], [[60.6531, 6.2955], [161.5892, 22.6682], [83.7366, 115.8735], [0.0039, 66.9887]]]Passed
regression: no parasitoids[[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]][[12.164, 4.0547], [[15.0, 0.0], [22.5, 0.0], [33.75, 0.0], [50.625, 0.0]]]Passed
regression: no hosts[[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]][[13.8629, 6.9315], [[0.0, 0.0], [0.0, 0.0], [0.0, 0.0]]]Passed
control: non-growing host[None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]][None, [[8.1873, 1.8127], [6.8299, 1.3574], [5.963, 0.8669]]]Passed
regression: inefficient parasitoid[[329.5837, 109.8612], [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]][[329.5837, 109.8612], [[245.6192, 9.0635], [673.01, 10.6413], [1815.2157, 33.969], [3877.2504, 261.3994]]]Passed
control: invalid search[None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]][None, [[20.0, 0.0], [40.0, 0.0], [80.0, 0.0]]]Passed

SHA-256 / e9b0817a8d49a688ae9329e65713fa19970cff75dec592fa87e2f242814e06b4

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:47:35.942448+00:00.

Case digest / 8740e9c15a07b3b2b7bbaf43b15fdc50c99c4ab9df621d4dcf9bc113cb376a1e