Discrete Event Simulation in Python
Diogo Costa (PhD, MSc)
Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific
Continue modellen
Draaien met vaste tijdstappen
Tijd is een dummyvariabele
Gebruik van tijd-for-lussen
for t in range(time_range):
Discrete-evenementmodellen
Draaien met variabele tijdstappen
Tijd is een toestandvariabele
Gebruikt vaak while-lussen
while (time < 365):
time += process_duration
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)
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 bijVoorbeeld: 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