-
Notifications
You must be signed in to change notification settings - Fork 5
/
EvcsInput.java
288 lines (259 loc) · 8.37 KB
/
EvcsInput.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
283
284
285
286
287
288
/*
* © 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.models.OperationTime;
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.chargingpoint.ChargingPointType;
import edu.ie3.datamodel.models.input.system.type.evcslocation.EvcsLocationType;
import java.util.Objects;
import java.util.UUID;
public class EvcsInput extends SystemParticipantInput {
/** type of all installed charging points */
private final ChargingPointType type;
/** no of installed charging points */
private final int chargingPoints;
/** Rated power factor */
private final double cosPhiRated;
/** Evcs location type */
private final EvcsLocationType locationType;
/** Whether charging station supports vehicle to grid */
private final boolean v2gSupport;
/**
* @param uuid Unique identifier
* @param id Human readable identifier
* @param operator of the asset
* @param operationTime Time for which the entity is operated
* @param node that the asset is connected to
* @param qCharacteristics Description of a reactive power characteristic
* @param type type of the charging points available to this charging station
* @param chargingPoints number of charging points available at this charging station
* @param cosPhiRated rated cos phi
* @param locationType the location type
* @param v2gSupport whether charging station supports vehicle to grid
*/
public EvcsInput(
UUID uuid,
String id,
OperatorInput operator,
OperationTime operationTime,
NodeInput node,
ReactivePowerCharacteristic qCharacteristics,
ChargingPointType type,
int chargingPoints,
double cosPhiRated,
EvcsLocationType locationType,
boolean v2gSupport) {
super(uuid, id, operator, operationTime, node, qCharacteristics);
this.type = type;
this.chargingPoints = chargingPoints;
this.cosPhiRated = cosPhiRated;
this.locationType = locationType;
this.v2gSupport = v2gSupport;
}
/**
* @param uuid Unique identifier
* @param id Human readable identifier
* @param operator of the asset
* @param operationTime Time for which the entity is operated
* @param node that the asset is connected to
* @param qCharacteristics Description of a reactive power characteristic
* @param type type of the charging points available to this charging station
* @param cosPhiRated rated cos phi
* @param locationType the location type
* @param v2gSupport whether charging station supports vehicle to grid
*/
public EvcsInput(
UUID uuid,
String id,
OperatorInput operator,
OperationTime operationTime,
NodeInput node,
ReactivePowerCharacteristic qCharacteristics,
ChargingPointType type,
double cosPhiRated,
EvcsLocationType locationType,
boolean v2gSupport) {
this(
uuid,
id,
operator,
operationTime,
node,
qCharacteristics,
type,
1,
cosPhiRated,
locationType,
v2gSupport);
}
/**
* @param uuid Unique identifier
* @param id Human readable identifier
* @param node that the asset is connected to
* @param qCharacteristics Description of a reactive power characteristic
* @param type type of the charging points available to this charging station
* @param chargingPoints number of charging points available at this charging station
* @param cosPhiRated rated cos phi
* @param locationType the location type
* @param v2gSupport whether charging station supports vehicle to grid
*/
public EvcsInput(
UUID uuid,
String id,
NodeInput node,
ReactivePowerCharacteristic qCharacteristics,
ChargingPointType type,
int chargingPoints,
double cosPhiRated,
EvcsLocationType locationType,
boolean v2gSupport) {
super(uuid, id, node, qCharacteristics);
this.type = type;
this.chargingPoints = chargingPoints;
this.cosPhiRated = cosPhiRated;
this.locationType = locationType;
this.v2gSupport = v2gSupport;
}
/**
* @param uuid Unique identifier
* @param id Human readable identifier
* @param node that the asset is connected to
* @param qCharacteristics Description of a reactive power characteristic
* @param type type of the charging points available to this charging station
* @param cosPhiRated rated cos phi
* @param locationType the location type
* @param v2gSupport whether charging station supports vehicle to grid
*/
public EvcsInput(
UUID uuid,
String id,
NodeInput node,
ReactivePowerCharacteristic qCharacteristics,
ChargingPointType type,
double cosPhiRated,
EvcsLocationType locationType,
boolean v2gSupport) {
this(uuid, id, node, qCharacteristics, type, 1, cosPhiRated, locationType, v2gSupport);
}
public ChargingPointType getType() {
return type;
}
public int getChargingPoints() {
return chargingPoints;
}
public double getCosPhiRated() {
return cosPhiRated;
}
public EvcsLocationType getLocationType() {
return locationType;
}
public boolean getV2gSupport() {
return v2gSupport;
}
@Override
public EvcsInputCopyBuilder copy() {
return new EvcsInputCopyBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof EvcsInput evcsInput)) return false;
if (!super.equals(o)) return false;
return chargingPoints == evcsInput.chargingPoints
&& Double.compare(evcsInput.cosPhiRated, cosPhiRated) == 0
&& type.equals(evcsInput.type)
&& locationType.equals(evcsInput.locationType);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), type, chargingPoints, cosPhiRated, locationType);
}
@Override
public String toString() {
return "EvcsInput{"
+ "id='"
+ getId()
+ '\''
+ ", uuid="
+ getUuid()
+ ", type="
+ type
+ ", chargingPoints="
+ chargingPoints
+ ", cosPhiRated="
+ cosPhiRated
+ ", locationType="
+ locationType
+ ", node="
+ getNode()
+ "} "
+ super.toString();
}
/**
* A builder pattern based approach to create copies of {@link EvcsInput} entities with altered
* field values. For detailed field descriptions refer to java docs of {@link EvcsInput}
*
* @version 0.1
* @since 05.06.20
*/
public static class EvcsInputCopyBuilder
extends SystemParticipantInputCopyBuilder<EvcsInputCopyBuilder> {
private ChargingPointType type;
private int chargingPoints;
private double cosPhiRated;
private EvcsLocationType locationType;
private boolean v2gSupport;
public EvcsInputCopyBuilder(EvcsInput entity) {
super(entity);
this.type = entity.type;
this.chargingPoints = entity.chargingPoints;
this.cosPhiRated = entity.cosPhiRated;
this.locationType = entity.locationType;
this.v2gSupport = entity.v2gSupport;
}
public EvcsInputCopyBuilder type(ChargingPointType type) {
this.type = type;
return this;
}
public EvcsInputCopyBuilder chargingPoints(int noChargingPoints) {
this.chargingPoints = noChargingPoints;
return this;
}
public EvcsInputCopyBuilder cosPhiRated(double cosPhiRated) {
this.cosPhiRated = cosPhiRated;
return this;
}
public EvcsInputCopyBuilder locationType(EvcsLocationType locationType) {
this.locationType = locationType;
return this;
}
public EvcsInputCopyBuilder v2gSupport(boolean v2gSupport) {
this.v2gSupport = v2gSupport;
return this;
}
@Override
public EvcsInput build() {
return new EvcsInput(
getUuid(),
getId(),
getOperator(),
getOperationTime(),
getNode(),
getqCharacteristics(),
type,
chargingPoints,
cosPhiRated,
locationType,
v2gSupport);
}
@Override
protected EvcsInputCopyBuilder childInstance() {
return this;
}
}
}