# SAMPLE DATA. FICTIONAL COMPANY. NOT REAL.
# Mesquite Ridge Metal Works, Plant 1: the shop file for the twin.
# Scope box: starts when a work order is released to the floor, ends when the parts are loaded on the truck.
# Inside the box: the band saw, the 4-axis mill, two 3-axis mills, the lathe, two weld cells, deburr and wash,
# outside powder coat at Blue Heron Coatings, and the shipping dock. Outside the box: the foundry (castings arrive
# ready), quoting, and purchasing (bar, plate and tube are always on the rack).
# Times are in seconds. A rate is pieces per second: 0.0004167 is one piece every 40 minutes.
# load is the setup time for each job (fixture, tools, first-piece check).

defaults:
  cycle_time_cv: 0.15        # real cycle times wander about 15% from the standard

stocks: []

part_types:
  - {name: casting_1010, uom: piece, attributes: {}}
  - {name: MR-1010_hmc, uom: piece, attributes: {}}
  - {name: MR-1010_deburr, uom: piece, attributes: {}}
  - {name: MR-1010, uom: piece, attributes: {}}   # Gearbox housing (ductile iron casting from Plant 2)
  - {name: bar_6061, uom: piece, attributes: {}}
  - {name: MR-1020_saw, uom: piece, attributes: {}}
  - {name: MR-1020_hmc, uom: piece, attributes: {}}
  - {name: MR-1020_deburr, uom: piece, attributes: {}}
  - {name: MR-1020, uom: piece, attributes: {}}   # Hydraulic manifold block, 6061 aluminum
  - {name: bar_4140, uom: piece, attributes: {}}
  - {name: MR-1015_saw, uom: piece, attributes: {}}
  - {name: MR-1015_lathe, uom: piece, attributes: {}}
  - {name: MR-1015_vmc, uom: piece, attributes: {}}
  - {name: MR-1015, uom: piece, attributes: {}}   # Drive shaft, 2 in. 4140
  - {name: plate_a36, uom: piece, attributes: {}}
  - {name: MR-1002_saw, uom: piece, attributes: {}}
  - {name: MR-1002_vmc, uom: piece, attributes: {}}
  - {name: MR-1002_paint, uom: piece, attributes: {}}
  - {name: MR-1002, uom: piece, attributes: {}}   # Mounting bracket, large, A36
  - {name: tube_a36, uom: piece, attributes: {}}
  - {name: MR-1030_saw, uom: piece, attributes: {}}
  - {name: MR-1030_weld, uom: piece, attributes: {}}
  - {name: MR-1030_paint, uom: piece, attributes: {}}
  - {name: MR-1030, uom: piece, attributes: {}}   # Frame weldment, light
  - {name: plate_a572, uom: piece, attributes: {}}
  - {name: MR-1031_saw, uom: piece, attributes: {}}
  - {name: MR-1031_weld, uom: piece, attributes: {}}
  - {name: MR-1031_paint, uom: piece, attributes: {}}
  - {name: MR-1031, uom: piece, attributes: {}}   # Skid frame weldment, heavy

machines:
  - {name: band_saw}
  - {name: hmc_4axis}        # the 4-axis horizontal mill: gearbox housings and manifold blocks
  - {name: vmc}              # two 3-axis mills (see capacity on the vmc steps)
  - {name: lathe}
  - {name: weld_cell}        # two weld cells
  - {name: deburr_wash}
  - {name: blue_heron}       # outside powder coat (Blue Heron Coatings)
  - {name: dock}

