Update src/pages/_optimize_page.py
Browse filesUpdate optimise page with QRG expander tab
- src/pages/_optimize_page.py +46 -0
src/pages/_optimize_page.py
CHANGED
@@ -26,6 +26,52 @@ def optimize_page():
|
|
26 |
Render the optimization page with controls for route optimization
|
27 |
"""
|
28 |
st.title("Delivery Route Optimization")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
# Initialize session state variables
|
31 |
if 'optimization_result' not in st.session_state:
|
|
|
26 |
Render the optimization page with controls for route optimization
|
27 |
"""
|
28 |
st.title("Delivery Route Optimization")
|
29 |
+
|
30 |
+
# Add help section with expander
|
31 |
+
with st.expander("📚 How to Use This Page"):
|
32 |
+
st.markdown("""
|
33 |
+
## Step-by-Step Guide to Route Optimization
|
34 |
+
|
35 |
+
This application helps you optimize delivery routes by assigning deliveries to vehicles in the most efficient way possible. Follow these steps to get started:
|
36 |
+
|
37 |
+
### 1. Set Optimization Parameters (Sidebar)
|
38 |
+
|
39 |
+
- **Select Delivery Dates**: Choose which dates to include in optimization. Select "All" to include all dates.
|
40 |
+
- **Priority Importance**: Higher values give more weight to high-priority deliveries.
|
41 |
+
- **Time Window Importance**: Higher values enforce stricter adherence to delivery time windows.
|
42 |
+
- **Load Balancing vs Distance**: Higher values distribute deliveries more evenly across vehicles.
|
43 |
+
- **Maximum Vehicles**: Set the maximum number of vehicles to use for deliveries.
|
44 |
+
- **Minimum Time Window Compliance**: Set the minimum percentage of deliveries that must be within their time windows.
|
45 |
+
|
46 |
+
### 2. Generate Routes
|
47 |
+
|
48 |
+
- Review the delivery statistics and vehicle availability information
|
49 |
+
- Click the **Generate Optimal Routes** button to run the optimization algorithm
|
50 |
+
- The algorithm will assign deliveries to vehicles based on your parameters
|
51 |
+
|
52 |
+
### 3. Review Optimization Results
|
53 |
+
|
54 |
+
- **Overall Performance**: Check metrics like assigned deliveries, vehicles used, and time window compliance
|
55 |
+
- **Time & Distance Distribution**: See how delivery workload is distributed across vehicles
|
56 |
+
- **Route Map**: Interactive map showing the optimized routes for each vehicle
|
57 |
+
- Use the date filter to show routes for specific days
|
58 |
+
- Hover over markers and routes for detailed information
|
59 |
+
- **Calendar View**: View delivery schedules organized by date
|
60 |
+
- Green bars indicate on-time deliveries
|
61 |
+
- Orange bars indicate late deliveries
|
62 |
+
- Red bars indicate unassigned deliveries
|
63 |
+
|
64 |
+
### 4. Adjust and Refine
|
65 |
+
|
66 |
+
If the results don't meet your requirements:
|
67 |
+
|
68 |
+
- **Not enough vehicles?** Increase the maximum vehicles allowed
|
69 |
+
- **Time windows not met?** Decrease the time window importance or minimum compliance
|
70 |
+
- **High priority deliveries not assigned?** Increase priority importance
|
71 |
+
- **Routes too unbalanced?** Increase load balancing parameter
|
72 |
+
|
73 |
+
Remember to click **Generate Optimal Routes** after changing any parameters to see the updated results.
|
74 |
+
""")
|
75 |
|
76 |
# Initialize session state variables
|
77 |
if 'optimization_result' not in st.session_state:
|