{
  "schemaVersion": 1,
  "slug": "moving-box-calculator",
  "category": "moving",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "c2a2fa556e84ccd9bc1d45a6f2cdb5a770e9d4571ad9a0a92bed2248ea7680a6",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/moving-box-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": "N = ceil(B×p/100) + ceil(0.45B) + max(0, round(0.25B)); B = 12b + 8l + 14k + 5u",
    "vars": [
      [
        "N",
        "total boxes needed"
      ],
      [
        "B",
        "base box estimate"
      ],
      [
        "b",
        "bedrooms"
      ],
      [
        "l",
        "living rooms"
      ],
      [
        "k",
        "kitchens"
      ],
      [
        "u",
        "people moving"
      ]
    ],
    "note": "Room counts use fixed planning ratios; medium and large box shares are fixed at 45% and 25% of the computed total, and small boxes take the remaining share. Tape rolls = ceil(total boxes / 20 × user setting). The model does not estimate wardrobe, TV, or mattress specialty cartons."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const base=bedrooms*12+livingRooms*8+kitchens*14+people*5,small=Math.ceil(base*smallPct/100),medium=Math.ceil(base*.45),large=Math.max(0,Math.round(base*.25)),total=small+medium+large,tape=Math.ceil(total/20*tapeRollsPerBox);return{totalBoxes:total,smallBoxes:small,mediumBoxes:medium,largeBoxes:large,tapeRolls:tape,boxCost:total*boxCost,totalCost:total*boxCost+tape*tapeCost};",
    "inputs": [
      {
        "name": "bedrooms",
        "type": "number",
        "default": 3,
        "min": 0,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "livingRooms",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 10,
        "step": 1,
        "slider": true
      },
      {
        "name": "kitchens",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 5,
        "step": 1
      },
      {
        "name": "people",
        "type": "number",
        "default": 2,
        "min": 1,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "smallPct",
        "type": "number",
        "default": 30,
        "min": 0,
        "max": 90,
        "step": 5,
        "slider": true
      },
      {
        "name": "boxCost",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 100,
        "step": 0.01
      },
      {
        "name": "tapeRollsPerBox",
        "type": "number",
        "default": 1,
        "min": 0,
        "max": 20,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "tapeCost",
        "type": "number",
        "default": 4,
        "min": 0,
        "max": 100,
        "step": 0.01
      }
    ],
    "outputs": [
      {
        "name": "totalBoxes",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "smallBoxes",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "mediumBoxes",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "largeBoxes",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "tapeRolls",
        "precision": 0,
        "unit": ""
      },
      {
        "name": "boxCost",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "totalCost",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
