A Lemonade Stand as a Manufacturing Company Back to simulation

A lemonade seller makes lemonade in pitchers and sells it in paper cups at a stand in a street market. Each day consists of the following process steps and phases:

  1. The day starts with making planning decisions (demand forecasting, production planning and sales price planning) and ordering the required materials (lemons, sugar, water, ice cubes, paper cups).
  2. Some time later, the planned quantity of lemonade is produced, the sales price is decided and the stand is opened.
  3. Then, customers arrive randomly and order a cup of lemonade. As long as there is still lemonade in stock, customer orders are served.
  4. At the end of the day, the lemonade stand is closed and the remaining lemonade and expired input items are dumped.

A lemonade stand can be modeled in a generic way as an instance of a single product manufacturing company that uses an input inventory and transforms input items into an output item (the product). We make a series of three increasingly complex models of lemonade stands:

  1. In the basic model, Lemonade-Stand-1, we build a scenario with just one lemonade stand (a monopoly) and we abstract away from market conditions, customers and individual customer orders as well as from suppliers, individual replenishment orders and corresponding deliveries, inventory management, marketing activities and competition. Customer orders are aggregated into a daily demand quantity. An aggregate replenishment order is directly converted into a corresponding daily delivery. Due to just-in-time deliveries there is no need for inventory management.
  2. In the Lemonade-Stand-2 model, we consider individual deliveries (with random lead times), inventory management (with perishable items) and market conditions dominated by the weather.
  3. In the third model, we consider individual customers and we build a scenario with several lemonade stands that compete with each other.
Background

The Lemonade Stand Game was developed in 1973 by Bob Jamison for mainframe computers and was later ported to the Apple II platform in 1979 and distributed by Apple throughout the 1980s. Play the Apple II Lemonade Stand Game in an Apple II emulator.

Simulation Design

It is assumed that the day starts at 8 am with demand forecasting (based on the weather forecast), production planning and ordering materials for restocking the inventory. Due to random lead times, the replenishment orders result in deliveries on the same day or on one of the following days at 2 pm. The planned product quantity is produced and, depending on the weather, the sales price is decided at 11 am. Abstracting away from individual purchase events, customer demand is aggregated in a daily demand event at 5 pm. Finally, the business day ends at 6 pm with dumping the remaining lemonade and the expired input items.

Following the Object Event Modeling and Simulation (OEM&S) paradigm, we first model the system's object types (defining its state structure) together with its event types in an information model, and then the system's dynamics in the form of event rules in a process model.

The Lemonade-Stand-2 model allows simulation-based active learning of the following topics:

  1. Bill of Materials

    A Bill of Materials (BoM) defines the composition of a product in the form of a list of component items, each with a quantity, as required for assembling a production unit. In general, a component item may also have a BoM, i.e. be composed of other items, such that a nested composition tree is obatined.

    In the case of a lemonade stand with lemonade as a product, the production unit may be a 3.5 ltr pitcher of lemonade, so we may have the following BoM:

    {"Lemon": 3, "Water": 2.5, "IceCubes": 20, "Sugar": 0.3}
  2. Demand Forecasting

    The demand of a new day can be forecasted on the basis of the previously recorded daily demand data, which forms a time series. The two most common forecasting methods for time series are the Simple Moving Average and the Exponentially Weighted Moving Average methods. In the Lemonade-Stand-2 model, the Simple Moving Average method is used.

  3. Production Planning

    The production quantity (in number of batches) is planned according to the demand forecast, but under the constraints of using the available input items in stock and the budget available for purchasing additional inpute items.

  4. Inventory Management

    Inventory management is one of the big topics in Operations Research, which is a scientific discipline that develops mathematical/analytical methods for decision-making in various application domains.

    The goal of inventory management is to satisfy demand and avoid stock-out events, while minimizing inventory costs. Too much inventory incurs unnecessary holding costs (and capital costs). Not having enough inventory results in stock-outs, impacting the ability to manufacture goods or provide customers with products.

    There are two different replenishment policies used in inventory management:

    1. The continuous replenishment policy is based on a reorder point, such that a new replenishment order is issued whenever the stock level falls below the reorder point.
    2. The periodic replenishment policy is based on a reorder interval, such that new replenishment orders are periodically issued whenever the reorder interval time has passed.

    For achieving a certain service level, the reorder point has to be set accordingly. A common approach for setting the reorder point (RP) is based on the concept of safety stock (SS), which is extra inventory beyond the expected lead time demand ELTD (the expected daily demand multiplied by the expected lead time in days):

    RP = ELTD + SS, with ELTD = E(D) ∗ E(LT)

    Now the question is how to compute the safety stock (on the assumption that both lead time and demand vary independently)?

    A simple approach (the “max – average” method) is to deduct the expected lead time demand from the maximum lead time demand MLTD:

    SS = MLTD - ELTD, with MLTD = E(D) ∗ max(LT),

    which implies that RP = MLTD.

  5. Sales Price Planning

    Normally, price planning is based on full costs per product unit, which are computed as fixed costs (mainly labor, and, e.g., depreciation on assets and marketing costs) plus variable costs (mainly input materials). In cost-plus pricing, the product price p is planned by adding a proportional profit to the costs c: p = c + rc where r is the planned profit rate.

    During favorable market conditions, full costs could be used for cost-plus pricing, while during periods of poor sales (e.g., due to increased competition), marginal costs may be used. The profit rate could be adapted when the PED of the product is changing. For instance, the lemonade stand could increase its planned profit rate when the weather conditions are sunny and warm, because under such conditions the otherwise very price-elastic demand for lemonade gets more inelastic, thus allowing for price increases without affecting the demand.

  6. Price Elasticity of Demand

    The Price Elasticity of Demand (PED) is a measure used to show the responsiveness, or elasticity, of the quantity demanded of a good or service to a change in its price. More precisely, it gives the percentage change in quantity demanded in response to a one percent change in price (ceteris paribus, i.e. holding constant all the other determinants of demand, such as income). In general, the demand for a good is said to be inelastic when the PED is less than one (in absolute value): that is, changes in price have a relatively small effect on the quantity of the good demanded. The demand for a good is said to be elastic when its PED is greater than one (in absolute value): that is, changes in price have a relatively large effect on the demand quantity of a good.

Information Design Model

The second version of the LSG model contains the following object types:

  1. SingleProductCompany
  2. InputItemType as a subtype of ItemType
  3. OutputItemType as a subtype of ItemType

and the following event types:

  1. StartOfDay
  2. Delivery
  3. DailyProduction
  4. DailyDemand
  5. EndOfDay
An information design model describing object types and event types.

Notice that the bill of materials (BoM) for a product batch is modeled by the the collection-valued property bomItems where each BoM item is of type BomItem, associating a quantity with an input item type. The collection values of the property bomItems can be implemented in the form of maps where input item type names (such as "Lemon") are the keys and quantities are their values:

{"Lemon": 3, "Water": 2.5, "IceCubes": 50, "Sugar": 0.3}
Process Design Model

A DPMN process design model can be decomposed into a set of event rule design models, one for each type of event specified in the design model.

T.B.D.

Implementation with OESjs

The JavaScript-based simulator OESjs implements the Object Event Simulation paradigm, and, consequently, allows a straight-forward coding of OEM class models and DPMN process models. You can inspect the model's OESjs code on the OES GitHub repo.

Implementing the Information Design Model

For implementing the information design model, we have to code all object types, event types and activity types specified in the model in the form of classes.

Implementing the Process Design Model

A DPMN process design model can be decomposed into a set of event rule design models, one for each type of event specified in the design model.

Back to simulation