labor:
  pools:
    - name: machinists       # run the saw, both kinds of mill and the lathe
      headcount: 4           # people on each shift
      skills: [saw, hmc, vmc, lathe]
      calendar:
        timezone: America/Chicago
        origin: "2026-11-23T06:00:00-06:00"   # Monday Nov 23, 6 am: time zero of the order book
        weekly:
          - {days: [mon, tue, wed, thu, fri], start: "06:00", end: "22:00"}   # two 8-hour shifts
        exceptions:
          - {date: "2026-11-26", closed: true}   # Thanksgiving
          - {date: "2026-11-27", closed: true}   # day after Thanksgiving
    - name: welders
      headcount: 2
      skills: [weld]
      calendar:
        timezone: America/Chicago
        origin: "2026-11-23T06:00:00-06:00"   # Monday Nov 23, 6 am: time zero of the order book
        weekly:
          - {days: [mon, tue, wed, thu, fri], start: "06:00", end: "22:00"}
        exceptions:
          - {date: "2026-11-26", closed: true}   # Thanksgiving
          - {date: "2026-11-27", closed: true}   # day after Thanksgiving
    - name: finishers        # deburr and wash
      headcount: 1
      skills: [deburr]
      calendar:
        timezone: America/Chicago
        origin: "2026-11-23T06:00:00-06:00"   # Monday Nov 23, 6 am: time zero of the order book
        weekly:
          - {days: [mon, tue, wed, thu, fri], start: "06:00", end: "22:00"}
        exceptions:
          - {date: "2026-11-26", closed: true}   # Thanksgiving
          - {date: "2026-11-27", closed: true}   # day after Thanksgiving
    - name: shipping         # one shipping clerk, day shift only
      headcount: 1
      skills: [ship]
      calendar:
        timezone: America/Chicago
        origin: "2026-11-23T06:00:00-06:00"   # Monday Nov 23, 6 am: time zero of the order book
        weekly:
          - {days: [mon, tue, wed, thu, fri], start: "07:00", end: "15:30"}   # day shift
        exceptions:
          - {date: "2026-11-26", closed: true}   # Thanksgiving
          - {date: "2026-11-27", closed: true}   # day after Thanksgiving
    - name: blue_heron_coatings   # the outside powder coater: not our people, so no shift limit
      headcount: 20
      skills: [paint]

