paper: Modeling port risk due to weather events

Fascinating paper that attempts to model and quantify financial risk to ports and associated logistics assets (e.g., terminals, road, rail) due to weather events. It can be a bit dense at times, so it helped me to print out and highlight. Worthwhile reading for anybody interested in supply chain risk, supply chain modeling, or logistics.

“The largest port-specific risk is found for ports in Asia, in particular mainland China and Taiwan… the Gulf of Mexico… and Western Europe. The Ports of Houston, Shanghai, Port Elizabeth (South Africa), Lazaro Cardenas (Mexico), and Rouen (France) are found to be the top 5 at-risk ports.

The port of Houston faces the largest risk from a combination of cyclone wind, pluvial [surface] flooding and fluvial [river] flooding.”

If you’re interested in modeling your supply chain and its associated risks, let’s talk. Data Driven Supply Chain LLC has case studies that may resonate.

Regards, Ralph

Happy new year

Happy New Year everyone! 2022 was my first full year of running my business, Data Driven Supply Chain LLC, after spending 15 years in the corporate world and military. I learned a tremendous amount. I met and worked with great people. I read a lot and wrote some.

I am grateful to have consulted for and trained several companies – Fortune 500, smaller market players, and startups – improve their supply chain through advanced analytics, data science, and artificial intelligence.

You can learn more about services and case studies here.

I am optimistic about 2023 and beyond, even as the world gives us plenty to be concerned about. We have only scratched the surface of how data, advanced analytics, and AI/ML techniques can make supply chains more nimble, robust, and future-proofed.

If you’re interested in a conversation about how you can do that – even if you’re not ready to engage now – please schedule a call here.

Thanks for reading, and I hope that 2023 is a year of growth for all.

End-to-end supply chain simulator

This is a guest post by Linnart Felkl M.Sc. and originally appeared on Supply Chain Data Analytics

It has been more than five years now that I graduated from university and entered the corporate world. Since then, I have dedicated most of my time to production and supply chain planning. Besides ERP-based model implementations, such as e.g. lot size optimization or production levelling in SAP, I have always been heavily involved with discrete-event simulation modeling. I have worked with several tools and in this article I will summarize a end-to-end simulation-based poultry supply chain analysis tool that I implemented in Python.

Simulation fosters better understanding of control logics

The simulation tool described by me in the article helped the client in several ways:

  • Better understanding of existing processes and dependencies throughout the supply chain
  • Common reference for discussion between the various internal stakeholder groups
  • Predict the impact of certain policy and control flow adjustments
  • End-to-end supply chain cost transparency
  • Tool for training new supply chain managers

The tool optimized a vertically integrated poultry meat processing business in the Mediterranean region. The regulatory framework for poultry meat farming is comprehensive, and while regulatory authorities were not involved in the development and deployment of this simulation tool it could very well serve regulatory authorities in similar ways. Regulatory constraints, such as e.g. All-In All-Out rules (also known in e.g. swine production), were however off course considered by the model and implemented accordingly.

Conceptional poultry supply chain model description

The poultry supply chain comprises many stages. Below figure provides an overview.

The relevant entities that I would like to highlight for a conceptual overview are the following:

  • Egg farmer. Produces and supplies eggs to the hatchery.
  • Hatchery. Hatches eggs in a series of processes, namely incubation, hatching, and brooding.
  • Farmer. Receives the chickens from the brooder and grows them in farm coops.
  • Slaughter facility. Receives or collects chicken from farm coops once they have reached slaughter-ready weight.
  • Meat processor. Pulls carcass demand for meat processing from slaughterhouse finished product storage.
  • Distributor. Places orders for finished product at the meat processor, temporarily stores and re-distributes processed meat to markets.
  • Market. Places orders at the distributor and sells processed meat in the market to end consumer.

Below conceptual model drawing provides another overview of the processes considered by the poultry supply chain simulation tool.

The poultry supply chain is a heavily regulated supply chain. As mentioned regulatory constraints are part of the model. Such rules e.g. aim at reducing the risk of disease spread and they are common to meat production beyond poultry meat production (e.g. swine production).

Control logics, regulations and information flow models

The simulation model comprises a wide range of control logics, rules and order-related information flows. Below table provides an overview.

