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 met vaste tijdstappen

  • Tijd is een dummyvariabele

    • Tijd wordt niet bijgewerkt in de lus
  • Gebruik van tijd-for-lussen

    for t in range(time_range):
    

Discrete-evenementmodellen

  • Draaien met variabele tijdstappen

    • Plan/voer discrete events met verschillende duur uit in de tijd
  • Tijd is een toestandvariabele

    • Tijd wordt bijgewerkt in de while-lus
    • 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
  • Gebeurtenissenlijst (of Processenlijst)
  • Eindvoorwaarde(n)
Discrete Event Simulation in Python

Modelcomponenten

Voorbeeld: taxibedrijfsmodel

while (time < 10):

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

    # Process 2
    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: taxibedrijfsmodel

while (time < 10):

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

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

Klok

time += time_duration_1
time += time_duration_2
  • time houdt de huidige simulatietijd bij
  • Klok springt naar starttijd van volgende event tijdens simulatie
  • Tijd springt omdat events instantaan zijn
Discrete Event Simulation in Python

Modelcomponenten

Voorbeeld: taxibedrijfsmodel

while (time < 10):

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

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

Toestandvariabele

time
  • Verkort tijd tussen bellen en uitstappen klant

  • Variabelen die output en efficiëntie van het systeem bepalen

Discrete Event Simulation in Python

Laten we oefenen!

Discrete Event Simulation in Python

Preparing Video For Download...