{
  "schemaVersion": 1,
  "slug": "bbq-party-calculator",
  "category": "party",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "255117653a45de8fa59072b7bcd5b95cbb3044291ee30472d4b2b9e179e5e31d",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/bbq-party-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": "M = m × q",
    "vars": [
      [
        "m",
        "Meat-eaters"
      ],
      [
        "q",
        "Meat per person, lb"
      ],
      [
        "M",
        "Total meat, lb"
      ],
      [
        "G",
        "Total guests"
      ]
    ],
    "note": "q by appetite: 0.33 / 0.5 / 0.66 lb; kilograms = M × 0.453592; buns, sides and drinks use all guests and round up."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "if(!Number.isInteger(guests)||!Number.isInteger(meatEaters)||meatEaters>guests)return{meatLb:null,meatKg:null,buns:null,sideServings:null,drinks:null,iceLb:null,perPersonLb:null,__error:'inputError'};const perPerson=appetite==='light'?0.33:appetite==='heavy'?0.66:0.5;const meat=meatEaters*perPerson;return{meatLb:meat,meatKg:meat*0.453592,buns:Math.ceil(guests*1.5),sideServings:Math.ceil(guests*2),drinks:Math.ceil(guests*(2+hours*0.75)),iceLb:guests*0.75,perPersonLb:perPerson};",
    "inputs": [
      {
        "name": "guests",
        "type": "number",
        "default": 15,
        "min": 1,
        "max": 500,
        "step": 1,
        "slider": true
      },
      {
        "name": "meatEaters",
        "type": "number",
        "default": 12,
        "min": 0,
        "max": 500,
        "step": 1,
        "slider": true
      },
      {
        "name": "hours",
        "type": "number",
        "default": 4,
        "min": 1,
        "max": 16,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "appetite",
        "type": "select",
        "default": "average",
        "options": [
          {
            "value": "light"
          },
          {
            "value": "average"
          },
          {
            "value": "heavy"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "meatLb",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "meatKg",
        "precision": 2,
        "unit": "kg"
      },
      {
        "name": "buns",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "sideServings",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "drinks",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "iceLb",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "perPersonLb",
        "precision": 2,
        "unit": "lb"
      }
    ],
    "interpret": null
  }
}
