# POC1: Braunkohle Supply Chain Modellierung ## Überblick Dieser POC modelliert eine Braunkohle Supply Chain mit Pyomo zur Optimierung von Produktions-, Transport- und Distributionsprozessen. ## Projektstruktur ``` POC1/ ├── src/ # Quellcode │ └── preprocessing/ │ └── exploration_preprocess.py # Notebook-exportiertes Preprocessing ├── data/ # Daten │ ├── input/ # Eingabe-Parameter (Excel) │ └── processed/ # Vorverarbeitete Parquet-Dateien ├── models/ # Modell-Definitionen │ └── README.md ├── notebooks/ # Jupyter Notebooks für Analyse ├── latex/ # Latex-Export/Artefakte ├── requirements.txt # Python Dependencies ├── pyproject.toml # Projektmetadaten └── setup.py # Setup-Skript ``` ## Installation ```bash pip install -r requirements.txt ``` ## Verwendung ```bash # Preprocessing-Skript ausführen python src/preprocessing/exploration_preprocess.py ``` ## Modell-Hinweise - Bergbauwoche: Wochenstart Samstag (Sa–Fr) über Datum+2‑Tage‑Shift. - IIS-Debug: Bei Infeasibility schreibt Gurobi eine `results/iis.ilp` mit lesbaren Constraint-Namen. - 3-Tage-Regel: `no_three_in_a_row` ist aktuell auf <= 3 gelockert (Debug). ## Aktuelle Änderungen (Modell & Output) - Tages/ Wochen/ Monatsabweichungen basieren auf **Lieferungen (x)**, nicht auf Bunkerabfluss. - Mischungsverhältnisse (min/max + Ziel) werden **auf Lieferungen** angewendet (nicht auf Bunkerbestand). - Zusätzliche weiche **Mid‑Ziel‑Abweichung** für Mix (linear) ist aktiv. - B3‑Bunker‑Mix: weiche Zielmischung auf B3‑Bunkerbestand (stark gewichtet), um Welzow im Bunker zu vermeiden. - Strecken‑Penalties/Bonuses wurden wieder **entfernt** (nur Mix‑/Abweichungs‑Penalties aktiv). - Excel‑Output: - Sheet1 bleibt unverändert, `mit_Bunkerbestand` enthält Bunkerzufluss und Bunkerbestand. - Neue Sheet `Kohlemischverhältnis` mit Zielwerten + empirischem Mix (Lieferung) + Bunkermix. - Empirischer Mix wird rot/grün markiert, Gruppenfarben nur bis Spalte F. ## Webapp-Prototyp Backend (FastAPI): ```bash uv run python -m uvicorn webapp.backend.main:app --reload ``` Frontend (React/Vite): ```bash cd webapp/frontend npm install npm run dev ``` cd webapp/frontend npm run dev Optional: eigene Input/Output-Pfade beim Preprocessing via Umgebungsvariablen: `POC1_INPUT_XLSX`, `POC1_OUTPUT_DIR`. ## Abhängigkeiten - Pyomo (Optimierungsmodellierung) - Pandas (Datenverarbeitung) - NumPy (Numerische Berechnungen) - Matplotlib/Plotly (Visualisierung)