Combining deterministic and non-deterministic processes

Discrete Event Simulation in Python

Diogo Costa (PhD, MSc)

Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific

Deterministic and non-deterministic processes

Diagram showing the sequence of processes of a given system. It starts with a deterministic process, Process A, followed by a non-deterministic process, Process B, and finalizes with another deterministic process, Process C.

Example: Management of passenger flow in airports

  • Non-deterministic: Time a passenger arrives at the airport
  • Deterministic: Transport of luggage inside the airport once checked-in
Discrete Event Simulation in Python

Example: Assembly line in a factory

Deterministic processes

  • Transport of raw material to factory
  • Fully automated steps
  • Quality inspections
  • Packaging
  • Transport the new product to customers

Example: Welding machine

Processing time = Length of welding line x Speed of the welding machine

Non-deterministic processes

  • Order of Raw Material
  • Manual assembly of complex parts

Scatter plot showing the duration of a particular manual assembly as it is repeated multiple times.

Discrete Event Simulation in Python

Deterministic processes

Example: Assembly line with welding

  • 2 deterministic processes
    welding_1 welding_2

  • welding_1

    • Name of process: Welding component A
    • Processing time: 5 hours
  • welding_2

    • Name of process: Welding component B
    • Processing time: length * hours_per_length

Creating a dictionary for each process:

welding_1 = {
    "name": "Welding component A",
    "time_hours": 5
}

length = 20   # meters
hours_per_length = 0.2  # hours 

welding_2 = {
    "name": "Welding component B",
    "time_hours": length * hours_per_length
}
Discrete Event Simulation in Python

Non-deterministic processes

Example: The assembly line

  • 2 non-deterministic processes manual_assembly_1 manual_assembly_2

  • manual_assembly_1

    • Name of process: Manual Assembly A
    • Average processing time: 80 hours
    • Standard deviation: 5 hours
  • manual_assembly_2

    • Name of process: Manual Assembly B"
    • Average processing time: 20 hours
  • Standard deviation: 2 hours

Creating a dictionary for each process:

manual_assembly_1 = {
    "name": "Manual Assembly A",
    "time_hours": 80,
    "std_hours": 5
}
manual_assembly_2 = {
    "name": "Manual Assembly B",
    "time_hours": 20,
    "std_hours": 2}
Discrete Event Simulation in Python

Build an event-based simulation

Manufacturing sequence of processes Diagram showing the sequence of processes of a manufacturing activity, which includes the following processes in chronological order: welding_1, manual_assembly_1, manual_assembly_2, and welding_2.

Discrete-event model

# Initiate time-tracking variable
time = numpy.zeros(number_of_processes)

# Next-event time progression time[0] = 0 time[1] = time[0] + welding_1["time_hours"] time[2] = time[1] + rd.gauss(manual_assembly_1["time_hours"], manual_assembly_1["std_hours"]) time[3] = time[2] + rd.gauss(manual_assembly_2["time_hours"], manual_assembly_2["std_hours"]) time[4] = time[3] + welding_2["time_hours"] time[5] = time[4]
Discrete Event Simulation in Python

Time units and exploring model

  • Time units
    • Ensure time units are consistent for all processes.
Discrete Event Simulation in Python

Let's practice!

Discrete Event Simulation in Python

Preparing Video For Download...