Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sed-group/desim
https://github.com/sed-group/desim
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sed-group/desim
- Owner: sed-group
- License: mit
- Created: 2022-08-08T13:46:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-11T12:29:45.000Z (5 months ago)
- Last Synced: 2024-10-13T03:40:11.729Z (about 1 month ago)
- Language: Python
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-des - Github
README
# Discrete Event Simulation
Library to run a simple discrete event simulation. Runs on simpy.## Installation
1. Clone the repository
2. Run the following commands:`pip install wheel`
`pip install .`
3. Now the package `desim` is installed.
## Running a simulation
To run a simulation the suggestion is to use the interface provided in `desim/interface.py`
There the different types of simulations are provided.
Example code of running a monte carlo simulation:
```python
from desim.interface import Des
from desim.data import NonTechCost, TimeFormat
from desim.simulation import Processdsm = dict({
'Design Process': [0, 1, 0],
'Testing Process': [0, 0, 1],
'Manufacturing Process': [0, 0, 0.2]
})processes = [
Process(1, 10000, 100000, 0, 'Desing Process', NonTechCost.CONTINOUSLY, TimeFormat.MONTH),
Process(3, 5000, 30000, 0, 'Testing Process', NonTechCost.CONTINOUSLY, TimeFormat.YEAR),
Process(4, 300, 200, 100, 'Manufacturing Process', NonTechCost.CONTINOUSLY, TimeFormat.HOUR),
]non_tech_processes = [
NonTechnicalProcess("Quality Mangement Process", 10000, 0)
]flow_time = 3
flow_rate = 260
flow_start_process = "Testing Process"
non_tech_cost = NonTechCost.CONTINOUSLY
time_unit = TimeFormat.YEAR
until = 30
discount_rate = 0.08
runs = 100sim = Des()
results = sim.run_monte_carlo_simulation(flow_time, flow_rate, flow_start_process, processes,
non_tech_processes, non_tech_cost, dsm, time_unit, discount_rate, until, runs)```