Monday, April 27, 2015

Don’t Pay with Pennies

Have you ever been in line behind someone who pays with pennies? It’s not good is it? There’s time for counting, higher chance of error, and not enough space in the cash register to store all of the pennies. However, I see the same technique in simulation models quite often. This is because modelers tend to make a literal translation of the system into the simulation model. With a little thought, it is often more efficient to work with in terms of a group rather than a single item.

Let’s look at some examples of paying with pennies in simulation models:

  • Processing a batch of parts one-at-a-time. Typically this is breaking the batch into individual units processing them and re-batching them into a single unit for transport to the next operation.
  • In Logistics we WANT to model supply chains where every case represents an item.  We WANT to see every case / pallet get moved around and individually placed on the truck for the shipment.  The model should really only care about the fact that it took X minutes to load the truck and X, Y, and Z amounts of inventory was removed from the warehouse.
  • Allocating an array one row at a time. If you are storing results in an output table or an array it is tempting to add results one row at a time as you generate the results. However, this will cause the simulation software to allocate memory in small chunks. And, memory allocation is a relatively slow process in the simulation model. I do know that if you allocate one row in an ExtendSim database table, space is reserved for more rows should you need them, but this is still much less efficient than adding all of the rows that you will need once at the start of the simulation.
When building a model, look for opportunities to group actions together. Consider the work that the CPU will have to go through to simulate the model that you built. When you can:

  • Group items together and process them as a single unit. Use math and attributes to calculate model features such as delays and yield rates.
  • Track information in tables instead of individual items. For example inventory can be represented by a series of linked database tables.
  • Perform operations once, at the start of the simulation. This works well for setting up arrays and tables.
  • Use discrete-rate simulation to model high speed processes such as bottling and filling lines.

While I use ExtendSim, the above techniques would be useful for any simulation software. Considering methods for reducing the number and type of calculations will yield benefits both in modeling and run time.

I would like to thank Robin Clark for his comments and input on this topic.

No comments:

Post a Comment