Introductie tot discrete-evenementsimulaties

Discrete Event Simulation in Python

Diogo Costa (PhD, MSc)

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

Discrete-evenement vs. continue modellen

Continue modellen

  • Draaien op vaste tijdstappen

  • Tijd is een dummyvariabele

    • Tijd wordt niet in de lus geüpdatet
  • Gebruik van tijd-for-loops

    for t range(time_range):
    

Discrete-evenementmodellen

  • Draaien op variabele tijdstappen

    • Voer/plan discrete events met verschillende duur in de tijd
  • Tijd is een toestandvariabele

    • Tijd wordt in de while-lus geüpdatet
    • Tijd is geen dummyvariabele
  • Gebruikt vaak while-lussen

    while (time < 365):
    time += process_duration
    
Discrete Event Simulation in Python

Componenten van discrete-evenementmodellen

  • Toestandvariabelen
  • Klok
  • Evenementenlijst (of Processenlijst)
  • Eindvoorwaarde(n)
Discrete Event Simulation in Python

Modelcomponenten

Voorbeeld: model taxibedrijf

while (time < 10):

    # Process 1
    time_duration_1 = manage_requests()
    time += time_duration_1

    # Process 1
    time_duration_2 = dispatch_taxi()
    time += time_duration_2

Eindvoorwaarde

while (time < 10)
  • Voorwaarde(n) die de simulatie stopt
Discrete Event Simulation in Python

Modelcomponenten

Voorbeeld: model taxibedrijf

while (time < 10):

    # Process 1
    time_duration_1 = manage_requests()
    time += time_duration_1

    # Process 1
    time_duration_2 = dispatch_taxi()
    time += time_duration_2

Klok

time += time_duration_1
time += time_duration_2
  • time houdt de huidige simulatie‑tijd bij
  • Klok springt naar starttijd van volgend event tijdens simulatie
  • Tijd “hopt” omdat events instantaan zijn
Discrete Event Simulation in Python

Modelcomponenten

Voorbeeld: model taxibedrijf

while (time < 10):

    # Process 1
    time_duration_1 = manage_requests()
    time += time_duration_1

    # Process 1
    time_duration_2 = dispatch_taxi()
    time += time_duration_2

Toestandvariabele

time
  • Verkort tijd tussen bellen en afzetten van klant

  • Variabelen die systeemoutput en efficiëntie bepalen

Discrete Event Simulation in Python

Laten we oefenen!

Discrete Event Simulation in Python

Preparing Video For Download...