-
Notifications
You must be signed in to change notification settings - Fork 5
/
ChpInput.java
236 lines (214 loc) · 7.1 KB
/
ChpInput.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
/*
* © 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;
import edu.ie3.datamodel.io.extractor.HasThermalBus;
import edu.ie3.datamodel.io.extractor.HasThermalStorage;
import edu.ie3.datamodel.io.extractor.HasType;
import edu.ie3.datamodel.models.OperationTime;
import edu.ie3.datamodel.models.input.EmInput;
import edu.ie3.datamodel.models.input.NodeInput;
import edu.ie3.datamodel.models.input.OperatorInput;
import edu.ie3.datamodel.models.input.system.characteristic.ReactivePowerCharacteristic;
import edu.ie3.datamodel.models.input.system.type.ChpTypeInput;
import edu.ie3.datamodel.models.input.thermal.ThermalBusInput;
import edu.ie3.datamodel.models.input.thermal.ThermalStorageInput;
import java.util.Objects;
import java.util.UUID;
/** Describes a combined heat and power plant */
public class ChpInput extends SystemParticipantInput
implements HasType, HasThermalBus, HasThermalStorage {
/** The thermal bus, this model is connected to */
private final ThermalBusInput thermalBus;
/** Type of this CHP plant, containing default values for CHP plants of this kind */
private final ChpTypeInput type;
/** Thermal storage model */
private final ThermalStorageInput thermalStorage;
/** Is this asset market oriented? */
private final boolean marketReaction;
/**
* Constructor for an operated combined heat and power plant
*
* @param uuid of the input entity
* @param id of the asset
* @param operator of the asset
* @param operationTime Time for which the entity is operated
* @param node the asset is connected to
* @param thermalBus The thermal bus, this model is connected to (normally equal to the thermal
* bus of the provided thermal storage!)
* @param qCharacteristics Description of a reactive power characteristic
* @param em The {@link EmInput} controlling this system participant. Null, if not applicable.
* @param type of CHP
* @param thermalStorage Thermal storage model
* @param marketReaction Is this asset market oriented?
*/
public ChpInput(
UUID uuid,
String id,
OperatorInput operator,
OperationTime operationTime,
NodeInput node,
ThermalBusInput thermalBus,
ReactivePowerCharacteristic qCharacteristics,
EmInput em,
ChpTypeInput type,
ThermalStorageInput thermalStorage,
boolean marketReaction) {
super(uuid, id, operator, operationTime, node, qCharacteristics, em);
this.thermalBus = thermalBus;
this.type = type;
this.thermalStorage = thermalStorage;
this.marketReaction = marketReaction;
}
/**
* Constructor for an operated, always on combined heat and power plant
*
* @param uuid of the input entity
* @param id of the asset
* @param node the asset is connected to
* @param thermalBus The thermal bus, this model is connected to (normally equal to the thermal
* bus of the provided thermal storage!)
* @param qCharacteristics Description of a reactive power characteristic
* @param em The {@link EmInput} controlling this system participant. Null, if not applicable.
* @param type of CHP
* @param thermalStorage Thermal storage model
* @param marketReaction Is this asset market oriented?
*/
public ChpInput(
UUID uuid,
String id,
NodeInput node,
ThermalBusInput thermalBus,
ReactivePowerCharacteristic qCharacteristics,
EmInput em,
ChpTypeInput type,
ThermalStorageInput thermalStorage,
boolean marketReaction) {
super(uuid, id, node, qCharacteristics, em);
this.thermalBus = thermalBus;
this.type = type;
this.thermalStorage = thermalStorage;
this.marketReaction = marketReaction;
}
@Override
public ThermalBusInput getThermalBus() {
return thermalBus;
}
@Override
public ChpTypeInput getType() {
return type;
}
@Override
public ThermalStorageInput getThermalStorage() {
return thermalStorage;
}
public boolean isMarketReaction() {
return marketReaction;
}
public ChpInputCopyBuilder copy() {
return new ChpInputCopyBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ChpInput chpInput)) return false;
if (!super.equals(o)) return false;
return marketReaction == chpInput.marketReaction
&& thermalBus.equals(chpInput.thermalBus)
&& type.equals(chpInput.type);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), thermalBus, type, marketReaction);
}
@Override
public String toString() {
return "ChpInput{"
+ "uuid="
+ getUuid()
+ ", id="
+ getId()
+ ", operator="
+ getOperator().getUuid()
+ ", operationTime="
+ getOperationTime()
+ ", node="
+ getNode().getUuid()
+ ", qCharacteristics='"
+ getqCharacteristics()
+ "', em="
+ getEm()
+ ", thermalBus="
+ thermalBus.getUuid()
+ ", type="
+ type.getUuid()
+ ", thermalStorage="
+ thermalStorage.getUuid()
+ ", marketReaction="
+ marketReaction
+ '}';
}
/**
* A builder pattern based approach to create copies of {@link ChpInput} entities with altered
* field values. For detailed field descriptions refer to java docs of {@link ChpInput}
*
* @version 0.1
* @since 05.06.20
*/
public static class ChpInputCopyBuilder
extends SystemParticipantInputCopyBuilder<ChpInputCopyBuilder> {
private ChpTypeInput type;
private ThermalBusInput thermalBus;
private ThermalStorageInput thermalStorage;
private boolean marketReaction;
private ChpInputCopyBuilder(ChpInput entity) {
super(entity);
this.type = entity.getType();
this.thermalBus = entity.getThermalBus();
this.marketReaction = entity.isMarketReaction();
this.thermalStorage = entity.getThermalStorage();
}
@Override
public ChpInput build() {
return new ChpInput(
getUuid(),
getId(),
getOperator(),
getOperationTime(),
getNode(),
thermalBus,
getqCharacteristics(),
getEm(),
type,
thermalStorage,
marketReaction);
}
public ChpInputCopyBuilder type(ChpTypeInput type) {
this.type = type;
return this;
}
public ChpInputCopyBuilder thermalBus(ThermalBusInput thermalBus) {
this.thermalBus = thermalBus;
return this;
}
public ChpInputCopyBuilder thermalStorage(ThermalStorageInput thermalStorage) {
this.thermalStorage = thermalStorage;
return this;
}
public ChpInputCopyBuilder marketReaction(boolean marketReaction) {
this.marketReaction = marketReaction;
return this;
}
@Override
public ChpInputCopyBuilder scale(Double factor) {
this.type = this.type.copy().scale(factor).build();
return this;
}
@Override
protected ChpInputCopyBuilder thisInstance() {
return this;
}
}
}