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 this article helped the user 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.
STAGE, CATEGORY | DESCRIPTION | IMPLEMENTATION |
Egg supplier, customer order logic | Egg supplier ships based on order log | With a specified interval, the egg supplier checks the order book and ships the requested quantity |
Egg supplier, order shipping logic | Full order quantity shipped | Full quantity is shipped the same day, but arrives after a specified transportation lead time |
Hatchery, inventory management logic | Inventory for incoming eggs ahead of incubator | Order 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 process | Incubation and hatching black box processes | Incubation 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 brooder | Brooder process follows incubation and successful hatching | Before 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 coops | After chicks have stayed at brooder for a minimum specified amount of time they are forwarded to a farm coop | Farm 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 growth | Chicken growth in farm coop differs from chicken species and sex | Chickens, 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 slaughter | Chickens forwarded to slaughterhouse when mature | Once 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 process | Daily slaughter process | Slaughterhouse slaughters chicken up to a specified maximum daily production capacity |
Slaughterhouse, carcass inventory | Production on stock, but demand-pulled inventory | The meat processor pulls its carcass demand from the slaughterhouse inventory |
Slaughterhouse, order backlog | Meat processor places backlog at slaughterhouse if carcass inventory does not suffice | Backlog is satisfied in the upcoming production cycle and carcass is only produced on stock if no backlog orders are open |
Slaughterhouse, external chicken purchase | External chicken are purchased if slaughterhouse inventory and current slaughter process volume is too low | If 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 demand | Carcass demand distribution, to be pulled from slaughterhouse carcass inventory | Different 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). I.e. the model developer cannot use a GUI for model implementation. Furthermore, SimPy 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. Any adjustments of the modeling framework itself will require a good understanding of Python and object-oriented programming.
Exemplary model output and results
In this section I display some exemplary model output that was outputted by the poultry supply chain simulator. 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 weights (e.g. of chicken or carcass). Such KPIs can be implemented for users on demand, by adding some few lines of code to the supply chain simulator – or, by adjusting (i.e. replacing) some existing lines of code.
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.
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 in below graph.
As becomes clear from above chart, no carcass inventory built up at the slaughterhouse. This is because the slaughterhouse was always running behind meat processor demand, resulting in significant backlog.
Due to the existing backlog-related ordering policies at the slaughterhouse, high backlog triggers high-volume purchasing orders at external poultry farms. Since externally purchased poultry is always slaughtered first this results in significant inventory at the brooder. The brooder is waiting for farm coops to clear and, in this simulation run, has no capacity constraints in that regard.
As the brooder itself has no capacity limit the hatchery was thus not impacted by the production bottleneck down-stream. This becomes clear from below graph visualizing egg inventory at the hatchery.
Egg inventory development at the hatchery was stable throughout the simulation run.
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 users 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:
- Link: Discrete-event simulation procedure model
- Link: Machine learning and discrete-event simulation
- Link: Simmer in R for discrete-event simulation
- Link: Crane yard simulation in AnyLogic
- Link: AGV simulation of part routings in AnyLogic
Data scientist focusing on simulation, optimization and modeling in R, SQL, VBA and Python
Leave a Reply