Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/galenseilis/simq
Queueing network tool based on SimPy.
https://github.com/galenseilis/simq
discrete-event-simulation queueing-models queueing-networks queueing-systems simulation
Last synced: about 1 month ago
JSON representation
Queueing network tool based on SimPy.
- Host: GitHub
- URL: https://github.com/galenseilis/simq
- Owner: galenseilis
- License: apache-2.0
- Created: 2024-10-03T04:09:30.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T01:16:12.000Z (about 2 months ago)
- Last Synced: 2024-11-06T02:25:23.120Z (about 2 months ago)
- Topics: discrete-event-simulation, queueing-models, queueing-networks, queueing-systems, simulation
- Language: Python
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SimQ
Queueing network tool based on SimPy.
# Installation
```bash
pip install SimQ
```# Example
The following is a simple example of using SimQ to simulate a single-node queueing system.
```python
import simpy
from simdist import dists
from simq.core import Network, NodeSIMULATION_TIME: float = 30.0
def leave(customer_id: int, current_queue: Node, queue_system: Network) -> None:
queue_system.log(
{
"customer": customer_id,
"action": "routing",
"node": current_queue.name,
"destination": "exit",
}
)env = simpy.Environment()
queue = Node(
env,
name="Queue 2",
num_servers=1,
service_time_dist=dists.Gamma(5, 5),
inter_arrival_dist=dists.Gamma(1, 2),
routing_strategy=leave,
)system = Network(env, [queue])
system.start_customer_generation()
_ = env.run(until=SIMULATION_TIME)
for entry in system.event_log:
print(entry)
```