simulation
==========
Requriements
------------
Requirements can be installed with Conda and pip
Python (3.5+) https://www.python.org/downloads/
NumPy (1.13+) https://scipy.org/install.html
Matplotlib (2.02+) https://matplotlib.org/
SimPy (3.0.10+) https://simpy.readthedocs.io/
opencv (3.0+) http://www.opencv.org/
Conda setup
-----------
Get miniconda from [here](https://docs.conda.io/en/latest/miniconda.html)
Install git:
> conda install git
Clone this repository
> git clone https://github.com/mwong009/simulation.git simulation
cd into the directory
> cd simulation
Installing
----------
From the project directory:
Windows:
C:\...\simulation> pip install -r requirements.txt
Linux:
/.../simulation> pip3 install -r requirements.txt
Usage and Documentation
-----------------------
SimPy is a process-based discrete-event simulation framework based on standard Python. Processes in SimPy are defined by Python generator functions and may, for example, be used to model active components like customers, vehicles or agents. SimPy also provides various types of shared resources to model limited capacity congestion points (like servers, checkout counters and tunnels).
From the project directory, run the command:
> python script.py
On linux:
> python3 script.py
**Hit spacebar to start**
Sample output:
car 1 arrived on link 1E at 0.03s (Q=0)
car 2 arrived on link 2S at 0.63s (Q=0)
car 3 arrived on link 6N at 0.73s (Q=0)
...
car 1 departed link 4E at 1.29s (Q=0)
car 6 arrived on link 6N at 1.71s (Q=0)
car 6 departed link 6N at 1.83s (Q=0)
...
car 96 arrived on link 7E at 37.20s (Q=0)
car 96 departed link 7E at 37.20s (Q=0)
car 99 departed link 6N at 38.10s (Q=0)
car 99 arrived on link 7E at 39.06s (Q=0)
car 99 departed link 7E at 39.06s (Q=0)
Statistics can be generated
[514 rows x 6 columns]
totalTravelTime totalSegments meanWaitTime
carID
1 3.759368 3 0.372207
2 7.340689 3 1.282778
3 2.007794 2 0.064265
4 1.956925 1 1.140182
5 5.664470 3 0.986793
6 1.404893 2 0.055849
7 4.237412 1 3.289740
8 3.490860 1 3.139994
9 2.345139 1 1.451333
10 4.175994 1 3.244251
11 7.098955 3 1.487988
...
Plotting done on Matplotlib
使用simpy进行离散事件流量模拟___下载.zip
版权申诉
135 浏览量
2023-04-16
19:45:36
上传
评论
收藏 37KB ZIP 举报
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
最新资源
- 2023-04-06-项目笔记 - 第一百五十四阶段 - 4.4.2.152全局变量的作用域-152 -2024.06.04
- 松哥解协议松哥解协议松哥解协议松哥解协议松哥解协议
- 618节日618节日618节日
- tensorflow-gpu-2.9.1-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp37-cp37m-win-amd64.whl
- tensorflow-gpu-2.9.0-cp39-cp39-win-amd64.whl
- lcd daimalcd daima
- 电影领域-推荐算法-个性化内容-观影决策-电影推荐小程序.zip
- 电气控制PLC考试题库
- 如何使用MATLAB简介
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