Chocolate simulator

Simulate first,
then decide

Four decisions of one season. The starting values are example values, so set the sliders to the order of magnitude of your factory. The calculation paths stand below every simulation.

From analysis to a testable simulation

In a chocolate factory it is not the day that decides but the season: what is fixed before the peak cannot be changed in the middle of it. Three stages turn the season into a calculation.

Stage 1
Analysis
Looks back and shows where the season cost money: in the overhang, in cocoa purchasing, in changeovers, in the promotion.
Stage 2
Forecast
One model per question estimates volumes, dispersions, and effects before they occur, and it does so with a stated error instead of gut feeling.
Stage 3
Simulation
You change one control variable and see what would follow from the decision before the season locks it in.
Control

The fourth stage takes place in operation: after the season the simulated course is set against sell-out, landed costs, changeover records, and promotion settlement. What the measurement refutes is replaced.

The seasonal volume under forecast uncertainty

Too much produced is salvaged after the season at residual value, too little produced gives away margin. The simulation searches for the volume at which the expected profit is highest, once with today's forecast error and once with that of a model.

Every slider is an assumption, not a fact. All starting values are fictitious example values. They are not customer data, not industry values, and not the values of the sample company from the nine modules.

Expected seasonal sales (units)
Forecast error today
Forecast error with model
Net price per unit
Manufacturing cost per unit
Residual value per unit after the season
Expected profit over production volume, with a marker at the best volume of each
Seasonal volume today
units, profit-maximizing
Seasonal volume with model
units, profit-maximizing
Expected overhang
today → with model, in metric tons
Profit advantage per season
expected profit with model against today

Calculation path: newsvendor calculation. Demand is normally distributed around expected sales; the forecast error is its dispersion in percent of sales. The best volume lies at the quantile (price − manufacturing cost) / (price − residual value); negative volumes are cut off at zero. Expected profit = price × expected sales + residual value × expected overhang − manufacturing cost × volume. The overhang in metric tons uses 120 grams per unit. The residual value is the salvage after the season.

Control

A look back at the last three seasons shows where your forecast error actually stands today. The slider does not replace that review.

Cocoa coverage as dispersion, not as forecast

How strongly do annual landed costs fluctuate if part of the requirement is covered at today's price and the rest is bought on the market over the year? 500 simulated price years per coverage ratio. The random generator starts fixed, every call shows the same picture.

Annual requirement cocoa products
Price today per metric ton
Price fluctuation in the year
Share of cocoa volume already covered
Band of annual landed costs over the coverage ratio: the higher the coverage, the narrower the band
Mean annual costs
the same at every coverage ratio
Expensive year (one in ten)
at the set coverage ratio
Range of annual costs
expensive against cheap year, set coverage ratio
Range without coverage
for comparison, coverage ratio zero

Calculation path: the price paths are driftless and lognormally distributed. The model makes no statement about the direction of the cocoa price. The price fluctuation is an assumption of the visitor, not a forecast. Fixed random seed, 500 paths. Two calls with the same sliders deliver the same picture. Each path runs over 52 weekly steps, one random stream for all coverage ratios. The paths are normalized so that their mean equals today's price. Annual costs = covered share × requirement × price today + uncovered share × requirement × mean market price of the path. Extreme price jumps and regime changes are captured by the distribution only as far as its tail allows. Premiums, margin costs, and basis risk of the coverage are not included. The calculation shows dispersion, not the cost of hedging. The simulation is not a recommendation for a coverage ratio. The mean of annual costs is the same at every coverage ratio; that is how the model is built.

Control

Purchasing and management decide which price fluctuation you assume for the coming year and which coverage ratio your purchasing policy provides. The curve only works through the assumptions.

The changeover sequence in line hours and metric tons

This simulation is the simplest calculation on this page. It shows how many line hours and how much transition scrap a better sequence frees up, and every result can be checked on a calculator.

Changeovers per year
Mean changeover time
Achievable reduction of changeover time
Value of a gained line hour
Transition scrap per changeover
Material value per metric ton
Value per year depending on the reduction, for line hours alone and with material (marker: set value)
Changeover hours per year today
changeovers × time
Line hours gained
per year
Transition scrap
today → with better sequence, per year
Value per year
line hours plus material

