Chocolate simulator

Simulate first,
then decide

Four decisions of one season. The starting values are example values: 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 - 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, once with that of a model.

Every slider is an assumption, not a fact. All starting values are fictitious example values - no customer data, no industry values, 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 - marker at the best volume of each
Seasonal volume today
units, profit-maximising
Seasonal volume with model
units, profit-maximising
Expected overhang
today → with model, in tonnes
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 tonnes uses 120 grams per unit. The residual value is the salvage after the season.

Control

Where your forecast error actually stands today is shown by the hindsight of the last three seasons - the slider does not replace it.

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 tonne
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 normalised 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

Which price fluctuation you assume for the coming year and which coverage ratio your purchasing policy provides is decided by purchasing and management - the curve only works through the assumptions.

The changeover sequence in line hours and tonnes

The simplest calculation on this page: how many line hours and how much transition scrap a better sequence frees up - 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 tonne
Value per year depending on the reduction - 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 tonne. In this calculation the reduction applies equally to time and scrap. Energy and cleaning agents of the changeovers are deliberately not counted.

Control

Which reduction your changeover matrix allows is shown only by optimisation on your measured changeover times - the slider does not replace it.

The net effect of a trade promotion

The promotion-week bar is not a metric. The simulation subtracts pulled-forward sales and cannibalisation 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
Cannibalisation within the range
Promotion discount
Contribution margin on regular price
Decomposition of the promotion result - incremental contribution margin, discount, pulled forward, cannibalised, net
Gross incremental sales
units in the promotion
Real incremental sales
after pulled-forward sales and cannibalisation
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 − cannibalisation 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; cannibalised contribution margin likewise. Net = incremental contribution margin − discount − missing later − missing at the neighbour. Trade terms, secondary placement costs and leaflets are deliberately not counted.

Control

Pulled-forward sales and cannibalisation can only be measured with comparison chains without promotion - the sliders are your assumptions, 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 - no customer data, no 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 tonnes. The best volume is the profit-maximising 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 - unit margin, cocoa price, line hour and promotion contribution margin are four different quantities without a common cost function; deliberately the simulations 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 model 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