-
Notifications
You must be signed in to change notification settings - Fork 5
/
SystemParticipantTypeInput.java
166 lines (141 loc) · 4.77 KB
/
SystemParticipantTypeInput.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
/*
* © 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.input.AssetTypeInput;
import edu.ie3.util.quantities.interfaces.Currency;
import edu.ie3.util.quantities.interfaces.EnergyPrice;
import java.util.Objects;
import java.util.UUID;
import javax.measure.quantity.Power;
import tech.units.indriya.ComparableQuantity;
/** Describes the type of a {@link edu.ie3.datamodel.models.input.system.SystemParticipantInput} */
public abstract class SystemParticipantTypeInput extends AssetTypeInput {
/** Capital expense for this type of system participant (typically in €) */
private final ComparableQuantity<Currency> capex;
/** Operating expense for this type of system participant (typically in €/MWh) */
private final ComparableQuantity<EnergyPrice> opex;
/** Rated apparent power of the type (in kVA) */
private final ComparableQuantity<Power> sRated;
/** Power factor for this type of system participant */
private final double cosPhiRated;
/**
* @param uuid of the input entity
* @param id of this type of system participant
* @param capex Captial expense for this type of system participant (typically in €)
* @param opex Operating expense for this type of system participant (typically in €/MWh)
* @param sRated Rated apparent power
* @param cosPhiRated Power factor for this type of system participant
*/
protected SystemParticipantTypeInput(
UUID uuid,
String id,
ComparableQuantity<Currency> capex,
ComparableQuantity<EnergyPrice> opex,
ComparableQuantity<Power> sRated,
double cosPhiRated) {
super(uuid, id);
this.capex = capex;
this.opex = opex;
this.sRated = sRated;
this.cosPhiRated = cosPhiRated;
}
public ComparableQuantity<Currency> getCapex() {
return capex;
}
public ComparableQuantity<EnergyPrice> getOpex() {
return opex;
}
public ComparableQuantity<Power> getsRated() {
return sRated;
}
public double getCosPhiRated() {
return cosPhiRated;
}
public abstract SystemParticipantTypeInputCopyBuilder<?> copy();
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof SystemParticipantTypeInput that)) return false;
if (!super.equals(o)) return false;
return Double.compare(that.cosPhiRated, cosPhiRated) == 0
&& capex.equals(that.capex)
&& opex.equals(that.opex)
&& sRated.equals(that.sRated);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), capex, opex, sRated, cosPhiRated);
}
@Override
public String toString() {
return "SystemParticipantTypeInput{"
+ "uuid="
+ getUuid()
+ ", id="
+ getId()
+ "capex="
+ capex
+ ", opex="
+ opex
+ ", sRated="
+ sRated
+ ", cosphiRated="
+ cosPhiRated
+ '}';
}
/**
* Abstract class for all builder that build child entities of abstract class {@link
* SystemParticipantTypeInput}
*/
public abstract static class SystemParticipantTypeInputCopyBuilder<
B extends SystemParticipantTypeInput.SystemParticipantTypeInputCopyBuilder<B>>
extends AssetTypeInput.AssetTypeInputCopyBuilder<B> {
private ComparableQuantity<Currency> capex;
private ComparableQuantity<EnergyPrice> opex;
private ComparableQuantity<Power> sRated;
private double cosPhiRated;
protected SystemParticipantTypeInputCopyBuilder(SystemParticipantTypeInput entity) {
super(entity);
this.capex = entity.getCapex();
this.opex = entity.getOpex();
this.sRated = entity.getsRated();
this.cosPhiRated = entity.getCosPhiRated();
}
public B setCapex(ComparableQuantity<Currency> capex) {
this.capex = capex;
return thisInstance();
}
public B setOpex(ComparableQuantity<EnergyPrice> opex) {
this.opex = opex;
return thisInstance();
}
public B setsRated(ComparableQuantity<Power> sRated) {
this.sRated = sRated;
return thisInstance();
}
public B setCosPhiRated(double cosPhiRated) {
this.cosPhiRated = cosPhiRated;
return thisInstance();
}
public ComparableQuantity<Currency> getCapex() {
return capex;
}
public ComparableQuantity<EnergyPrice> getOpex() {
return opex;
}
public ComparableQuantity<Power> getsRated() {
return sRated;
}
public double getCosPhiRated() {
return cosPhiRated;
}
public abstract B scale(Double factor);
@Override
public abstract SystemParticipantTypeInput build();
@Override
protected abstract B thisInstance();
}
}