Egg supplier, customer order logicEgg supplier ships based on order logWith a specified interval, the egg supplier checks the order book and ships the requested quantity
Egg supplier, order shipping logicFull order quantity shippedFull quantity is shipped the same day, but arrives after a specified transportation lead time
Hatchery, inventory management logicInventory for incoming eggs ahead of incubatorOrder point policies control the egg inventory. When demand falls below a specified level, an order is placed at the egg supplier that targets a fixed higher inventory level
Hatchery, incubation and hatching processIncubation and hatching black box processesIncubation and hatching have a specified duration and a specified production capacity. There also is a specified hatching success ratio and a specified mortality
Hatchery, brooding at brooderBrooder process follows incubation and successful hatchingBefore chicks are sent to a farm coop they stay at the brooder for a specified duration. Mortality rates are defined for this process, too
Hatchery, flock assignment to hatchery coopsAfter chicks have stayed at brooder for a minimum specified amount of time they are forwarded to a farm coopFarm coops must be ready for a new flock, and toms and hens cannot be mixed. Farm coops have different capacities, as they are located at different farms. Chickens should be assigned to coops with the least excess capacity
Farm coops, chicken growthChicken growth in farm coop differs from chicken species and sexChickens, depending on their sex and species, stay at the farm coop for a specified amount of time. This duration time models chicken growth until slaughter ready weight
Farm coops, forwarding chicken turkey to slaughterChickens forwarded to slaughterhouse when matureOnce chickens have reached slaughter-ready weight they are forwarded if the slaughterhouse has capacity. Otherwise they wait in the farm coop. After that the farm coop is sanitized. At this stage, relevant regulatory rules considered and embedded into the simulation model
Slaughterhouse, slaughter processDaily slaughter processSlaughterhouse slaughters chicken up to a specified maximum daily production capacity
Slaughterhouse, carcass inventoryProduction on stock, but demand-pulled inventoryThe meat processor pulls its carcass demand from the slaughterhouse inventory
Slaughterhouse, order backlogMeat processor places backlog at slaughterhouse if carcass inventory does not sufficeBacklog is satisfied in the upcoming production cycle and carcass is only produced on stock if no backlog orders are open
Slaughterhouse, external chicken purchaseExternal chicken are purchased if slaughterhouse inventory and current slaughter process volume is too lowIf demand for poultry carcass is higher than the carcass inventory and the carcass currently in production external poultry is purchased and slaughtered, occupying production capacity accordingly. Externally purchased poultry is always slaughtered first
Meat processor, carcass demandCarcass demand distribution, to be pulled from slaughterhouse carcass inventoryDifferent demand models can be implemented. For example, a deterministic or stochastic demand schedule can be implemented with specified demand by period

All of the logic summarized in above table was parametrized. Related values are adjustable in a configuration file. This allows users to run different scenarios, thereby gaining a better understanding of the supply chain.

Simulation model implementation in Python using SimPy

Throughout the past 5 years of model development, I have worked with various tools and software for discrete-event simulation modeling. Some popular tools are FlexSim, simio, AnyLogic, SIEMENS Plant Simulation, VisualComponents, Simul8 and many more. Many commercial simulation tools exist, and all of the just mentioned ones are commercial software. This model, however, I developed in SimPy, a discrete-event simulation framework in Python. This framework is free – but that was not the reason why I chose it.

SimPy is pure code. It does not have a graphical user interface (GUI) that the model developer can use for model development. It furthermore does not have any inbuilt model visualization. In other words, building and verifying a model in SimPy is highly abstract – but, since it is pure Python code, it is also highly flexible. For supply chain modeling, with many different entities and a wide range of possible control logics, this makes SimPy a good choice. In combination with object-oriented programming, that is. Object oriented programming is a requirement in this case, as it allows for framework development and appropriate structuring of the very complex task of modeling a supply chain with all its processes and entities. Users of the model do however need to have some understanding of Python.

Exemplary model output and results

In this section I display some exemplary model output that the poultry supply chain simulator generates. Data is collected and displayed in chicken units, i.e. unit neutral. This delivers a solid foundation for calculating relevant KPIs on top of that. Relevant KPIs could be costs and weight. Such KPIs can be implemented for clients on demand, by adding some few lines of code to the supply chain simulator.

Below chart shows inventory development at the slaughterhouse, i.e. carcass inventory. Too much inventory would result in high holding costs, and ultimately it would mean that carcass would have to be disposed of due to expiration dates and related policies.

Carcass inventory according to poultry supply chain simulator

Above chart shows inventory development at the slaughterhouse throughout one simulated year with 52 weeks (simulation periods). In this run, each week was one iteration of the simulation run. Inventory development at the slaughterhouse is directly connected to backlog development. This development can be seen on below graph.

Carcass backlog according to poultry production simulator

