Requirements Planning in a Worksheet and in Code

Manuel D. Rossetti, PhD P.E.

Agenda

  • The four sheets of Chapter6Models.xlsx, and why the periods run across
  • The record computed twice, the explosion with its structure live, the lumpiness comparison, and the network
  • The software: build the structure, evaluate the explosion as records, choose a rule, and vary the graph to a network
  • One gross requirement of the bearing exploded by hand

The Four Sheets

Sheet What it does Which part of the chapter
Record the same requirements carried forward twice, without and with netting the record, and the \(\max\)
Explosion the structure in three columns, then one record per item in low-level-code order the explosion of all five items
Lumpiness what each rule has the deck assembly receive, with its order count and variability coefficient what lot sizing does to the level below
DRP three regions and a center, every quantity per equal to one the same calculation on a network

The periods run across the columns, the reverse of the dynamic lot sizing workbook. That is not this book’s choice: a planner reads one item’s six rows at a time and compares them with each other, and the layout follows the field.

Record: Computed Twice

The upper block carries the balance forward without netting: it has no net requirement row at all, and its projected on hand runs to \(-1{,}840\).

The lower block nets, and its projected on hand never leaves zero.

Notice that the two blocks share a gross requirement row to the unit. The only thing that differs between them is one formula, and putting them one above the other is the point of the sheet.

Explosion: the Structure Is Live

The structure sits in three columns at the top. The five blue cells in column C are the quantities per, and every component’s gross requirement formula reads them: the explosion equation written out, one term per parent.

Notice the deck belt’s gross requirement row against the deck assembly’s release row above it. They are the same numbers, because the quantity per is one.

Type a 3 over the 2 and every record below the spindle assembly moves.

Explosion: the Bearing and the Totals

The spindle assembly, the bearing, the housing, and the totals.

The bearing’s gross requirements are the largest numbers on the sheet, reaching 1,980 in period 8. Five bearings per deck and two paths through the structure will do that.

The three cells at the foot make the first session’s cost computable: 57 orders, $14,500 of setup, and nothing carried.

Lumpiness

Each row is what one rule has the deck assembly receive over the twelve scheduled months. The variability coefficient is written as the mean of the squares less the square of the mean, over the square of the mean, because the more obvious SUMPRODUCT((range - mean)^2) is an array expression a reader cannot follow by clicking on it.

Notice the Largest receipt column: six of the seven rules never exceed 420, and part-period balancing’s single lot of 680 is why its coefficient is the highest on the sheet. The Total column reads 1,840 on every row, and is there to be checked.

DRP: the Explosion Sheet on Its Side

Each region is planned exactly as an end item is planned on the Explosion sheet; the only word that changes is the one naming the offset, a transit time for a lead time. The center’s gross requirement row is the three release rows added down the column, and nothing else.

Notice period 3, where the center needs ten belts: the southern region alone is asking, because its transit time is a month longer than the other two.

Build the Structure

val bom = BillOfMaterial(
    listOf(
        PlannedItem("DA", "Mower deck assembly", leadTime = 1, policy = LotForLotPolicy,
            orderCost = 500.0, unitCost = 180.0, carryingCharge = 0.02),
        PlannedItem("B", "Deck belt", leadTime = 2, policy = LotForLotPolicy,
            orderCost = 300.0, unitCost = 50.0, carryingCharge = 0.02),
        PlannedItem("S", "Spindle assembly", leadTime = 1, policy = LotForLotPolicy,
            orderCost = 250.0, unitCost = 25.0, carryingCharge = 0.03),
        PlannedItem("H", "Spindle housing", leadTime = 2, policy = LotForLotPolicy,
            orderCost = 150.0, unitCost = 12.0, carryingCharge = 0.02),
        PlannedItem("BR", "Bearing", leadTime = 3, policy = LotForLotPolicy,
            orderCost = 100.0, unitCost = 4.0, carryingCharge = 0.02),
    ),
    listOf(
        BillOfMaterial.Usage("DA", "B", 1.0),  BillOfMaterial.Usage("DA", "S", 2.0),
        BillOfMaterial.Usage("DA", "BR", 1.0), BillOfMaterial.Usage("S", "H", 1.0),
        BillOfMaterial.Usage("S", "BR", 2.0),
    ),
)
println(bom.lowLevelCodes.toSortedMap())   // {B=1, BR=2, DA=0, H=2, S=1}
println(bom.planningOrder())               // [DA, B, S, BR, H]

Each PlannedItem names its lead time in months, \(k\), \(c\) and \(i\) a month; each Usage names a parent, a child and the quantity per. Notice that no level was typed anywhere: lowLevelCodes and planningOrder are read off the usages.

Evaluate the Explosion

val schedule = List(5) { 0.0 } +
    listOf(40.0, 60.0, 120.0, 300.0, 420.0, 260.0, 120.0, 40.0, 0.0, 80.0, 180.0, 220.0)
val plan = RequirementsPlan(bom, mapOf("DA" to schedule))
println(plan.recordFor("BR").report(1..9).toText())
 t   | 1   | 2   | 3   | 4    | 5    | 6    | 7    | 8    | 9
