Discrete event simulation can help businesses use computer modeling to virtually test manufacturing methods and procedures, greatly reducing the time and costs that physical testing of a manufacturing system would incur. In this project, we use Simpy to carry out a discrete event simulation and allow users to test a range of scenarios before buying tooling, reserving capacity, or coordinating other expensive production resources. Simulation can help users determine exactly what is needed to achieve their goals, such as inventory levels, replenishment rates, batch sizes, production planning, etc.
In this project, we are going to use a toy factory as an example. The process flow is shown in the picture below.
We are going to simulate production scenarios with different safety levels, labor hours, number of machines, and storage capacity. First, we need to determine how long we are going to run the simulation
For all the triangle objects, we need to determine the storage capacity and initial stock.
For the rectangle objects, we need to determine how many employees we have and how much time each process takes. We can use different distributions and select the one that best fits the raw data. Here we are going to use Normal Distribution and need to determine the mean and standard deviation for each process.
For each raw material, we need to create a container instance. Containers model the production and consumption of a homogeneous, undifferentiated bulk. It may either be continuous (like water) or discrete (like apples).
For each process, we need to create a Simpy process instance. The Process instance that is returned by Environment.process() can be utilized for process interactions.
Next is to define what a process exactly should do. By yielding the Process instance that Environment.process() returns, the run process starts waiting for it to finish. Take assemble as an example, an assembler needs to take one wood body, one wood head, one electronic, and an IC to assemble a toy. The time an assembler takes to finish one product follows a normal distribution. An important event type is a Timeout. Events of this type are triggered after a certain amount of (simulated) time has passed. The "get" function would take one unit from the raw material, and the "put" function would add one more unit to the raw material.
A simulation environment manages the simulation time as well as the scheduling and processing of events. It also provides means to step through or execute the simulation.
We could use simulation to try different production scenarios, a method that could greatly reduce the time and costs that physical testing of a manufacturing system would incur. For example, the first production scenario hires one IC tester, and the total number of toys made is 166.
If we hire 3 IC testers, the total number of toys made would become 329.
Another example is that we could use simulation to determine the storage capacity. When the IC capacity is 600, the total number of toys made is 334. When we change the capacity to 150, the total number of toys made is 331, meaning that IC does not require that much storage space.