Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

ProdSim is a process-based discrete event simulation for production environments based on the SimPy framework

License

NotificationsYou must be signed in to change notification settings

FuchsTom/ProdSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of contents

  1. Introduction
  2. Installation
  3. Requirements
  4. Documentation
  5. Examples
  6. Source code

Introduction

ProdSim is a process-based discrete event simulation for production environments based on theSimPy framework. The package is designed to generate largehigh-resolution synthetic production data sets.

The characteristics of a production system are represented by three system components, namely machines, workpieces, anda factory. These components interact with one another on the following three system layers:

  • logistics
  • stations
  • processes

The bottom level, namely the process level, models elementary assembly or machining operations in which the propertiesand behavior of the system components can be influenced. The middle level, namely the station level, maps the system’sbuffer stores and groups machines together into stations according to a workshop or line production. At the top level,namely the layout level, workpieces are created by sources and removed by sinks. In addition, the material flow ofworkpieces through the production process is described.

Users must define production processes in two input files. In a JSON file, all orders, stations, and the factory aredefined. In a Python script, the users specify the assembly and processing functions, the behavior of the sources andsinks, as well as global functions and user-defined distributions for attribute values.

Additionally, the package offers functionalities for the visualization of passed production processes, verification ofinput files, and methods for estimating the simulation runtime

The following code displays the typical usage of the package:

fromprodsimimportEnvironmentdefmain():# Create simulation environmentenv=Environment()# Read the input filesenv.read_files('./data/process.json','./data/function.py')# Inspect and visualize the input data (optional)# env.inspect()# env.visualize()# Start the simulationenv.simulate(sim_time=10_000,progress_bar=True,max_memory=5,bit_type=64)# export the output dataenv.data_to_csv("./data/output/",remove_column=['item_id'],keep_original=True)if__name__=='__main__':main()

Installation


NOTE

The program, as well as the installation described below, was tested for the operating systems Win10 and macOS. Acurrent Python version (>=3.8.0) is required.


Since the installation of ProdSim includes some additionalpackages, it is recommended to installProdSim in its own (virtual) environment. This environment can be created for example with the standard library venv. Inthe following the recommended and tested installation is described step by step. Of course, the program can also beinstalled in other ways as desired, this is left to the user.

  1. cd to the directory in which the environment should be created

    macOS:cd path

    Win10:cd path

  2. Create a new environment

    macOS:python3 -m venv ProdSim_venv

    Win10:py -m venv ProdSim_venv

  3. Activate the environment

    macOS:source ProdSim_venv/bin/activate

    Win10:ProdSim_venv\Scripts\activate

  4. Install ProdSim

    macOS:pip install path_to_ProdSim/dist/ProdSim-0.1.0.tar.gz

    Win10:pip install path_to_ProdSim\dist\ProdSim-0.1.0.tar.gz

To check if the installation was successful, the following Python script can be created and executed outside theProdSim folder. Thereby the environment in which ProdSim was installed must be active. If the installation was notsuccessful, aModuleNotFoundError is displayed.

from prodsim import Environment env = Environment()

NOTE

When using an old version of pip, a parse error may occur during installation. It is recommended to use the latestversion of pip.

Since ProdSim (including the required third party libraries) is installed in its own environment, it must be ensuredthat the correct interpreter is selected when executing a script.

The easiest way is to run the script from an IDE and specify the interpreter in the settings (MacOS:ProdSim_venv/bin/python, Win10:ProdSim_venv\Scripts\python). If the script should be executed from theterminal, it is sufficient with MacOS if the corresponding environment is active. With Win10, the path to the desiredinterpreter must be specified for each call:

> ProdSim_venv\Scripts\python path_to_script\script.py

Alternatively it is also possible to install ProdSim without the package manager pip withpython setup.py install.This is not recommended since external libraries may not be installed correctly automatically.

Requirements

The following packages are automatically installed in the current environment when ProdSim is installed via pip:

LibraryUsageVersion
simpysimulation kernel>= 4.0.1
numpyinternal tracking of simulation objects>= 1.21.2
dillplotting the simulation data>= 0.3.4
h5pyinternal caching of simulation data>= 3.4.0
dash, dash_cytoscapevisualization of the production process>= 2.0.0, >= 0.3.0

Documentation

The documentation is hosted via read the docs:

https://prodsim.readthedocs.io/en/latest/index.html

Alternatively, the documentation can be downloaded:

  • pdf:/ProdSim/docs/_build/latex/prodsim.pdf
  • html:/ProdSim/docs/_build/html/index.html

Examples

In/ProdSim/examples five ready executable examples are contained. The examples 01 to 04 correspond to the examplesfrom the documentation and offer the possibility to reproduce and execute what is described in the documentation. Theexampleexample_bulb contains the two input files from the example process described in the bachelor thesis. Thesefiles can be used to fill the light bulb production with process functions and to analyze them as needed.

Source Code

The complete source code can be found at/ProdSim/prodsim/ and contains the following files:

. /ProdSim/prodsim/|--__init__.py|--__pychache__/|--_estimate_process/|--_temp_data/|--app/|--components.py|--environment.py|--estimator.py|--exception.py|--filehandler.py|--helper.py|--inspector.py|--simulator.py|--tracker.py|--visualizer.py

The folders_estimate_process and_temp_data are also installed during the installation._estimate_process contains a set of input files which are used to perform the estimation measurements of theestimator. In_temp_data the h5 file with the simulation data is cached during the simulation run.

About

ProdSim is a process-based discrete event simulation for production environments based on the SimPy framework

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp