Skip to main content

prodsys logo

prodsys - modeling, simulating and optimizing production systems

Build-sucess PyPI Python Version Docu DOI

prodsys is a python package for modeling, simulating and optimizing production systems based on the product, process and resource (PPR) modelling principle. For more information, have a look at the documentation.

Installation

To install the package, run the following command in the terminal:

pip install prodsys

Please note that prodsys is currently only fully compatible with Python 3.11. Other versions might cause some errors.

Getting started

The package is designed to be easy to use. The following example shows how to model a simple production system and simulate it. The production system contains a single milling machine that performs milling processes on aluminium housings. The transport is thereby performed by a worker. At first, just import the express API of prodsys:

import prodsys.express as psx

We now create all components required for describing the production system. At first we define times for all arrival, production and transport processes:

milling_time = psx.FunctionTimeModel(distribution_function="normal", location=1, scale=0.1, ID="milling_time")
transport_time = psx.FunctionTimeModel(distribution_function="normal", location=0.3, scale=0.2, ID="transport_time")
arrival_time_of_housings = psx.FunctionTimeModel(distribution_function="exponential", location=1.5, ID="arrival_time_of_housings")

Next, we can define the production and transport process in the system by using the created time models:

milling_process = psx.ProductionProcess(milling_time, ID="milling_process")
transport_process = psx.TransportProcess(transport_time, ID="transport_process")

With the processes defined, we can now create the production and transport resources:

milling_machine = psx.Resource([milling_process], location=[5, 5], ID="milling_machine")
worker = psx.Resource([transport_process], location=[0, 0], ID="worker")

Now we define our product, the housing, that is produced in the system. For this example it requires only a single processsing step:

housing = psx.Product(process=[milling_process], transport_process=transport_process, ID="housing")

Only the sources and sinks that are responsible for creating the housing and storing finished housing are misssing:

source = psx.Source(housing, arrival_time_of_housings, location=[0, 0], ID="source")
sink = psx.Sink(housing, location=[20, 20], ID="sink")

Finally, we can create our production system, run the simulation for 60 minutes and print aggregated simulation results:

production_system = psx.ProductionSystem([milling_machine, worker], [source], [sink])
production_system.run(60)
production_system.runner.print_results()

As we can see, the system produced 39 parts in this hour with an work in progress (WIP ~ number of products in the system) of 4.125 and utilized the milling machine with 79.69% and the worker for 78.57% at the PR percentage, the rest of the time, both resource are in standby (SB). Note that these results stay the same although there are stochastic processes in the simulation. This is caused by seeding the random number generator with a fixed value. If you want to get different results, just specify another value for seed parameter from the run method.

production_system.run(60, seed=1)
production_system.runner.print_results()

As expected, the performance of the production system changed quite strongly with the new parameters. The system now produces 26 parts in this hour with an work in progress (WIP ~ number of products in the system) of 1.68. As the arrival process of the housing is modelled by an exponential distribution and we only consider 60 minutes of simulation, this is absolutely expected.

However, running longer simulations with multiple seeds is absolutely easy with prodsys. We average our results at the end to calculate the WIP to expect by utilizing the post_processor of the runner, which stores all events of a simulation and has many useful methods for analyzing the simulation results:

wip_values = []

for seed in range(5):
    production_system.run(2000, seed=seed)
    run_wip = production_system.post_processor.get_aggregated_wip_data()
    wip_values.append(run_wip)

print("WIP values for the simulation runs:", wip_values)

We can analyze these results easily with numpy seeing that the average WIP is 2.835, which is in between the two first runs, which gives us a more realistic expectation of the system's performance.

import numpy as np
wip = np.array(wip_values).mean(axis=0)
print(wip)

These examples only cover the most basic functionalities of prodsys. For more elaborate guides that guide you through more of the package's features, please see the tutorials. For a complete overview of the package's functionality, please see the API reference.

Contributing

prodsys is a new project and has therefore much room for improvement. Therefore, it would be a pleasure to get feedback or support! If you want to contribute to the package, either create issues on prodsys' github page for discussing new features or contact me directly via github or email.

License

The package is licensed under the MIT license.

Acknowledgements

We extend our sincere thanks to the German Federal Ministry for Economic Affairs and Climate Action (BMWK) for supporting this research project 13IK001ZF “Software-Defined Manufacturing for the automotive and supplying industry https://www.sdm4fzi.de/.

Metadata

Release files for prodsys 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prodsys 1.2.2
File Size Uploaded
prodsys-1.2.2.tar.gz 741.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prodsys 1.2.2
File Interpreter ABI Platform
prodsys-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / prodsys-1.2.2.tar.gz

Download URL prodsys-1.2.2.tar.gz
Size 741.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9f0da8ba2db8ce60cf24562cfa9a312847a4bfb324c3ed582c94dade170da4fa
BLAKE2b-256 checksum
How to use checksums
413fbce411af6a0b5fb7b599925dd9c38a4a320dc2b929142de9548b75a23b17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.19

Release files / prodsys-1.2.2-py3-none-any.whl

Download URL prodsys-1.2.2-py3-none-any.whl
Size 397.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1685980b8fcda2580ed333f41bff0c79e1a2a92db307919e9ee684d7f02ef916
BLAKE2b-256 checksum
How to use checksums
cb6ef993102f73dd8f76329cced92a86c12ad14172183142938074029c842e7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.19

Release history Release notifications | RSS feed

1.3.0

2 release files

1.2.3

2 release files

This release

1.2.2 This release

2 release files

1.2.0

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.9

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

1 release file

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page