AMO-Tools-Suite  v.0.9.0
Set of tools for calculating energy efficiency in industrial equipment
All Classes Namespaces Files Functions Variables Enumerations Friends Macros Pages
WaterReduction.h
1 #ifndef AMO_LIBRARY_WATERREDUCTION_H
2 #define AMO_LIBRARY_WATERREDUCTION_H
3 
4 #include <exception>
5 #include <stdexcept>
6 #include <vector>
7 
8 
10 public:
11  MeteredFlowMethodData(const double meterReading)
12  : meterReading(meterReading) {}
13  double getMeterReading() const { return meterReading; }
14 
15  void setMeterReading(double meterReading);
16 
17 private:
18  double meterReading;
19 };
20 
22 public:
23  VolumeMeterMethodData(const double finalMeterReading, const double initialMeterReading, const double elapsedTime)
24  : finalMeterReading(finalMeterReading), initialMeterReading(initialMeterReading),
25  elapsedTime(elapsedTime) {}
26  double getFinalMeterReading() const { return finalMeterReading; }
27 
28  double getInitialMeterReading() const { return initialMeterReading; }
29 
30  double getElapsedTime() const { return elapsedTime; }
31 
32  void setFinalMeterReading(double finalMeterReading);
33 
34  void setInitialMeterReading(double initialMeterReading);
35 
36  void setElapsedTime(double elapsedTime);
37 
38 private:
39  double finalMeterReading, initialMeterReading, elapsedTime;
40 };
41 
42 class BucketMethodData {
43 public:
44  BucketMethodData(const double bucketVolume, const double bucketFillTime)
45  : bucketVolume(bucketVolume), bucketFillTime(bucketFillTime) {}
46 
47  double getBucketVolume() const { return bucketVolume; }
48 
49  double getBucketFillTime() const { return bucketFillTime; }
50 
51  void setBucketVolume(double bucketVolume);
52 
53  void setBucketFillTime(double bucketFillTime);
54 
55 private:
56  double bucketVolume;
57  double bucketFillTime;
58 };
59 
60 
62 public:
63  WaterOtherMethodData(const double consumption)
64  : consumption(consumption) {}
65 
66  double getConsumption() const { return consumption; }
67 
68  void setConsumption(double consumption);
69 
70 private:
71  double consumption;
72 };
73 
74 
75 class WaterReductionInput {
76 public:
77  WaterReductionInput(const int operatingHours, const double waterCost, const int measurementMethod,
78  const MeteredFlowMethodData meteredFlowMethodData, const VolumeMeterMethodData volumeMeterMethodData,
79  const BucketMethodData bucketMethodData, const WaterOtherMethodData otherMethodData)
80  : operatingHours(operatingHours), waterCost(waterCost), measurementMethod(measurementMethod),
81  meteredFlowMethodData(meteredFlowMethodData), volumeMeterMethodData(volumeMeterMethodData),
82  bucketMethodData(bucketMethodData), otherMethodData(otherMethodData) {}
83 
84  int getOperatingHours() const { return operatingHours; }
85 
86  double getWaterCost() const { return waterCost; }
87 
88  int getMeasurementMethod() const { return measurementMethod; }
89 
90  MeteredFlowMethodData getMeteredFlowMethodData() const { return meteredFlowMethodData; }
91 
92  VolumeMeterMethodData getVolumeMeterMethodData() const { return volumeMeterMethodData; }
93 
94  BucketMethodData getBucketMethodData() const { return bucketMethodData; }
95 
96  WaterOtherMethodData getOtherMethodData() const { return otherMethodData; }
97 
98  void setMeteredFlowMethodData(MeteredFlowMethodData meteredFlowMethodData);
99 
100  void setVolumeMeterMethodData(VolumeMeterMethodData volumeMeterMethodData);
101 
102  void setucketMethodData(BucketMethodData bucketMethodData);
103 
104  void setOtherMethodData(WaterOtherMethodData otherMethodData);
105 
106 
107 private:
108  int operatingHours;
109  double waterCost;
110  int measurementMethod;
111  MeteredFlowMethodData meteredFlowMethodData;
112  VolumeMeterMethodData volumeMeterMethodData;
113  BucketMethodData bucketMethodData;
114  WaterOtherMethodData otherMethodData;
115 };
116 
117 
118 class WaterReduction {
119 
120 public:
121  struct Output {
122  Output(double waterUse, double waterCost, double annualWaterSavings, double costSavings)
123  : waterUse(waterUse), waterCost(waterCost), annualWaterSavings(annualWaterSavings),
124  costSavings(costSavings) {}
125 
126  Output() = default;
127 
128  double waterUse = 0, waterCost = 0, annualWaterSavings = 0, costSavings = 0;
129  };
130 
131  WaterReduction(std::vector<WaterReductionInput> &waterReductionInputVec) : waterReductionInputVec(waterReductionInputVec) {}
132 
133  WaterReduction::Output calculate();
134 
135  std::vector<WaterReductionInput> const &getWaterReductionInputVec() const {
136  return waterReductionInputVec;
137  }
138 
139  void setWaterReductionInputVec(std::vector<WaterReductionInput> &waterReductionInputVec);
140 
141 private:
142  std::vector<WaterReductionInput> waterReductionInputVec;
143  WaterReduction::Output output;
144 };
145 
146 #endif // AMO_LIBRARY_WATERREDUCTION_H