{
  "schemaVersion": 1,
  "slug": "garden-bed-size-calculator",
  "category": "gardening",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "178183637e16cc7f9fc1587580f155e82a69bb259fc4230994a8d52e627c7a12",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/garden-bed-size-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "A=n×p; L=A÷w; b=max(1,ceil(L÷12)); ell=L÷b; F=A+(b+1)×q×ell",
    "vars": [
      [
        "n",
        "people"
      ],
      [
        "p",
        "selected area per person (sq ft)"
      ],
      [
        "w",
        "bed width (ft)"
      ],
      [
        "b",
        "number of beds"
      ],
      [
        "ell",
        "length per bed (ft)"
      ],
      [
        "q",
        "path width (ft)"
      ],
      [
        "F",
        "estimated footprint (sq ft)"
      ]
    ],
    "note": "The path estimate assumes parallel beds no longer than about 12 ft, with one path-width strip between each bed and one along each outer edge. It omits other layout details."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const P={herbs:50,moderate:100,full:200,storage:300}; const growingArea=people*(P[intensity]||100); const bedLength=bedWidth>0?growingArea/bedWidth:0; const beds=Math.max(1,Math.ceil(bedLength/12)); const bedLen=bedLength/beds; const totalFootprint=growingArea+(beds+1)*pathWidth*bedLen; return {growingArea,bedLength:bedLen,beds,totalFootprint,note:bedWidth>4?\"Beds wider than 4 ft are hard to reach across — consider splitting them\":\"At this width you can reach the middle from either side without compacting the soil\"};",
    "inputs": [
      {
        "name": "people",
        "type": "number",
        "default": 4,
        "min": 1,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "intensity",
        "type": "select",
        "default": "moderate",
        "options": [
          {
            "value": "herbs"
          },
          {
            "value": "moderate"
          },
          {
            "value": "full"
          },
          {
            "value": "storage"
          }
        ]
      },
      {
        "name": "bedWidth",
        "type": "number",
        "default": 4,
        "min": 1,
        "max": 8,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "pathWidth",
        "type": "number",
        "default": 1.5,
        "min": 0.5,
        "max": 6,
        "step": 0.5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "growingArea",
        "precision": 0,
        "unit": "sq ft"
      },
      {
        "name": "bedLength",
        "precision": 1,
        "unit": "ft"
      },
      {
        "name": "beds",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "totalFootprint",
        "precision": 0,
        "unit": "sq ft"
      },
      {
        "name": "note",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