Calculation path: changeover hours = changeovers × time / 60. Hours gained = changeover hours × reduction; value = hours gained × value per hour. Transition scrap = changeovers × scrap per changeover; material value of the reduction = scrap × reduction × material value per metric ton. In this calculation the reduction applies equally to time and scrap. Energy and cleaning agents of the changeovers are deliberately not counted.

Control

Only optimization on your measured changeover times shows which reduction your changeover matrix allows. The slider does not replace that optimization.

The net effect of a trade promotion

The promotion-week bar is not a metric. The simulation subtracts pulled-forward sales and cannibalization within your own range from the incremental sales, applies the discount to all promotion units, and shows what remains of the promotion in contribution margin, even if it is less than nothing.

Base sales in the promotion period (units)
Incremental sales in the promotion
Pulled-forward sales
Cannibalization within the range
Promotion discount
Contribution margin on regular price
Decomposition of the promotion result: incremental contribution margin, discount, pulled forward, cannibalized, net
Gross incremental sales
units in the promotion
Real incremental sales
after pulled-forward sales and cannibalization
Discount costs
on all promotion units
Net effect in contribution margin
of the promotion as a whole

Calculation path: regular price €1.90 per unit, fixed. Gross incremental sales = base sales × incremental share. Real incremental sales = gross incremental sales × (1 − pulled-forward share − cannibalization share). Incremental contribution margin = gross incremental sales × contribution margin × regular price. Discount costs = (base sales + gross incremental sales) × discount × regular price. Contribution margin missing later = pulled-forward sales × contribution margin × regular price; cannibalized contribution margin likewise. Net = incremental contribution margin − discount − missing later − missing at the neighbor. Trade terms, secondary placement costs, and leaflets are deliberately not counted.

Control

Pulled-forward sales and cannibalization can only be measured with comparison chains without promotion. The sliders are your assumptions, whereas the decomposition of your promotions is in your sell-out data.

What this page assumes, fully disclosed

Every number on this page follows arithmetically from the slider values. In addition:

  • Example values: all starting values are fictitious. They are not customer data, not industry benchmarks, and deliberately not the values of the sample company from the nine modules.
  • Seasonal volume: newsvendor calculation with normally distributed demand; the forecast error is the dispersion in percent of expected sales. Fixed quantity 120 grams per unit for the overhang in metric tons. The best volume is the profit-maximizing volume of the model, not a recommendation.
  • Cocoa coverage: the price paths are driftless and lognormally distributed. The model makes no statement about the direction of the cocoa price. The price fluctuation is an assumption of the visitor, not a forecast. Fixed random seed, 500 paths. Two calls with the same sliders deliver the same picture. Each path runs over 52 weekly steps. Extreme price jumps and regime changes are captured by the distribution only as far as its tail allows. Premiums, margin costs, and basis risk of the coverage are not included. The calculation shows dispersion, not the cost of hedging. The simulation is not a recommendation for a coverage ratio. The mean of annual costs is the same at every coverage ratio; that is how the model is built.
  • Changeover sequence: pure arithmetic; the reduction applies equally to changeover time and transition scrap; energy and cleaning agents are not counted.
  • Promotion: deterministic decomposition with a fixed regular price of €1.90 per unit; trade terms, secondary placement, and leaflets are not counted. A negative net effect is shown, not suppressed.
  • Not additive: the four results must not be added, because unit margin, cocoa price, line hour, and promotion contribution margin are four different quantities without a common cost function. The simulations deliberately share no sliders. The module total of the series stands only on the overview page; cocoa costs appear nowhere outside the cocoa coverage.
Note on the context of this portfolio

This page is a basis for conversation, not an offer. All values are illustrative calculations on freely adjustable assumptions; no number is a commitment, a forecast for a specific company, or an industry value.

In a real project your data replaces the sliders: your sell-out history delivers the forecast error, your purchasing policy the coverage ratio, your changeover matrix the reduction, your promotion settlement the decomposition. The calculation paths stay the same.

All 9 modules: AI in the chocolate factory