-
Notifications
You must be signed in to change notification settings - Fork 5
/
BmTypeInput.java
158 lines (138 loc) · 4.89 KB
/
BmTypeInput.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
/*
* © 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.Power;
import tech.units.indriya.ComparableQuantity;
/** Describes the type of a {@link edu.ie3.datamodel.models.input.system.BmInput} */
public class BmTypeInput extends SystemParticipantTypeInput {
/** Permissible load gradient (typically in %/h) */
private final ComparableQuantity<DimensionlessRate> activePowerGradient;
/** Efficiency of converter for this type of BM (typically in %) */
private final ComparableQuantity<Dimensionless> etaConv;
/**
* @param uuid of the input entity
* @param id of this type of BM
* @param capex Capital expense for this type of BM (typically in €)
* @param opex Operating expense for this type of BM (typically in €)
* @param cosphiRated Power factor for this type of BM
* @param activePowerGradient Maximum permissible gradient of active power change
* @param sRated Rated apparent power for this type of BM (typically in kVA)
* @param etaConv Efficiency of converter for this type of BM (typically in %)
*/
public BmTypeInput(
UUID uuid,
String id,
ComparableQuantity<Currency> capex,
ComparableQuantity<EnergyPrice> opex,
ComparableQuantity<DimensionlessRate> activePowerGradient,
ComparableQuantity<Power> sRated,
double cosphiRated,
ComparableQuantity<Dimensionless> etaConv) {
super(uuid, id, capex, opex, sRated.to(StandardUnits.S_RATED), cosphiRated);
this.activePowerGradient = activePowerGradient.to(StandardUnits.ACTIVE_POWER_GRADIENT);
this.etaConv = etaConv.to(StandardUnits.EFFICIENCY);
}
public ComparableQuantity<DimensionlessRate> getActivePowerGradient() {
return activePowerGradient;
}
public ComparableQuantity<Dimensionless> getEtaConv() {
return etaConv;
}
@Override
public BmTypeInputCopyBuilder copy() {
return new BmTypeInputCopyBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof BmTypeInput that)) return false;
if (!super.equals(o)) return false;
return activePowerGradient.equals(that.activePowerGradient) && etaConv.equals(that.etaConv);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), activePowerGradient, etaConv);
}
@Override
public String toString() {
return "BmTypeInput{"
+ "uuid="
+ getUuid()
+ ", id="
+ getId()
+ ", capex="
+ getCapex()
+ ", opex="
+ getOpex()
+ ", sRated="
+ getsRated()
+ ", cosphiRated="
+ getCosPhiRated()
+ "loadGradient="
+ activePowerGradient
+ ", etaConv="
+ etaConv
+ '}';
}
/**
* A builder pattern based approach to create copies of {@link BmTypeInput} entities with altered
* field values. For detailed field descriptions refer to java docs of {@link BmTypeInput}
*/
public static class BmTypeInputCopyBuilder
extends SystemParticipantTypeInputCopyBuilder<BmTypeInputCopyBuilder> {
private ComparableQuantity<DimensionlessRate> activePowerGradient;
private ComparableQuantity<Dimensionless> etaConv;
private BmTypeInputCopyBuilder(BmTypeInput entity) {
super(entity);
this.activePowerGradient = entity.getActivePowerGradient();
this.etaConv = entity.getEtaConv();
}
public BmTypeInputCopyBuilder setActivePowerGradient(
ComparableQuantity<DimensionlessRate> activePowerGradient) {
this.activePowerGradient = activePowerGradient;
return this;
}
public BmTypeInputCopyBuilder setEtaConv(ComparableQuantity<Dimensionless> etaConv) {
this.etaConv = etaConv;
return this;
}
public ComparableQuantity<DimensionlessRate> getActivePowerGradient() {
return activePowerGradient;
}
public ComparableQuantity<Dimensionless> getEtaConv() {
return etaConv;
}
@Override
public BmTypeInputCopyBuilder scale(Double factor) {
setCapex(getCapex().multiply(factor));
setsRated(getsRated().multiply(factor));
return this;
}
@Override
public BmTypeInput build() {
return new BmTypeInput(
getUuid(),
getId(),
getCapex(),
getOpex(),
activePowerGradient,
getsRated(),
getCosPhiRated(),
etaConv);
}
@Override
protected BmTypeInputCopyBuilder thisInstance() {
return this;
}
}
}