0

I started simulating via SimPy in Python and am stuck simulating the uniformly distributed arrival of customer type A (25% of the total amount of customers), customer type B (30%), customer type C (35%) and customer type D (10%) on a daily 9AM-6PM basis.

Would anybody know how to approach this?

Thank you in advance :)

Milov
  • 15
  • 4

1 Answers1

1

Here is how I would simulate the arrival of 100 customers.

import random

p = ['A', 'B', 'C', 'D']
w = [0.25, 0.30, 0.35, 0.10]

size = 100
customers = random.choices(
    population=p,
    weights=w,
    k=size)

counts = { x: 0 for x in p }

for x in customers:
    counts[x] += 1 

print({x: counts[x]/size for x in counts})
Rusty Widebottom
  • 985
  • 2
  • 5
  • 14