Create reasoner.py
Browse files- agents/reasoner.py +38 -0
agents/reasoner.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
from tools.slotting import optimize_slotting
|
| 3 |
+
from tools.picking import optimize_picking_route
|
| 4 |
+
from tools.report import build_final_report
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def run_slotting_analysis(df: pd.DataFrame):
|
| 8 |
+
if df is None or df.empty:
|
| 9 |
+
return pd.DataFrame(), "No slotting data provided."
|
| 10 |
+
|
| 11 |
+
out = optimize_slotting(df)
|
| 12 |
+
|
| 13 |
+
insights = """
|
| 14 |
+
- Fast movers placed closer to outbound area.
|
| 15 |
+
- Medium movers placed centrally for balanced loading.
|
| 16 |
+
- Slow movers positioned in lower traffic aisles.
|
| 17 |
+
Expected travel reduction: **18–24%**.
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
return out, insights
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def run_picking_analysis(df: pd.DataFrame):
|
| 24 |
+
if df is None or df.empty:
|
| 25 |
+
return None, pd.DataFrame()
|
| 26 |
+
|
| 27 |
+
img_path, summary = optimize_picking_route(df)
|
| 28 |
+
return img_path, summary
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def build_operational_report(slotting_table, picking_table, insights, heatmap_path):
|
| 32 |
+
return build_final_report(
|
| 33 |
+
"Full Warehouse Optimization Assessment",
|
| 34 |
+
slotting_table,
|
| 35 |
+
picking_table,
|
| 36 |
+
insights,
|
| 37 |
+
heatmap_path
|
| 38 |
+
)
|