Diskrete-Ereignis-Simulation mit Python
Diogo Costa (PhD, MSc)
Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific
Beschreibung eines natürlichen oder menschengemachten Systems mit mathematischen Konzepten und Sprache.
Modelle lassen sich einteilen in:
Mathematische Modelle können einfach oder komplex sein.
George Box: "Alle Modelle sind falsch, aber einige sind nützlich."

Modell des Flussabflusses

Dieses Modell sagt den Abfluss an der hydrologischen Station Goaya (China) voraus.
Die Vorhersage basiert auf Niederschlagsdaten als Modelleingabe.
Weitere Beispiele
Inflation vorhersagen

Weitere Beispiele
# Define model parameters
processes = {"process_1": 5,
"process_2": 2,
"process_3": 3}
# Simulation period
simulation_time = 365
# Run model
discrete_model(processes, simulation_time)
def discrete_model(processes, simulation_time): # 1) Run end-condition while (time < simulation_time): process_names = list(processes.keys())# 2) Loop over all processes for p in range(len(process_names)): process_name_p = process_names[p]# 3) Account for effect of each process time += processes[process_name_p]
Beispielausgabe eines diskreten Ereignismodells für eine Fertigungsaktivität
=> START OF SIMULATION (Time = 0 days)
Time = 6.00 days | Process Complete: Transport of raw material
Time = 9.00 days | Process Complete: Building components
Time = 11.00 days | Process Complete: Assembling parts
Time = 14.00 days | Process Complete: Selling product
=> COMPLETED: Supply-Chain cycle #1 | Time = 15.5 days
Time = 21.50 days | Process Complete: Transport raw material
Time = 24.50 days | Process Complete: Building components
Time = 26.50 days | Process Complete: Assembling parts
Time = 29.50 days | Process Complete: Selling product
=> COMPLETED: Supply-Chain cycle #2 | Time = 31.0 days
Grafische Darstellung der Modellergebnisse: hilft, Muster und Kipppunkte zu erkennen.
Visualisierung auf Simulationsziele zuschneiden.
Nützliche Pakete: matplotlib, seaborn, plotly.

Beispiele
y) gegen die Zeit (x)plt.plot(x, y, color='green', marker='o',
markersize=12, linestyle='dashed',
linewidth=2)
x bündeln und Werte pro Bin zählenplt.hist(x, 50, density=True,
facecolor='g', alpha=0.75)
Diskrete-Ereignis-Simulation mit Python