from random import randint
from matplotlib import pyplot

aankomsttijden = []

def aankomst_autos(tijdstip):
    aantal = randint(0, 10)
    for i in range(aantal):
        aankomsttijden.append(tijdstip)
        

def wegrijden_autos(aantal):
    totaal = 0
    for i in range(aantal):
        if len(aankomsttijden) > 0:
            totaal += aankomsttijden.pop(0)
    return totaal


x_waarden = list(range(60))
y_waarden = []

for tijdstip in range(60):
    aankomst_autos(tijdstip)
    aantal_weg = randint(1,3)
    totale_wachttijd = wegrijden_autos(aantal_weg)
    gemiddelde_wachttijd = ((aantal_weg * tijdstip) - totale_wachttijd) / aantal_weg
    y_waarden.append(gemiddelde_wachttijd)

pyplot.plot(x_waarden,y_waarden)
pyplot.show()
