1. Learn
  2. /
  3. Courses
  4. /
  5. Discrete Event Simulation in Python

Connected

Exercise

Garment Production: Multi-processes and modularity

You have been asked to create a discrete-event model to help optimize a garment production factory situated in the Italian city of Milan, known as the fashion capital.

You are super excited and want to make sure you build a helpful and scalable model because you know that the garment industry is complex and involves many processes and resources, which you are still becoming familiar with.

You did your research and came up with the list of processes shown in the table below. You were diligent and created a separate function for each process to make your model modular and allow it to grow in a controlled manner.

Now, you have received feedback from your manager, and you were told to include a new process in the model to account for "Spot cleaning and laundry", which should go between steps 8 and 9 (see the table row highlighted in red). The packages random and simpy have been imported.

Table with process names, respective functions, and information about whether the process has been incorporated in the model.

Instructions 1/3

undefined XP
    1
    2
    3
  • Create a new function spot_cleaning_and_laundry() to include calculate the duration of the new process.
  • In your main generator all_processes(), add a call to this new function and specify gen_type=gauss to use the Gaussian random generator, passing as well the arguments gauss_mean=60(average) and gauss_std=10 (standard deviation); arguments unif_start and unif_end don't need to be passed as they refer to gen_type=uniform and are defaulted to None.
  • Account for the calculated duration of the new process (tnew) in the variable total_duration.