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. Each day consists of the following process steps and phases:

  1. The day starts with making planning decisions (demand forecasting and production planning) and ordering the required materials (lemons, sugar, water, ice cubes, paper cups).
  2. Some time later, the ordered materials are delivered, the planned quantity of lemonade is produced 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 ice cubes 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, 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. There is no sales price planning (all prices are fixed). Customer orders are aggregated into a random daily demand quantity. An aggregate replenishment order is directly converted into a corresponding daily delivery. Due to reliable just-in-time deliveries there is no need for inventory management.
  2. In the second model, Lemonade-Stand-2, 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, production planning and ordering the required materials. All ordered materials are delivered at 10 am. The planned quantity of lemonade is produced 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 ice cubes.

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-1 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 LemonadeStand-1 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 input items.

Information Design Model

The basic 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. DailyDelivery
  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