-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecommender.cpp
More file actions
50 lines (42 loc) · 1.13 KB
/
Copy pathrecommender.cpp
File metadata and controls
50 lines (42 loc) · 1.13 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
50
#include "recommender.h"
#include <cmath>
std::vector<std::string> generateRecommendation(
const ProcessResult& current,
const ProcessResult* optimal,
double targetPerformance)
{
std::vector<std::string> recs;
if (optimal == nullptr)
{
recs.push_back(
"No feasible operating condition found.");
return recs;
}
double currentT = current.temperature;
double optimalT = optimal->temperature;
if (current.performance < targetPerformance)
{
recs.push_back(
"Current condition does not meet target.");
recs.push_back(
"Increase temperature to the optimal value.");
}
else if (currentT > optimalT + 5)
{
recs.push_back(
"Temperature is higher than necessary.");
recs.push_back(
"Lower temperature to reduce cost and emissions.");
}
else if (std::abs(currentT - optimalT) <= 5)
{
recs.push_back(
"Current condition is near optimum.");
}
else
{
recs.push_back(
"Condition is feasible but not cost-optimal.");
}
return recs;
}