Update app.py
Browse files
app.py
CHANGED
|
@@ -10,13 +10,9 @@ def optimize_process(resource_allocation, machine_efficiency, production_goal, t
|
|
| 10 |
waste_output = (expected_output * waste_tolerance) / 100
|
| 11 |
|
| 12 |
# Determine realistic efficiency improvement recommendation
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
efficiency_improvement_needed = max(0, realistic_efficiency - machine_efficiency * 100)
|
| 17 |
-
else:
|
| 18 |
-
realistic_efficiency = machine_efficiency * 100
|
| 19 |
-
efficiency_improvement_needed = 0
|
| 20 |
|
| 21 |
return {
|
| 22 |
'Machines Needed': machines_needed,
|
|
@@ -24,7 +20,7 @@ def optimize_process(resource_allocation, machine_efficiency, production_goal, t
|
|
| 24 |
'Waste Output': waste_output,
|
| 25 |
'Efficiency Improvement Needed': efficiency_improvement_needed,
|
| 26 |
'Recommendation Efficiency': realistic_efficiency,
|
| 27 |
-
'Optimization Recommendation': f"Machines efficiency should be at least {realistic_efficiency:.1f}% for
|
| 28 |
}
|
| 29 |
|
| 30 |
# Streamlit App Layout
|
|
@@ -66,9 +62,14 @@ if st.button("๐ Optimize Process"):
|
|
| 66 |
|
| 67 |
# Generate Optimization Report
|
| 68 |
st.subheader("๐ Optimization Report")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
st.markdown(f"""
|
| 70 |
### Key Insights:
|
| 71 |
-
- **Production Efficiency**:
|
| 72 |
- **Waste Management**: The waste is currently within the acceptable tolerance, but reducing waste further will improve overall efficiency.
|
| 73 |
- **Resource Allocation**: The number of machines available is adequate, but you could potentially increase the machine count to optimize the process.
|
| 74 |
|
|
|
|
| 10 |
waste_output = (expected_output * waste_tolerance) / 100
|
| 11 |
|
| 12 |
# Determine realistic efficiency improvement recommendation
|
| 13 |
+
required_efficiency = production_goal / (resource_allocation * time_frame)
|
| 14 |
+
realistic_efficiency = max(75, min(95, required_efficiency * 100)) # Efficiency capped between 75% and 95%
|
| 15 |
+
efficiency_improvement_needed = max(0, realistic_efficiency - machine_efficiency * 100)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
return {
|
| 18 |
'Machines Needed': machines_needed,
|
|
|
|
| 20 |
'Waste Output': waste_output,
|
| 21 |
'Efficiency Improvement Needed': efficiency_improvement_needed,
|
| 22 |
'Recommendation Efficiency': realistic_efficiency,
|
| 23 |
+
'Optimization Recommendation': f"Machines efficiency should ideally be at least {realistic_efficiency:.1f}% for optimal results based on industry standards."
|
| 24 |
}
|
| 25 |
|
| 26 |
# Streamlit App Layout
|
|
|
|
| 62 |
|
| 63 |
# Generate Optimization Report
|
| 64 |
st.subheader("๐ Optimization Report")
|
| 65 |
+
efficiency_message = (
|
| 66 |
+
"The current machine efficiency is adequate to meet your production goals. No further improvement is required."
|
| 67 |
+
if optimized_output['Efficiency Improvement Needed'] == 0
|
| 68 |
+
else "The current machine efficiency may not be sufficient to meet your production goals. Improving machine efficiency could yield better results."
|
| 69 |
+
)
|
| 70 |
st.markdown(f"""
|
| 71 |
### Key Insights:
|
| 72 |
+
- **Production Efficiency**: {efficiency_message}
|
| 73 |
- **Waste Management**: The waste is currently within the acceptable tolerance, but reducing waste further will improve overall efficiency.
|
| 74 |
- **Resource Allocation**: The number of machines available is adequate, but you could potentially increase the machine count to optimize the process.
|
| 75 |
|