Discrete Event Simulation in Python
Diogo Costa (PhD, MSc)
Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific

Voorbeeld: Beheer van passagiersstromen op luchthavens
Deterministische processen
Voorbeeld: Lasmachine
Doorlooptijd = Lengte van de laslijn × Snelheid van de lasmachine
Niet-deterministische processen

Voorbeeld: Assemblagelijn met lassen
2 deterministische processenwelding_1 welding_2
welding_1
5 uurwelding_2
length * hours_per_lengthEen dictionary maken voor elk proces:
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
}
Voorbeeld: De assemblagelijn
2 niet-deterministische processen
manual_assembly_1 manual_assembly_2
manual_assembly_1
80 uur5 uurmanual_assembly_2
20 uur2 uurEen dictionary maken voor elk proces:
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}
Productiesequentie van processen

Discreet-evenementmodel
# 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