-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecommender.py
More file actions
49 lines (41 loc) · 1.87 KB
/
Copy pathrecommender.py
File metadata and controls
49 lines (41 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
def generate_recommendation(current, optimal, target_performance):
if optimal is None:
return [
"No feasible operating condition was found within the selected temperature range.",
"Consider lowering the target performance or expanding the allowable operating range."
]
recommendations = []
current_T = current["temperature"]
optimal_T = optimal["temperature"]
if current["performance"] < target_performance:
recommendations.append(
"Current operating condition does not meet the target performance."
)
recommendations.append(
f"Increasing temperature to approximately {optimal_T:.0f}°C can meet the target with minimum estimated cost."
)
elif current_T > optimal_T + 5:
recommendations.append(
"Current temperature is higher than necessary for the target performance."
)
recommendations.append(
f"Lowering temperature to around {optimal_T:.0f}°C could reduce operating cost and carbon emissions while still meeting the target."
)
elif abs(current_T - optimal_T) <= 5:
recommendations.append(
"Current operating condition is close to the cost-optimal feasible point."
)
recommendations.append(
"Only minor adjustments are recommended unless electricity price or emissions factor changes."
)
else:
recommendations.append(
"Current operating condition is feasible but not fully cost-optimized."
)
recommendations.append(
f"The estimated cost-optimal temperature is approximately {optimal_T:.0f}°C."
)
recommendations.append(
f"The optimal feasible condition gives an estimated cost of ${optimal['cost']:.2f} and emissions of {optimal['emissions']:.2f} kg CO₂."
)
return recommendations