Discrete Event Simulation in Python
Diogo Costa (PhD, MSc)
Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific
This can assist with
Parameter space as samples increase
Example: Monte Carlo run to understand range of outputs of an event generator based on normal (gauss) distribution
import random as rd
import matplotlib.pyplot as plt
# Generating samples: Gaussian distribution
duration_sample = [rd.gauss(25, 5)
for i in range(5000)]
# Plotting
plt.scatter(duration_sample, np.r_[0:5000],
marker='.', c=duration_sample, cmap='CMRmap')
plt.xlabel("Duration [min]")
plt.ylabel("Monte Carlo Runs")
Plotting results
Underlying objective
Uncertainty in each process duration propagates through system
Results in different model trajectories
Referred to as Response Envelope
Example:
n_trajectories = 50
process_1 = {"Name": "Raw_material",
"OperationTime": 20,
"MaxDelayTimePercent": 10}
process_2 = {"Name": "Unloading",
"OperationTime": 15,
"MaxDelayTimePercent": 5}
Discrete Event Simulation in Python