As becomes clear from above chart, no carcass inventory built up at the slaughterhouse because the slaughterhouse was always running behind meat processor demand, resulting in significant backlog.

Due to the existing backlog ordering policies at the slaughterhouse, high backlog triggered high purchasing orders at external poultry farms. Since externally purchased poultry is always slaughtered first, this resulted in excess inventory at the brooder, as it is waiting for farm coops to clear.

Brooder chicken population size resulting from poultry supply chain simulation

The brooder itself had no capacity limit, and the hatchery was thus not impacted by the production bottleneck ahead. This becomes clear from below inventory curve for eggs at the hatchery.

Inventory development in poultry supply chain simulation

Egg inventory development at the hatchery was stable.

Final remarks on poultry supply chain simulation

In this article, I demonstrated how discrete-event simulation is a powerful tool for modeling and analyzing poultry supply chains. The benefits of deploying a supply chain simulator are manifold, with all benefits ultimately aiming at supply chain cost reduction and availability (i.e. customer satisfaction) improvement. This is especially important in a poultry supply chain, as high inventory holdings result in e.g. carcass expiration and disposal. Deploying a supply chain simulator helped my client gain a better understanding about existing supply chain control logics and policies, and equipped the supply chain management team with an effective communication, training and analysis tool.

If you are interested in discrete-event simulation you may also be interested in some of the following related publications:

Success Story!

Another client success! If you’re interested in learning how Data Driven Supply Chain LLC can help you navigate the uncertain supply chain waters with supply chain modeling and advanced analytics, please email me for a free consultation:

I recently was brought in to help a client, a B2C segment leader with double-digit annual growth projections, facing major decisions in its first-mile network.

After working closely with the client team to understand its first-mile pain points and end-to-end product flow, I developed a bespoke supply chain network optimization model to enable rapid “what-if” scenario analysis, all using open source tools.

Working with the client team, we landed on several scenarios around port optimization, port risk mitigation, and make/buy decisions for key products.

As part of the project deliverables, the client received a custom-built dashboard app (using Shiny) of the scenario results, including maps, summary graphics, and detailed results, which facilitated further internal discussions.

Many thanks to this client and, if this is the kind of hands-on, in-depth modeling your supply chain could use, please reach out!

Project completed end-to-end using R, packages including: tidyverse, ggplot2, leaflet, gurobi, ompr, and Shiny

Announcement: Tool To Validate Your Latitude / Longitude

When I start a project with a new client, I request the locations of their facilities and, if applicable, their customers. Usually, the data I receive includes street address, ZIP code, and latitude and longitude. 

Unfortunately, the latitude & longitude are not always correct.  I take a “trust but verify” approach, mapping the locations using provided lat/long, and making a visual judgment.  (e.g., Antarctica is unlikely, as is Eastern Europe or central Asia for US-centric companies – all issues I’ve found with provided geocodes.  And don’t forget Null Island, at lat 0 / long 0.)

The trouble with the visual approach is that it is also quite error-prone; a location may be incorrectly geocoded but not immediately obvious.  For example, if your business has a lot of customers in Ohio, a pin that’s in northern Ohio but should be in southern Ohio, does not throw up red flags.  Even worse, if your business has a lot of customers throughout the Midwestern United States, a Minnesota address may have a Michigan pin – quite a distance away, yet also not immediately obvious.  These mistakes can be particularly troublesome if they involve higher-volume customers or facilities.

To help reduce some of this error, and speed up data validation, I have created a tool that takes as its input latitude and longitude, and returns the U.S. state or territory it is in, and what ZIP Code it is in (actually, ZIP Code Tabulation Area – ZCTA – similar to, but not exactly the same as, the ZIP code). If the lat/long is not in the U.S., or the tool cannot find the results in a short time, the tool returns “unknown”.

The tool is available as both a Shiny app and an API.  My hope is that the supply chain analyst community can use this tool to quickly validate geocoded latitude & longitude, comparing the lat/long’s state and ZCTA to the state and ZIP in a dataset, and flagging obvious problems for further investigation.

For a week or two, I’m opening the Shiny app and API for free, for initial use and feedback. After that, I will require a small usage fee, but for now my only request is your feedback!

How to use them:

Shiny app:  (redirects to

Instructions are in the app.  You can either upload a CSV, or directly copy/paste your latitude & longitude into a table. You can download results to CSV.

API endpoints (GET).  Replace (latitude 42, longitude -93) with your coordinates in the API call.

State (returns postal code abbreviation):

Thanks and hope this helps!  Please provide your feedback either in the comments or email