Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23bb6f4 commit 8ab1258Copy full SHA for 8ab1258
1 file changed
Doc/library/random.rst
@@ -429,12 +429,12 @@ Simulation of arrival times and service deliveries in a single server queue::
429
430
num_waiting = 0
431
arrival = service_end = 0.0
432
- for i in range(10000):
433
- num_waiting += 1
434
- arrival += expovariate(1.0 / average_arrival_interval)
435
- print(f'{arrival:6.1f} arrived')
436
-
437
- while arrival > service_end:
+ for i in range(20000):
+ if arrival <= service_end:
+ num_waiting += 1
+ arrival += expovariate(1.0 / average_arrival_interval)
+ print(f'{arrival:6.1f} arrived')
+ else:
438
num_waiting -= 1
439
service_start = service_end if num_waiting else arrival
440
service_time = gauss(average_service_time, stdev_service_time)
0 commit comments