-----+-----+-----+-----+------+------+------+------+------+------
 GR  |   0 |   0 |   0 |  160 |  280 |  540 | 1320 | 1980 | 1460
 SR  |   0 |   0 |   0 |    0 |    0 |    0 |    0 |    0 |    0
 I   |   0 |   0 |   0 |    0 |    0 |    0 |    0 |    0 |    0
 NR  |   0 |   0 |   0 |  160 |  280 |  540 | 1320 | 1980 | 1460
 POR |   0 |   0 |   0 |  160 |  280 |  540 | 1320 | 1980 | 1460
 Rel | 160 | 280 | 540 | 1320 | 1980 | 1460 |  740 |  280 |   40

The bearing’s record, drawn as by hand: the rows are \(\mathit{GR}_t\), \(\mathit{SR}_t\), \(I_t\), \(\mathit{NR}_t\), \(\mathit{POR}_t\) and \(\mathit{Rel}_t\). report(10..17) prints the rest of the horizon.

One Gross Requirement, by Hand

The bearing has two parents: one per deck assembly and two per spindle assembly. In period 8 the deck assembly releases 300 and the spindle assembly 840. What is the bearing’s gross requirement in period 8?

\[ \mathit{GR}_{\mathrm{BR},8} = 1 \times \mathit{Rel}_{\mathrm{DA},8} + 2 \times \mathit{Rel}_{\mathrm{S},8} = 1(300) + 2(840) = 1{,}980, \]

the GR entry in column 8.

Choose a Rule

Changing a rule means changing one item’s policy. Putting the deck assembly on Silver-Meal, with every component still on lot-for-lot, is one row of the comparison table:

PlannedItem("DA", "Mower deck assembly", leadTime = 1,
    policy = PlanTheHorizon(SilverMeal),
    orderCost = 500.0, unitCost = 180.0, carryingCharge = 0.02)

println(plan.costReport().toText()) prints

 item | rule        | orders | setup ($) | carrying ($) | relevant ($)
------+-------------+--------+-----------+--------------+--------------
 DA   | Silver-Meal |      8 |      4000 |          936 |         4936
 B    | Lot-for-lot |      8 |      2400 |            0 |         2400
 S    | Lot-for-lot |      8 |      2000 |            0 |         2000
 BR   | Lot-for-lot |     11 |      1100 |            0 |         1100
 H    | Lot-for-lot |      8 |      1200 |            0 |         1200

$11,636 in all, against $14,500 with lot-for-lot everywhere: the rule changed at one item and the order count changed at every item.

Vary It: the Network, in the Same Two Classes

val regions = listOf("N" to 1, "S" to 2, "W" to 1)
val network = BillOfMaterial(
    regions.map { (id, transit) ->
        PlannedItem(id, "$id region", leadTime = transit, policy = LotForLotPolicy,
            orderCost = 200.0, unitCost = 50.0, carryingCharge = 0.02)
    } + PlannedItem("CW", "Central warehouse", leadTime = 2, policy = LotForLotPolicy,
        orderCost = 400.0, unitCost = 50.0, carryingCharge = 0.02),
    regions.map { (id, _) -> BillOfMaterial.Usage(parent = id, child = "CW", quantity = 1.0) },
)
val drp = RequirementsPlan(network, demand.mapValues { List(4) { 0.0 } + it.value })
println(network.lowLevelCodes.toSortedMap())   // {CW=1, N=0, S=0, W=0}
println(network.planningOrder())               // [N, S, W, CW]
println(drp.recordFor("CW").grossRequirements.map { it.toInt() })
// [0, 0, 10, 50, 80, 180, 360, 360, 210, 80, 30, 20, 120, 190, 150, 0]

The last row is the center’s roll-up. Notice the lead-in is four here and five above, because the network is a shallower graph, and notice what is absent: no class is told that the graph is a network. The only thing that says so is the word region in a label.

What We Did Today

The workbook’s periods run across, because a planner reads one item’s six rows at a time; the Record sheet differs from itself in one formula.

The Explosion sheet’s structure is live: the quantities per are the cells every gross requirement formula reads.

The software prints each record as it is drawn by hand, and the bearing’s 1,980 in period 8 explodes by hand as \(1(300) + 2(840)\).

Every dynamic lot sizing rule runs inside a record, so choosing a rule is changing one item’s policy, and its effect shows at every item below.

A distribution network is a bill of material with every quantity per equal to one, built from the same two classes.

For Next Time

Read before next session: One Order, One Chance and Working the Decision by Hand, in the single-period chapter.

Today’s material was Building These Models in a Worksheet and Using the Software. Why the code is shaped as it is lives in the book’s appendix on designing the course software.

Next session begins the second half of the course:

  • Demand is a random variable, and there is exactly one ordering decision
  • The cost of one too many against the cost of one too few
  • The decision worked by hand first, from a table of probabilities

Everything so far has assumed demand is known. From here it is not, and the first model that admits it is also the simplest one in the book.

⌂ Index