Skip to content

Commit 6770e8f

Browse files
Sync simulation-with-simpy with the maintenance update of SimPy: Simulating Real-World Processes With Python (#932)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 308e297 commit 6770e8f

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

‎simulation-with-simpy/README.md‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Simulating Real-World Processes With SimPy
22

3-
Corresponding code for ["Simulating Real-World Processes With SimPy."](https://realpython.com/simulation-with-simpy/)
3+
Corresponding code for ["SimPy: Simulating Real-World Processes With Python."](https://realpython.com/simpy-simulating-with-python/)
4+
5+
## Requirements
6+
7+
The script runs on Python 3.8 or later. Install SimPy from `requirements.txt`:
8+
9+
```console
10+
$ python -m pip install -r requirements.txt
11+
```
412

513
## Running the Script
614

@@ -14,5 +22,5 @@ Input # of cashiers working: 1
1422
Input # of servers working: 1
1523
Input # of ushers working: 1
1624
Running simulation...
17-
The average wait time is 42 minutes and 26 seconds.
25+
The average wait time is 42 minutes and 53 seconds.
1826
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
simpy==4.1.2

‎simulation-with-simpy/simulate.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
"""Companion code to https://realpython.com/simulation-with-simpy/
1+
"""Companion code to https://realpython.com/simpy-simulating-with-python/
22
3-
'Simulating Real-World Processes With SimPy'
3+
'SimPy: Simulating Real-World Processes With Python'
44
5-
Python version: 3.7.3
6-
SimPy version: 3.0.11
5+
Python version: 3.15
6+
SimPy version: 4.1.2
77
"""
88

99
import random
@@ -82,7 +82,7 @@ def get_user_input():
8282
params = [int(x) for x in params]
8383
else:
8484
print(
85-
"Could not parse input. Simulation will use default values:",
85+
"Could not parse input. The simulation will use default values:",
8686
"\n1 cashier, 1 server, 1 usher.",
8787
)
8888
params = [1, 1, 1]

0 commit comments

Comments
 (0)