-
Notifications
You must be signed in to change notification settings - Fork 5
/
StorageTypeInput.java
282 lines (248 loc) · 8.64 KB
/
StorageTypeInput.java
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
/*
* © 2021. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.models.input.system.type;
import edu.ie3.datamodel.models.StandardUnits;
import edu.ie3.util.quantities.interfaces.Currency;
import edu.ie3.util.quantities.interfaces.DimensionlessRate;
import edu.ie3.util.quantities.interfaces.EnergyPrice;
import java.util.Objects;
import java.util.UUID;
import javax.measure.quantity.Dimensionless;
import javax.measure.quantity.Energy;
import javax.measure.quantity.Power;
import javax.measure.quantity.Time;
import tech.units.indriya.ComparableQuantity;
/** Describes the type of a {@link edu.ie3.datamodel.models.input.system.StorageInput} */
public class StorageTypeInput extends SystemParticipantTypeInput {
/** Energy capacity (typically in kWh) */
private final ComparableQuantity<Energy> eStorage;
/** Maximum permissible active power (typically in kW) */
private final ComparableQuantity<Power> pMax;
/** Maximum permissible gradient of active power change (typically % / h) */
private final ComparableQuantity<DimensionlessRate> activePowerGradient;
/** Efficiency of the charging and discharging process (typically in %) */
private final ComparableQuantity<Dimensionless> eta;
/** Minimum permissible depth of discharge (typically in %) */
private final ComparableQuantity<Dimensionless> dod;
/** Maximum life time of the storage (typically in h) */
private final ComparableQuantity<Time> lifeTime;
/** Maximum amount of full charging cycles */
private final int lifeCycle;
/**
* @param uuid of the input entity
* @param id of this type of Storage
* @param capex capital expense for this type of Storage (typically in €)
* @param opex operating expense for this type of Storage (typically in €/MWh)
* @param eStorage stored energy capacity
* @param sRated Rated apparent power of integrated inverter
* @param cosPhiRated power factor for integrated inverter
* @param pMax maximum permissible active power of the integrated inverter
* @param activePowerGradient maximum permissible gradient of active power change
* @param eta efficiency of the charging and discharging process
* @param dod maximum permissible depth of discharge
* @param lifeTime maximum life time of the storage
* @param lifeCycle maximum amount of full charging/discharging cycles
*/
public StorageTypeInput(
UUID uuid,
String id,
ComparableQuantity<Currency> capex,
ComparableQuantity<EnergyPrice> opex,
ComparableQuantity<Energy> eStorage,
ComparableQuantity<Power> sRated,
double cosPhiRated,
ComparableQuantity<Power> pMax,
ComparableQuantity<DimensionlessRate> activePowerGradient,
ComparableQuantity<Dimensionless> eta,
ComparableQuantity<Dimensionless> dod,
ComparableQuantity<Time> lifeTime,
int lifeCycle) {
super(uuid, id, capex, opex, sRated.to(StandardUnits.S_RATED), cosPhiRated);
this.eStorage = eStorage.to(StandardUnits.ENERGY_IN);
this.pMax = pMax.to(StandardUnits.ACTIVE_POWER_IN);
this.activePowerGradient = activePowerGradient.to(StandardUnits.ACTIVE_POWER_GRADIENT);
this.eta = eta.to(StandardUnits.EFFICIENCY);
this.dod = dod.to(StandardUnits.DOD);
this.lifeTime = lifeTime.to(StandardUnits.LIFE_TIME);
this.lifeCycle = lifeCycle;
}
public ComparableQuantity<Dimensionless> getEta() {
return eta;
}
public ComparableQuantity<Dimensionless> getDod() {
return dod;
}
public ComparableQuantity<Time> getLifeTime() {
return lifeTime;
}
public int getLifeCycle() {
return lifeCycle;
}
public ComparableQuantity<Energy> geteStorage() {
return eStorage;
}
public ComparableQuantity<Power> getpMax() {
return pMax;
}
public ComparableQuantity<DimensionlessRate> getActivePowerGradient() {
return activePowerGradient;
}
@Override
public StorageTypeInputCopyBuilder copy() {
return new StorageTypeInputCopyBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof StorageTypeInput that)) return false;
if (!super.equals(o)) return false;
return lifeCycle == that.lifeCycle
&& eStorage.equals(that.eStorage)
&& pMax.equals(that.pMax)
&& activePowerGradient.equals(that.activePowerGradient)
&& eta.equals(that.eta)
&& dod.equals(that.dod)
&& lifeTime.equals(that.lifeTime);
}
@Override
public int hashCode() {
return Objects.hash(
super.hashCode(), eStorage, pMax, activePowerGradient, eta, dod, lifeTime, lifeCycle);
}
@Override
public String toString() {
return "StorageTypeInput{"
+ "uuid="
+ getUuid()
+ ", id="
+ getId()
+ "capex="
+ getCapex()
+ ", opex="
+ getOpex()
+ ", sRated="
+ getsRated()
+ ", cosphiRated="
+ getCosPhiRated()
+ "eStorage="
+ eStorage
+ ", pMax="
+ pMax
+ ", cpRate="
+ activePowerGradient
+ ", eta="
+ eta
+ ", dod="
+ dod
+ ", lifeTime="
+ lifeTime
+ ", lifeCycle="
+ lifeCycle
+ '}';
}
/**
* A builder pattern based approach to create copies of {@link StorageTypeInput} entities with
* altered field values. For detailed field descriptions refer to java docs of {@link
* StorageTypeInput}
*/
public static class StorageTypeInputCopyBuilder
extends SystemParticipantTypeInputCopyBuilder<StorageTypeInput.StorageTypeInputCopyBuilder> {
private ComparableQuantity<Energy> eStorage;
private ComparableQuantity<Power> pMax;
private ComparableQuantity<DimensionlessRate> activePowerGradient;
private ComparableQuantity<Dimensionless> eta;
private ComparableQuantity<Dimensionless> dod;
private ComparableQuantity<Time> lifeTime;
private int lifeCycle;
private StorageTypeInputCopyBuilder(StorageTypeInput entity) {
super(entity);
this.eStorage = entity.geteStorage();
this.pMax = entity.getpMax();
this.activePowerGradient = entity.getActivePowerGradient();
this.eta = entity.getEta();
this.dod = entity.getDod();
this.lifeTime = entity.getLifeTime();
this.lifeCycle = entity.getLifeCycle();
}
public StorageTypeInputCopyBuilder seteStorage(ComparableQuantity<Energy> eStorage) {
this.eStorage = eStorage;
return this;
}
public StorageTypeInputCopyBuilder setpMax(ComparableQuantity<Power> pMax) {
this.pMax = pMax;
return this;
}
public StorageTypeInputCopyBuilder setActivePowerGradient(
ComparableQuantity<DimensionlessRate> activePowerGradient) {
this.activePowerGradient = activePowerGradient;
return this;
}
public StorageTypeInputCopyBuilder setEta(ComparableQuantity<Dimensionless> eta) {
this.eta = eta;
return this;
}
public StorageTypeInputCopyBuilder setDod(ComparableQuantity<Dimensionless> dod) {
this.dod = dod;
return this;
}
public StorageTypeInputCopyBuilder setLifeTime(ComparableQuantity<Time> lifeTime) {
this.lifeTime = lifeTime;
return this;
}
public StorageTypeInputCopyBuilder setLifeCycle(int lifeCycle) {
this.lifeCycle = lifeCycle;
return this;
}
public ComparableQuantity<Energy> geteStorage() {
return eStorage;
}
public ComparableQuantity<Power> getpMax() {
return pMax;
}
public ComparableQuantity<DimensionlessRate> getActivePowerGradient() {
return activePowerGradient;
}
public ComparableQuantity<Dimensionless> getEta() {
return eta;
}
public ComparableQuantity<Dimensionless> getDod() {
return dod;
}
public ComparableQuantity<Time> getLifeTime() {
return lifeTime;
}
public int getLifeCycle() {
return lifeCycle;
}
public StorageTypeInput.StorageTypeInputCopyBuilder scale(Double factor) {
setsRated(getsRated().multiply(factor));
seteStorage(geteStorage().multiply(factor));
setpMax(getpMax().multiply(factor));
return this;
}
@Override
public StorageTypeInput build() {
return new StorageTypeInput(
getUuid(),
getId(),
getCapex(),
getOpex(),
eStorage,
getsRated(),
getCosPhiRated(),
pMax,
activePowerGradient,
eta,
dod,
lifeTime,
lifeCycle);
}
@Override
protected StorageTypeInput.StorageTypeInputCopyBuilder thisInstance() {
return this;
}
}
}