{
  "schemaVersion": 1,
  "slug": "garden-yield-calculator",
  "category": "gardening",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "7bda086c4b06674d6fa7326f6b091c1de93bcbd6a74fc3f50dee4983f6840e31",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/garden-yield-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": "gross=y×n×s; net=gross×(1−l÷100); kg=net×0.45359237; value=net×price",
    "vars": [
      [
        "y",
        "fixed yield assumption per plant (lb)"
      ],
      [
        "n",
        "plants"
      ],
      [
        "s",
        "succession plantings"
      ],
      [
        "l",
        "loss allowance (%)"
      ],
      [
        "net",
        "modeled harvest (lb)"
      ],
      [
        "price",
        "entered retail price ($/lb)"
      ]
    ],
    "note": "Per-plant values are fixed planning assumptions, not forecasts. Value is gross retail-price equivalent and does not subtract seed, labor, water or other costs."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const Y={tomato:10,pepper:4,cucumber:8,zucchini:10,lettuce:1,carrot:0.3,potato:1.5,bean:0.5,strawberry:0.5}; const perPlant=Y[crop]||5; const grossYield=perPlant*plants*succession; const netYield=grossYield*(1-lossRate/100); return {grossYield,netYield,netYieldKg:netYield*0.45359237,value:netYield*pricePerLb};",
    "inputs": [
      {
        "name": "crop",
        "type": "select",
        "default": "tomato",
        "options": [
          {
            "value": "tomato"
          },
          {
            "value": "pepper"
          },
          {
            "value": "cucumber"
          },
          {
            "value": "zucchini"
          },
          {
            "value": "lettuce"
          },
          {
            "value": "carrot"
          },
          {
            "value": "potato"
          },
          {
            "value": "bean"
          },
          {
            "value": "strawberry"
          }
        ]
      },
      {
        "name": "plants",
        "type": "number",
        "default": 10,
        "min": 1,
        "max": 5000,
        "step": 1,
        "slider": true
      },
      {
        "name": "succession",
        "type": "number",
        "default": 1,
        "min": 1,
        "max": 10,
        "step": 1
      },
      {
        "name": "lossRate",
        "type": "number",
        "default": 20,
        "min": 0,
        "max": 80,
        "step": 5,
        "slider": true
      },
      {
        "name": "pricePerLb",
        "type": "number",
        "default": 3,
        "min": 0,
        "max": 100,
        "step": 0.1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "grossYield",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "netYield",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "netYieldKg",
        "precision": 1,
        "unit": "kg"
      },
      {
        "name": "value",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
