{
  "schemaVersion": 1,
  "slug": "road-trip-snack-calculator",
  "category": "travel",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "04cbe8a3f4e9365e86b6f68efb28931b9877eca803105f2329fa7e09a2007b13",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/road-trip-snack-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(p × k × H ÷ 2); W = p × w × H; C = 1.2S + 0.9W + 12mp",
    "vars": [
      [
        "p",
        "Travellers"
      ],
      [
        "k",
        "Snacks per person per 2 h"
      ],
      [
        "H",
        "Trip hours"
      ],
      [
        "w",
        "Water per person per hour (L)"
      ],
      [
        "m",
        "Meal stops"
      ]
    ],
    "note": "Cost model: USD 1.20 per snack, USD 0.90 per litre of water, USD 12 per person per meal stop. Ice packs = ceil(cooler litres ÷ 10). Prices and quantities are planning assumptions."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const totalSnacks = Math.ceil(travellers*snackRate*(hours/2)); const waterLitres = travellers*waterPerPersonHour*hours; const icePacks = Math.ceil(coolerSpace/10); const estimatedCost = totalSnacks*1.2+waterLitres*0.9+mealStops*travellers*12; return { totalSnacks, waterLitres, icePacks, estimatedCost, note: 'Pack the cooler the night before so it is already cold when you leave' };",
    "inputs": [
      {
        "name": "travellers",
        "type": "number",
        "default": 4,
        "min": 1,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "hours",
        "type": "number",
        "default": 8,
        "min": 0.5,
        "max": 72,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "snackRate",
        "type": "number",
        "default": 1,
        "min": 0.25,
        "max": 4,
        "step": 0.25,
        "slider": true
      },
      {
        "name": "waterPerPersonHour",
        "type": "number",
        "default": 0.25,
        "min": 0.05,
        "max": 2,
        "step": 0.05,
        "slider": true
      },
      {
        "name": "mealStops",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 12,
        "step": 1,
        "slider": true
      },
      {
        "name": "coolerSpace",
        "type": "number",
        "default": 20,
        "min": 1,
        "max": 200,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "totalSnacks",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "waterLitres",
        "precision": 1,
        "unit": "L"
      },
      {
        "name": "icePacks",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "estimatedCost",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "note",
        "precision": 0,
        "unit": "",
        "type": "text"
      }
    ],
    "interpret": null
  }
}
