GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • simulation-with-simpy
    • README.md
    • requirements.txt
    • simulate.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎simulation-with-simpy/README.md‎

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 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
```
Collapse file

‎simulation-with-simpy/requirements.txt‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
simpy==4.1.2
Collapse file

‎simulation-with-simpy/simulate.py‎

Copy file name to clipboardExpand all lines: simulation-with-simpy/simulate.py
+5-5Lines 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 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.