locations:
  # MR-1010 Gearbox housing (ductile iron casting from Plant 2)
  - {name: hmc_1010, consumes: [{thing: casting_1010, qty: 1, uom: piece}], emits: [{thing: MR-1010_hmc, qty: 1, uom: piece}],
     setup_key: hmc_1010, time_model: {kind: rate_based, rate: 0.0004167, load: 9000},
     machine: hmc_4axis, labor_skill: hmc, dispatch: fifo, shift_crossing: pause}   # 4-axis mill: 40 min a piece, 2.5 h setup
  - {name: deburr_1010, consumes: [{thing: MR-1010_hmc, qty: 1, uom: piece}], emits: [{thing: MR-1010_deburr, qty: 1, uom: piece}],
     setup_key: deburr_1010, time_model: {kind: rate_based, rate: 0.0027778, load: 0},
     machine: deburr_wash, labor_skill: deburr, shift_crossing: pause}   # deburr and wash: 6 min a piece
  - {name: ship_1010, consumes: [{thing: MR-1010_deburr, qty: 1, uom: piece}], emits: [{thing: MR-1010, qty: 1, uom: piece}],
     setup_key: ship_1010, time_model: {kind: rate_based, rate: 0.0055556, load: 900},
     machine: dock, labor_skill: ship, shift_crossing: pause}   # pack and load: 3 min a piece, 15 min to stage
  # MR-1020 Hydraulic manifold block, 6061 aluminum
  - {name: saw_1020, consumes: [{thing: bar_6061, qty: 1, uom: piece}], emits: [{thing: MR-1020_saw, qty: 1, uom: piece}],
     setup_key: saw_1020, time_model: {kind: rate_based, rate: 0.0055556, load: 1200},
     machine: band_saw, labor_skill: saw, shift_crossing: pause}   # saw: 3 min a piece, 20 min setup
  - {name: hmc_1020, consumes: [{thing: MR-1020_saw, qty: 1, uom: piece}], emits: [{thing: MR-1020_hmc, qty: 1, uom: piece}],
     setup_key: hmc_1020, time_model: {kind: rate_based, rate: 0.0006667, load: 9000},
     machine: hmc_4axis, labor_skill: hmc, dispatch: fifo, shift_crossing: pause}   # 4-axis mill: 25 min a piece, 2.5 h setup
  - {name: deburr_1020, consumes: [{thing: MR-1020_hmc, qty: 1, uom: piece}], emits: [{thing: MR-1020_deburr, qty: 1, uom: piece}],
     setup_key: deburr_1020, time_model: {kind: rate_based, rate: 0.0020833, load: 0},
     machine: deburr_wash, labor_skill: deburr, shift_crossing: pause}   # deburr and wash: 8 min a piece
  - {name: ship_1020, consumes: [{thing: MR-1020_deburr, qty: 1, uom: piece}], emits: [{thing: MR-1020, qty: 1, uom: piece}],
     setup_key: ship_1020, time_model: {kind: rate_based, rate: 0.0055556, load: 900},
     machine: dock, labor_skill: ship, shift_crossing: pause}   # pack and load: 3 min a piece
  # MR-1015 Drive shaft, 2 in. 4140
  - {name: saw_1015, consumes: [{thing: bar_4140, qty: 1, uom: piece}], emits: [{thing: MR-1015_saw, qty: 1, uom: piece}],
     setup_key: saw_1015, time_model: {kind: rate_based, rate: 0.0083333, load: 1200},
     machine: band_saw, labor_skill: saw, shift_crossing: pause}   # saw: 2 min a piece
  - {name: lathe_1015, consumes: [{thing: MR-1015_saw, qty: 1, uom: piece}], emits: [{thing: MR-1015_lathe, qty: 1, uom: piece}],
     setup_key: lathe_1015, time_model: {kind: rate_based, rate: 0.0013889, load: 3600},
     machine: lathe, labor_skill: lathe, shift_crossing: pause}   # lathe: 12 min a piece, 1 h setup
  - {name: vmc_1015, consumes: [{thing: MR-1015_lathe, qty: 1, uom: piece}], emits: [{thing: MR-1015_vmc, qty: 1, uom: piece}],
     setup_key: vmc_1015, time_model: {kind: rate_based, rate: 0.0027778, load: 2700},
     machine: vmc, labor_skill: vmc, capacity: 2, shift_crossing: pause}   # 3-axis mill, keyway: 6 min a piece, 45 min setup
  - {name: ship_1015, consumes: [{thing: MR-1015_vmc, qty: 1, uom: piece}], emits: [{thing: MR-1015, qty: 1, uom: piece}],
     setup_key: ship_1015, time_model: {kind: rate_based, rate: 0.0083333, load: 900},
     machine: dock, labor_skill: ship, shift_crossing: pause}   # pack and load: 2 min a piece
  # MR-1002 Mounting bracket, large, A36
  - {name: saw_1002, consumes: [{thing: plate_a36, qty: 1, uom: piece}], emits: [{thing: MR-1002_saw, qty: 1, uom: piece}],
     setup_key: saw_1002, time_model: {kind: rate_based, rate: 0.0083333, load: 1200},
     machine: band_saw, labor_skill: saw, shift_crossing: pause}   # saw: 2 min a piece
  - {name: vmc_1002, consumes: [{thing: MR-1002_saw, qty: 1, uom: piece}], emits: [{thing: MR-1002_vmc, qty: 1, uom: piece}],
     setup_key: vmc_1002, time_model: {kind: rate_based, rate: 0.0020833, load: 2700},
     machine: vmc, labor_skill: vmc, capacity: 2, shift_crossing: pause}   # 3-axis mill, holes: 8 min a piece
  - {name: paint_1002, consumes: [{thing: MR-1002_vmc, qty: 1, uom: piece}], emits: [{thing: MR-1002_paint, qty: 1, uom: piece}],
     setup_key: paint_1002, time_model: {kind: rate_based, rate: 0.1666667, load: 172800},
     machine: blue_heron, labor_skill: paint, capacity: 20, shift_crossing: pause}   # powder coat at Blue Heron: 2 days out and back
  - {name: ship_1002, consumes: [{thing: MR-1002_paint, qty: 1, uom: piece}], emits: [{thing: MR-1002, qty: 1, uom: piece}],
     setup_key: ship_1002, time_model: {kind: rate_based, rate: 0.0166667, load: 900},
     machine: dock, labor_skill: ship, shift_crossing: pause}   # pack and load: 1 min a piece
  # MR-1030 Frame weldment, light
  - {name: saw_1030, consumes: [{thing: tube_a36, qty: 1, uom: piece}], emits: [{thing: MR-1030_saw, qty: 1, uom: piece}],
     setup_key: saw_1030, time_model: {kind: rate_based, rate: 0.0011111, load: 1200},
     machine: band_saw, labor_skill: saw, shift_crossing: pause}   # saw: 15 min a frame (all the cuts)
  - {name: weld_1030, consumes: [{thing: MR-1030_saw, qty: 1, uom: piece}], emits: [{thing: MR-1030_weld, qty: 1, uom: piece}],
     setup_key: weld_1030, time_model: {kind: rate_based, rate: 0.0001852, load: 1800},
     machine: weld_cell, labor_skill: weld, capacity: 2, shift_crossing: pause}   # weld: 90 min a frame, 30 min fixture setup
  - {name: paint_1030, consumes: [{thing: MR-1030_weld, qty: 1, uom: piece}], emits: [{thing: MR-1030_paint, qty: 1, uom: piece}],
     setup_key: paint_1030, time_model: {kind: rate_based, rate: 0.0333333, load: 172800},
     machine: blue_heron, labor_skill: paint, capacity: 20, shift_crossing: pause}   # powder coat: 2 days out and back
  - {name: ship_1030, consumes: [{thing: MR-1030_paint, qty: 1, uom: piece}], emits: [{thing: MR-1030, qty: 1, uom: piece}],
     setup_key: ship_1030, time_model: {kind: rate_based, rate: 0.0016667, load: 900},
     machine: dock, labor_skill: ship, shift_crossing: pause}   # load: 10 min a frame
  # MR-1031 Skid frame weldment, heavy
  - {name: saw_1031, consumes: [{thing: plate_a572, qty: 1, uom: piece}], emits: [{thing: MR-1031_saw, qty: 1, uom: piece}],
     setup_key: saw_1031, time_model: {kind: rate_based, rate: 0.0005556, load: 1200},
     machine: band_saw, labor_skill: saw, shift_crossing: pause}   # saw: 30 min a skid
  - {name: weld_1031, consumes: [{thing: MR-1031_saw, qty: 1, uom: piece}], emits: [{thing: MR-1031_weld, qty: 1, uom: piece}],
     setup_key: weld_1031, time_model: {kind: rate_based, rate: 0.0000463, load: 3600},
     machine: weld_cell, labor_skill: weld, capacity: 2, shift_crossing: pause}   # weld: 6 h a skid, 1 h fixture setup
  - {name: paint_1031, consumes: [{thing: MR-1031_weld, qty: 1, uom: piece}], emits: [{thing: MR-1031_paint, qty: 1, uom: piece}],
     setup_key: paint_1031, time_model: {kind: rate_based, rate: 0.0166667, load: 172800},
     machine: blue_heron, labor_skill: paint, capacity: 20, shift_crossing: pause}   # powder coat: 2 days out and back
  - {name: ship_1031, consumes: [{thing: MR-1031_paint, qty: 1, uom: piece}], emits: [{thing: MR-1031, qty: 1, uom: piece}],
     setup_key: ship_1031, time_model: {kind: rate_based, rate: 0.0005556, load: 900},
     machine: dock, labor_skill: ship, shift_crossing: pause}   # load on a flatbed: 30 min a skid

