{
  "schemaVersion": 1,
  "slug": "party-food-calculator",
  "category": "everyday",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "9db7b1c0c601367b2f613598e1dfea363a00f02b3cde2aaf854285d5d39e6a82",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/party-food-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": "S = ceil(G m max(1, H ÷ 2) a); lb = 0.25 S; D = ceil(G d + { 0.5 G H, d = 0; 0, d ≠ 0 })",
    "vars": [
      [
        "G",
        "Guests"
      ],
      [
        "H",
        "Duration (hours)"
      ],
      [
        "m",
        "Base servings per person by meal type"
      ],
      [
        "a",
        "Appetite factor (0.8 / 1 / 1.3)"
      ],
      [
        "d",
        "Drinks per person (0 / 2 / 4 / 6)"
      ],
      [
        "D",
        "Total drinks"
      ]
    ],
    "note": "Servings use preset counts per guest, event length and appetite; food weight assumes 0.25 lb per serving. Drink quantity follows the selected alcohol setting. dietaryGuestsEstimate = ceil(guests × dietary share). These are planning assumptions, not catering or nutrition standards."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const M = { appetizers: 6, buffet: 12, dinner: 10, bbq: 14, dessert: 5, brunch: 10 }; const A = { light: 0.8, average: 1, hearty: 1.3 }; const perPerson = (M[mealType] || 10)*Math.max(1, hours/2)*(A[appetite] || 1); const servingsTotal = Math.ceil(guests*perPerson); const poundsFood = servingsTotal*0.25; const D = { none: 0, light: 2, moderate: 4, heavy: 6 }; const drinksTotal = Math.ceil(guests*(D[drinking] || 0)+(drinking === 'none' ? guests*hours*0.5 : 0)); return { servingsTotal, poundsFood, drinksTotal, iceLb: Math.max(1, guests*0.75), dietaryGuestsEstimate: Math.ceil(guests*dietary/100) };",
    "inputs": [
      {
        "name": "guests",
        "type": "number",
        "default": 25,
        "min": 1,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "hours",
        "type": "number",
        "default": 4,
        "min": 0.5,
        "max": 24,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "mealType",
        "type": "select",
        "default": "appetizers",
        "options": [
          {
            "value": "appetizers"
          },
          {
            "value": "buffet"
          },
          {
            "value": "dinner"
          },
          {
            "value": "bbq"
          },
          {
            "value": "dessert"
          },
          {
            "value": "brunch"
          }
        ]
      },
      {
        "name": "drinking",
        "type": "select",
        "default": "moderate",
        "options": [
          {
            "value": "none"
          },
          {
            "value": "light"
          },
          {
            "value": "moderate"
          },
          {
            "value": "heavy"
          }
        ]
      },
      {
        "name": "appetite",
        "type": "select",
        "default": "average",
        "options": [
          {
            "value": "light"
          },
          {
            "value": "average"
          },
          {
            "value": "hearty"
          }
        ]
      },
      {
        "name": "dietary",
        "type": "number",
        "default": 15,
        "min": 0,
        "max": 100,
        "step": 5,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "servingsTotal",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "poundsFood",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "drinksTotal",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "iceLb",
        "precision": 1,
        "unit": "lb"
      },
      {
        "name": "dietaryGuestsEstimate",
        "precision": 0,
        "unit": "",
        "type": "number"
      }
    ],
    "interpret": null
  }
}
