Activity: two policies under common random numbers

Chapter 11, Simulating Inventory Systems

Author

Manuel D. Rossetti

Code-along, laptops, in pairs. 30 minutes.

Names: ______________________________________________

The item. The utility storeroom stocks a lightning arrester. Crews draw 360 a year, one at a time, as a Poisson process. The supplier’s lead time is a constant two weeks. Ordering costs $40 an order, holding $15 per arrester per year, and a backorder $150 per arrester per year. Arresters ship in cases of 8.

The two policies. The planner runs \((r, Q) = (10, 48)\), six cases. The optimizer of chapter 8 says \((9, 48)\). Is one reorder point worth anything?

The starter. Open inventory.simulation.codealong.TwoPolicies in the course’s code project. It builds the arrester as an \((r, Q)\) stock point, runs 30 replications of 50 years after a 5 year warm-up, and prints each policy’s average annual cost with its 95% half-width beside the exact cost. It also has a helper that takes two policies’ costs, replication by replication, and prints the average, half-width and variance of their difference. Run it with

./gradlew run -PmainClass=inventory.simulation.codealong.TwoPoliciesKt

We type the two TODO steps together. Write each prediction before the run.

Run 1. The planner alone

Predict: will the interval cover the exact cost? Then run the starter as given, and record the average and half-width.

Run 2. The optimizer, on the same demands

We add \((9, 48)\), with its demand on the same stream as the planner’s, and the difference of the two costs, optimizer less planner.

  1. Predict: will the planner’s line change from run 1?
  2. The two policies’ intervals will overlap. Predict: will the interval for their difference include zero?
  3. Run, and record both policies and the difference. Does the difference’s interval cover the exact difference? Is that difference worth a decision?

Run 3. The optimizer, on its own demands

We simulate \((9, 48)\) again with its demand on stream 3, so the two policies face independent demands, and report the difference again.

  1. Predict: which of the half-widths already printed will change? Will the new difference’s half-width be larger or smaller, and by roughly how much?
  2. Run, and record. Compute the ratio of the two variances of the difference.
  3. How many replications would independent streams need to match the half-width that common random numbers gave from 30?

Run 4, if you have time. Five cases against six

We simulate \((10, 40)\) on the first demand stream, and compare \((9, 48)\) with it under common random numbers and under independent streams.

  1. Predict: will the variance ratio be larger or smaller than in run 3?
  2. Run, and record the ratio. Explain the difference from run 3. Hint: under \((10, 48)\) and \((9, 48)\), driven by the same demands, how do the two inventory positions compare at every instant?

Exit ticket (tear off and hand in)

Name: ____________________

  1. In run 2 the two policies’ intervals overlapped, yet the difference was resolved. Why is that not a contradiction?
  1. Why must the demand draw from its own stream, apart from anything else random in the model, for the two policies to share it?