GeezerVison is showing github.com — Sync simulation-with-simpy with the maintenance update of SimPy: Simu… · realpython/materials@6770e8f
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: simulation-with-simpy/README.md +10-2Lines changed: 10 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | # Simulating Real-World Processes With SimPy |
2 | 2 |
|
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 | +``` |
4 | 12 |
|
5 | 13 | ## Running the Script |
6 | 14 |
|
@@ -14,5 +22,5 @@ Input # of cashiers working: 1 |
14 | 22 | Input # of servers working: 1 |
15 | 23 | Input # of ushers working: 1 |
16 | 24 | Running simulation... |
17 | | -The average wait time is 42 minutes and 26 seconds. |
| 25 | +The average wait time is 42 minutes and 53 seconds. |
18 | 26 | ``` |
Collapse file
Copy file name to clipboard +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +simpy==4.1.2 |
Collapse file
Copy file name to clipboardExpand all lines: simulation-with-simpy/simulate.py +5-5Lines changed: 5 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -"""Companion code to https://realpython.com/simulation-with-simpy/ |
| 1 | +"""Companion code to https://realpython.com/simpy-simulating-with-python/ |
2 | 2 |
|
3 | | -'Simulating Real-World Processes With SimPy' |
| 3 | +'SimPy: Simulating Real-World Processes With Python' |
4 | 4 |
|
5 | | -Python version: 3.7.3 |
6 | | -SimPy version: 3.0.11 |
| 5 | +Python version: 3.15 |
| 6 | +SimPy version: 4.1.2 |
7 | 7 | """ |
8 | 8 |
|
9 | 9 | import random |
@@ -82,7 +82,7 @@ def get_user_input(): |
82 | 82 | params = [int(x) for x in params] |
83 | 83 | else: |
84 | 84 | print( |
85 | | - "Could not parse input. Simulation will use default values:", |
| 85 | + "Could not parse input. The simulation will use default values:", |
86 | 86 | "\n1 cashier, 1 server, 1 usher.", |
87 | 87 | ) |
88 | 88 | params = [1, 1, 1] |
|