Skip to content

radikonreturn/manufacture-balance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏭 Manufacture Balance 4.0

Sustainable Lean Manufacturing Β· Assembly Line Balancing Β· Operator 4.0
An academically grounded, sustainability-focused, end-to-end decision support system
that includes the operator perspective.

Features β€’ Quick Start β€’ Architecture β€’ CSV Format β€’ Algorithms β€’ Metrics β€’ References


Warning

Beta Software β€” This application is under active development and is not yet ready for production use. Features may change without notice.


✨ Features

Tab Feature Description
πŸ“₯ Data Input CSV / Upload / Manual Load tasks from sample data, upload your own CSV, or enter manually
πŸ“₯ Data Input DAG Visualization Interactive precedence graph with color-coded task durations
πŸ“Š Results RPW Solver Ranked Positional Weight line balancing (Helgeson & Birnie, 1961)
πŸ“Š Results Greedy Solver Largest Candidate Rule heuristic
πŸ“Š Results Side-by-Side Compare Run both algorithms and compare results instantly
πŸ“Š Results Kaizen Simulator Takt time slider with instant recalculation
πŸ“Š Results Excel Export Download comprehensive .xlsx report with all results
πŸ‘· Operator JES Digital Work Instructions Station-level step-by-step instructions (Operator 4.0)
🌿 Sustainability 9th Waste Analysis Energy waste (kWh), cost ($), COβ‚‚ footprint (kg) from idle time
βš–οΈ Compare Scenario Management Save, load, and compare scenarios side-by-side with SQLite

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • pip

Local Installation

# Clone the repository
git clone https://github.com/radikonreturn/manufacture-balance.git
cd manufacture-balance

# Install dependencies
pip install -r requirements.txt

# Run the dashboard
python -m streamlit run app.py

Open your browser at http://localhost:8501

Docker

docker-compose up --build

πŸ—οΈ Architecture

manufacture-balance/
β”‚
β”œβ”€β”€ app.py                    # Main entry point (90 lines)
β”‚
β”œβ”€β”€ ui/                       # 🎨 UI Layer
β”‚   β”œβ”€β”€ styles.py             #    Theme, colors, CSS
β”‚   β”œβ”€β”€ components.py         #    Reusable widgets (metric cards, DAG, Excel export)
β”‚   └── tabs/                 #    One module per tab
β”‚       β”œβ”€β”€ input_tab.py      #      πŸ“₯ Data Input
β”‚       β”œβ”€β”€ results_tab.py    #      πŸ“Š Results & Visualization
β”‚       β”œβ”€β”€ operator_tab.py   #      πŸ‘· Digital Operator (JES)
β”‚       β”œβ”€β”€ sustainability_tab.py  #  🌿 Sustainability Report
β”‚       └── compare_tab.py    #      βš–οΈ Scenario Comparison
β”‚
β”œβ”€β”€ engine/                   # βš™οΈ ALB Engine
β”‚   β”œβ”€β”€ graph.py              #    Precedence DAG (Directed Acyclic Graph)
β”‚   β”œβ”€β”€ rpw_solver.py         #    Ranked Positional Weight algorithm
β”‚   β”œβ”€β”€ greedy_solver.py      #    Largest Candidate Rule algorithm
β”‚   β”œβ”€β”€ metrics.py            #    Line balancing performance metrics
β”‚   β”œβ”€β”€ energy_waste.py       #    9th Waste energy calculator
β”‚   └── jes_generator.py      #    Electronic Job Element Sheet generator
β”‚
β”œβ”€β”€ data/                     # πŸ’Ύ Data Layer
β”‚   β”œβ”€β”€ parser.py             #    CSV parsing & validation
β”‚   └── database.py           #    SQLite scenario persistence
β”‚
β”œβ”€β”€ tests/                    # πŸ§ͺ Test Suite
β”‚   └── test_engine.py        #    22 unit + integration tests
β”‚
β”œβ”€β”€ sample_tasks.csv          # 10-task sample dataset
β”œβ”€β”€ sample_20_tasks.csv       # 20-task sample dataset
β”œβ”€β”€ sample_30_tasks.csv       # 30-task sample dataset
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ Dockerfile                # Container build
└── docker-compose.yml        # Container orchestration

πŸ“„ CSV Format

task_id,task_name,duration,predecessors
T1,Body Cutting,6,
T2,Hole Drilling,4,T1
T3,Bending,3,T1
T4,Welding A,5,T2
T5,Welding B,4,T2 T3
Column Type Description
task_id string Unique task identifier (e.g. T1, OP_05)
task_name string Human-readable task name
duration float Task duration in seconds (must be > 0)
predecessors string Space-separated predecessor IDs (empty = no dependencies)

βš™οΈ Algorithms

RPW β€” Ranked Positional Weight

Based on Helgeson & Birnie (1961), the classic line balancing heuristic:

  1. Compute each task's RPW = own duration + longest successor path
  2. Sort tasks by descending RPW
  3. Assign to stations respecting cycle time and precedence constraints

Greedy β€” Largest Candidate Rule

A simpler heuristic that prioritizes larger tasks:

  1. Sort tasks by descending duration
  2. For each station, assign the largest eligible task (precedence + capacity OK)
  3. Open a new station when no more tasks fit

πŸ“Š Metrics

Metric Formula Perfect Score
Line Efficiency Ξ£(station loads) / (n Γ— CT) Γ— 100 100%
Balance Delay 100 βˆ’ Line Efficiency 0%
Smoothness Index √Σ(ST_max βˆ’ ST_i)Β² 0.0
Theoretical Min Stations ⌈Total Work / CTβŒ‰ β€”
Bottleneck Score (station load / CT) Γ— 100 < 90%
Energy Waste idle_time Γ— kW/3600 0 kWh
Carbon Footprint energy_waste Γ— COβ‚‚ factor 0 kg

πŸ§ͺ Testing

# Run all 22 tests
python -m pytest tests/ -v

# Lint check (requires ruff)
python -m ruff check . --exclude=".venv,__pycache__"

πŸ“š Academic References

  1. Helgeson, W.B. & Birnie, D.P. (1961). Assembly line balancing using the ranked positional weight technique. β€” RPW algorithm foundation

  2. Ciliberto, C. et al. (2021). Exploring lean and green supply chain integration. β€” "9th Waste" energy waste concept in sustainable manufacturing

  3. Ciano, M.P. et al. (2021). One-to-one relationships between Industry 4.0 technologies and Lean production principles. β€” Operator 4.0 and digital JES integration

πŸ“„ License

MIT License β€” see LICENSE for details.


Built with ❀️ for sustainable manufacturing

About

🏭 Sustainable Lean Manufacturing 4.0 Dashboard β€” Assembly Line Balancing (RPW + Greedy), Energy Waste Analysis, Digital Operator JES, and Scenario Comparison. Built with Streamlit & Plotly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors