Discrete Event Simulation in Python
Diogo Costa (PhD, MSc)
Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific
NOTE: Terms "event" and "process" used interchangeably.
What is event (or process) determinism?
Why are deterministic processes important?
Natural world
Human-driven or human-initiated
Deterministic processes
Process duration needs to be accounted for in the simulation time
# Deterministic processes (time in hours) duration_process_1 = 10 duration_process_2 = 5
while sim_time < total_sim_time:
# Update simulation time: Process 1 sim_time += duration_process_1
# Update simulation time: Process 2 sim_time += duration_process_2
A SimPy implementation of deterministic events:
.timeout()
method clocks-in duration of process# Deterministic processes
duration_process_1 = 10
duration_process_2 = 5
while True:
# Update simulation time: Process 1
env.timeout(duration_process_1)
# Update simulation time: Process 2
env.timeout(duration_process_2)
Discrete Event Simulation in Python