Simulation d’événements discrets en Python
Diogo Costa (PhD, MSc)
Adjunct Professor, University of Saskatchewan, Canada & CEO of ImpactBLUE-Scientific
REMARQUE : Les termes « événement » et « processus » sont utilisés de façon interchangeable.
Qu’est-ce que la non-déterminisme d’un événement (ou processus) ?
Pourquoi les processus déterministes sont-ils importants ?
Monde naturel
Processus d’origine humaine
Processus non déterministes
Statistiques
Le package random est utile pour cela
Exemple : random.randint(start, end)
import random
# Non-deterministic processes
process_1 = [5, 15]
while time < simulation_time:
# Update simulation time: process_1
time += random.randint(
process_1[0],
process_1[1])
Pas de méthode spécifique pour ces processus
Variabilité de durée calculée comme pour les modèles sans SimPy
Passer les bonnes statistiques à .timeout()
import random
# Non-deterministic processes
process_1 = [5, 15]
while True:
# Update simulation time: process_1
yield env.timeout(random.randint(
process_1[0],
process_1[1]))
Simulation d’événements discrets en Python