routing:                     # the order of steps for each part
  - {part: MR-1010, steps: [hmc_1010, deburr_1010, ship_1010]}
  - {part: MR-1020, steps: [saw_1020, hmc_1020, deburr_1020, ship_1020]}
  - {part: MR-1015, steps: [saw_1015, lathe_1015, vmc_1015, ship_1015]}
  - {part: MR-1002, steps: [saw_1002, vmc_1002, paint_1002, ship_1002]}
  - {part: MR-1030, steps: [saw_1030, weld_1030, paint_1030, ship_1030]}
  - {part: MR-1031, steps: [saw_1031, weld_1031, paint_1031, ship_1031]}

processes: []
bom: []

economics:                   # what each part sells for, costs, and what a late day costs us
  things:
    MR-1010: {price: 640, unit_cost: 260, late_cost_per_day: 900}    # Anchor Point Machinery
    MR-1020: {price: 385, unit_cost: 150, late_cost_per_day: 1200}   # Prairie Wheel: strict on-time scorecard
    MR-1015: {price: 120, unit_cost: 48, late_cost_per_day: 400}
    MR-1002: {price: 46, unit_cost: 17, late_cost_per_day: 150}
    MR-1030: {price: 780, unit_cost: 330, late_cost_per_day: 300}
    MR-1031: {price: 4200, unit_cost: 1900, late_cost_per_day: 1500} # Bayou Drilling
  setup: {cost: 85}
