-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
91 lines (70 loc) · 1.93 KB
/
Copy pathmain.cpp
File metadata and controls
91 lines (70 loc) · 1.93 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include <iostream>
#include <iomanip>
#include "model.h"
#include "optimizer.h"
#include "recommender.h"
int main()
{
double temperature;
double massFlowRate;
double electricityPrice;
double emissionFactor;
double targetPerformance;
std::cout << "Temperature (C): ";
std::cin >> temperature;
std::cout << "Mass Flow Rate (kg/h): ";
std::cin >> massFlowRate;
std::cout << "Electricity Price ($/kWh): ";
std::cin >> electricityPrice;
std::cout << "Emission Factor (kg CO2/kWh): ";
std::cin >> emissionFactor;
std::cout << "Target Performance (%): ";
std::cin >> targetPerformance;
ProcessResult current =
evaluateCondition(
temperature,
massFlowRate,
electricityPrice,
emissionFactor);
auto sweep =
generateTemperatureSweep(
massFlowRate,
electricityPrice,
emissionFactor,
targetPerformance);
ProcessResult optimal;
bool found =
findCostOptimalCondition(
sweep,
optimal);
std::cout << "\n===== Current Condition =====\n";
std::cout << "Performance: "
<< current.performance
<< "%\n";
std::cout << "Energy: "
<< current.energy
<< " kWh\n";
std::cout << "Cost: $"
<< current.cost
<< "\n";
std::cout << "Emissions: "
<< current.emissions
<< " kg CO2\n";
if (found)
{
std::cout << "\nOptimal Temperature: "
<< optimal.temperature
<< " C\n";
}
auto recommendations =
generateRecommendation(
current,
found ? &optimal : nullptr,
targetPerformance);
std::cout << "\n===== Recommendations =====\n";
for (const auto& r : recommendations)
{
std::cout << "- " << r << "\n";
}
return 0;
}