Petri Net-Based Car Body Production Simulator
A discrete-event simulation tool for modeling and optimizing car body interior assembly processes. Developed as an engineering thesis project at Wrocław University of Science and Technology.
Modern automotive manufacturing demands flexible, data-driven production planning. PN-Car-Body-App addresses this challenge by combining Petri net theory with an intuitive graphical interface to simulate the assembly of modular car body interior components — such as panels, armrests, cup holders, and frameworks.
The application functions as a lightweight digital twin, enabling engineers to:
- Model production workflows using Place/Transition (PT) nets.
- Simulate discrete manufacturing events and resource constraints.
- Visualize planned schedules via interactive Gantt charts.
- Optimize sequencing for large batches of highly configurable products.
| Car Bodies Configuration | Petri Net Model | Gantt Chart Schedule |
|---|---|---|
![]() |
![]() |
![]() |
| Feature | Description |
|---|---|
| JSON-Based Input | Load batch definitions from bodies.json or create new configurations directly in the UI. |
| Petri Net Engine | Mathematically rigorous PT-net model captures concurrency, synchronization, and resource allocation. |
| Gantt Chart Visualization | Clear timeline view of the planned production sequence. |
| Digital Twin Concept | Run simulations to forecast production metrics and feed insights back into real-world scheduling. |
| Modular Architecture | Easily extendable component library (panels, armrests, cup holders, frameworks). |
- Python 3.10+
- Poetry (dependency management)
- Qt5 libraries (for PyQt5 GUI)
# Clone the repository
git clone https://github.com/Mastej-Git/PN-Car-Body-App.git
cd PN-Car-Body-App
# Set up virtual environment and install dependencies
make setup-env
# Launch the application
make runPN-Car-Body-App/
├── main.py # Application entry point
├── body_parts/ # Component models (Armrest, Panel, Framework, …)
├── petri_nets/ # Petri net engine (Place, Transition, PetriNet)
├── qt_classes/ # PyQt5 GUI components
├── other/ # Utilities (JSON reader, Gantt chart, workers)
├── enums/ # Enumerations (materials, stylesheets)
├── tests/ # Unit tests
├── docs/ # Documentation & figures
│ ├── engineering_thesis.pdf
│ └── figures/
└── bodies.json # Sample car body definitions
| Tool | Purpose |
|---|---|
| Python 3 | Core language |
| Poetry | Dependency & environment management |
| PyQt5 | Cross-platform GUI framework |
| Matplotlib | Gantt chart rendering |
| Ruff | Linting & formatting |
| Pylint | Static code analysis |
make test
# or
poetry run pytest tests/The full engineering thesis describing the theoretical background, system design, and experimental results is available at:
This project was developed for academic purposes. Please contact the author for licensing inquiries.


