-
Notifications
You must be signed in to change notification settings - Fork 5
/
ConnectorValidationUtils.java
575 lines (537 loc) · 24.2 KB
/
ConnectorValidationUtils.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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
/*
* © 2021. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.utils.validation;
import edu.ie3.datamodel.exceptions.InvalidEntityException;
import edu.ie3.datamodel.models.input.NodeInput;
import edu.ie3.datamodel.models.input.connector.*;
import edu.ie3.datamodel.models.input.connector.type.LineTypeInput;
import edu.ie3.datamodel.models.input.connector.type.Transformer2WTypeInput;
import edu.ie3.datamodel.models.input.connector.type.Transformer3WTypeInput;
import edu.ie3.util.geo.GeoUtils;
import edu.ie3.util.quantities.QuantityUtil;
import javax.measure.Quantity;
import tech.units.indriya.quantity.Quantities;
import tech.units.indriya.unit.Units;
public class ConnectorValidationUtils extends ValidationUtils {
// allowed deviation of coordinates in degree for line position check
private static final double ALLOWED_COORDINATE_ERROR = 0.000001d;
// allowed deviation of length in meters for line length
private static final double ALLOWED_LENGTH_ERROR = 1d;
// allowed deviation of voltage in kV for transformer checks
private static final double ALLOWED_VOLTAGE_ERROR = 1d;
/** Private Constructor as this class is not meant to be instantiated */
private ConnectorValidationUtils() {
throw new IllegalStateException("Don't try and instantiate a Utility class.");
}
/**
* Validates a connector if: <br>
* - it is not null <br>
* A "distribution" method, that forwards the check request to specific implementations to fulfill
* the checking task, based on the class of the given object.
*
* @param connector Connector to validate
* @throws edu.ie3.datamodel.exceptions.NotImplementedException if an unknown class is handed in
*/
protected static void check(ConnectorInput connector) {
checkNonNull(connector, "a connector");
connectsDifferentNodes(connector);
// Further checks for subclasses
if (LineInput.class.isAssignableFrom(connector.getClass())) checkLine((LineInput) connector);
else if (Transformer2WInput.class.isAssignableFrom(connector.getClass()))
checkTransformer2W((Transformer2WInput) connector);
else if (Transformer3WInput.class.isAssignableFrom(connector.getClass()))
checkTransformer3W((Transformer3WInput) connector);
else if (SwitchInput.class.isAssignableFrom(connector.getClass()))
checkSwitch((SwitchInput) connector);
else throw checkNotImplementedException(connector);
}
/**
* Validates a line if: <br>
* - {@link ConnectorValidationUtils#checkLineType(LineTypeInput)} confirms valid type properties
* <br>
* - it does not connect the same node <br>
* - it connects nodes in the same subnet <br>
* - it connects nodes in the same voltage level <br>
* - its line length has a positive value <br>
* - its length equals the sum of calculated distances between points of LineString <br>
* - its coordinates of start and end point equal coordinates of nodes
*
* @param line Line to validate
*/
private static void checkLine(LineInput line) {
checkLineType(line.getType());
connectsNodesInDifferentSubnets(line, false);
connectsNodesWithDifferentVoltageLevels(line, false);
detectZeroOrNegativeQuantities(new Quantity<?>[] {line.getLength()}, line);
coordinatesOfLineEqualCoordinatesOfNodes(line);
lineLengthMatchesDistancesBetweenPointsOfLineString(line);
}
/**
* Validates a line type if: <br>
* - it is not null <br>
* - B is greater/equal to 0 (Phase-to-ground susceptance per length) <br>
* - G is greater/equal to 0 (Phase-to-ground conductance per length) <br>
* - R is greater 0 (Phase resistance per length) <br>
* - X is greater 0 (Phase reactance per length) <br>
* - iMax is greater 0 (Maximum permissible current) <br>
* - vRated is greater 0 (Rated voltage)
*
* @param lineType Line type to validate
*/
protected static void checkLineType(LineTypeInput lineType) {
checkNonNull(lineType, "a line type");
detectNegativeQuantities(new Quantity<?>[] {lineType.getB(), lineType.getG()}, lineType);
detectZeroOrNegativeQuantities(
new Quantity<?>[] {
lineType.getvRated(), lineType.getiMax(), lineType.getX(), lineType.getR()
},
lineType);
}
/**
* Validates a transformer2W if: <br>
* - {@link ConnectorValidationUtils#checkTransformer2WType(Transformer2WTypeInput)} confirms a
* valid type properties <br>
* - its tap position is within bounds <br>
* - it connects different subnets <br>
* - it connects different voltage levels <br>
* - its rated voltages match the voltages at the nodes
*
* @param transformer2W Transformer2W to validate
*/
private static void checkTransformer2W(Transformer2WInput transformer2W) {
checkTransformer2WType(transformer2W.getType());
checkIfTapPositionIsWithinBounds(transformer2W);
connectsNodesWithDifferentVoltageLevels(transformer2W, true);
connectsNodesToCorrectVoltageSides(transformer2W);
connectsNodesInDifferentSubnets(transformer2W, true);
ratedVoltageOfTransformer2WMatchesVoltagesOfNodes(transformer2W);
}
/**
* Validates a transformer2W type if: <br>
* - it is not null <br>
* - rSc is greater 0 (short circuit resistance) <br>
* - xSc is greater 0 (short circuit impedance) <br>
* - gM is greater/equal to 0 (no load conductance) <br>
* - bM is less/equal to 0 (no load susceptance)<br>
* - sRated is greater 0 (rated apparent power) <br>
* - vRatedA is greater 0 (rated voltage at higher voltage terminal) <br>
* - vRatedB is greater 0 (rated voltage at lower voltage terminal) <br>
* - dV is between 0% and 100% (voltage magnitude increase per tap position <br>
* - dPhi is greater/equal to 0 (voltage angle increase per tap position) <br>
* - neutral tap position is between min and max tap position <br>
* - minimum tap position is smaller than maximum tap position
*
* @param transformer2WType Transformer2W type to validate
*/
protected static void checkTransformer2WType(Transformer2WTypeInput transformer2WType) {
checkNonNull(transformer2WType, "a two winding transformer type");
detectNegativeQuantities(
new Quantity<?>[] {
transformer2WType.getgM(), transformer2WType.getdPhi(), transformer2WType.getrSc()
},
transformer2WType);
detectZeroOrNegativeQuantities(
new Quantity<?>[] {
transformer2WType.getsRated(),
transformer2WType.getvRatedA(),
transformer2WType.getvRatedB(),
transformer2WType.getxSc()
},
transformer2WType);
detectPositiveQuantities(new Quantity<?>[] {transformer2WType.getbM()}, transformer2WType);
checkVoltageMagnitudeChangePerTapPosition(transformer2WType);
checkMinimumTapPositionIsLowerThanMaximumTapPosition(transformer2WType);
checkNeutralTapPositionLiesBetweenMinAndMaxTapPosition(transformer2WType);
}
/**
* Validates a transformer3W if: <br>
* - {@link ConnectorValidationUtils#checkTransformer3WType(Transformer3WTypeInput)} confirm a
* valid type <br>
* - its tap position is within bounds <br>
* - it connects different subnets <br>
* - it connects different voltage levels <br>
* - its rated voltages match the voltages at the nodes
*
* @param transformer3W Transformer3W to validate
*/
private static void checkTransformer3W(Transformer3WInput transformer3W) {
checkTransformer3WType(transformer3W.getType());
checkIfTapPositionIsWithinBounds(transformer3W);
// Check if transformer connects different voltage levels
if (transformer3W.getNodeA().getVoltLvl() == transformer3W.getNodeB().getVoltLvl()
|| transformer3W.getNodeA().getVoltLvl() == transformer3W.getNodeC().getVoltLvl()
|| transformer3W.getNodeB().getVoltLvl() == transformer3W.getNodeC().getVoltLvl())
throw new InvalidEntityException(
"Transformer connects nodes of the same voltage level", transformer3W);
// Check if transformer connects different subnets
if (transformer3W.getNodeA().getSubnet() == transformer3W.getNodeB().getSubnet()
|| transformer3W.getNodeA().getSubnet() == transformer3W.getNodeC().getSubnet()
|| transformer3W.getNodeB().getSubnet() == transformer3W.getNodeC().getSubnet())
throw new InvalidEntityException(
"Transformer connects nodes in the same subnet", transformer3W);
connectNodesToCorrectVoltageSides(transformer3W);
ratedVoltageOfTransformer3WMatchesVoltagesOfNodes(transformer3W);
}
/**
* Validates a transformer3W type if: <br>
* - it is not null <br>
* - rScA, rScB, rScC are greater 0 (short circuit resistance in branches A,B,C) <br>
* - xScA, xScB, xScC are greater 0 (short circuit impedance in branches A,B,C) <br>
* - gM is greater/equal to 0 (no load conductance) <br>
* - bM is less/equal to 0 (no load susceptance) <br>
* - sRatedA, sRatedB, sRatedC are greater 0 (rated apparent power in branches A,B,C) <br>
* - vRatedA, vRatedB, vRatedC are greater 0 (rated voltage at higher node A,B,C) <br>
* - dV is between 0% and 100% (voltage magnitude increase per tap position <br>
* - dPhi is greater/equal to 0 (voltage angle increase per tap position) <br>
* - neutral tap position is between min and max tap position <br>
* - minimum tap position is smaller than maximum tap position <br>
*
* @param transformer3WType Transformer type to validate
*/
protected static void checkTransformer3WType(Transformer3WTypeInput transformer3WType) {
checkNonNull(transformer3WType, "a three winding transformer type");
detectNegativeQuantities(
new Quantity<?>[] {transformer3WType.getgM(), transformer3WType.getdPhi()},
transformer3WType);
detectZeroOrNegativeQuantities(
new Quantity<?>[] {
transformer3WType.getsRatedA(), transformer3WType.getsRatedB(),
transformer3WType.getsRatedC(),
transformer3WType.getvRatedA(), transformer3WType.getvRatedB(),
transformer3WType.getvRatedC(),
transformer3WType.getrScA(), transformer3WType.getrScB(), transformer3WType.getrScC(),
transformer3WType.getxScA(), transformer3WType.getxScB(), transformer3WType.getxScC()
},
transformer3WType);
detectPositiveQuantities(new Quantity<?>[] {transformer3WType.getbM()}, transformer3WType);
checkVoltageMagnitudeChangePerTapPosition(transformer3WType);
checkMinimumTapPositionIsLowerThanMaximumTapPosition(transformer3WType);
checkNeutralTapPositionLiesBetweenMinAndMaxTapPosition(transformer3WType);
}
/**
* Validates a switch if: <br>
* - its connected nodes are in the same voltage level
*
* @param switchInput Switch to validate
*/
private static void checkSwitch(SwitchInput switchInput) {
if (!switchInput.getNodeA().getVoltLvl().equals(switchInput.getNodeB().getVoltLvl()))
throw new InvalidEntityException("Switch connects two different voltage levels", switchInput);
/* Remark: Connecting two different "subnets" is fine, because as of our definition regarding a switchgear in
* "upstream" direction of a transformer, all the nodes, that hare within the switch chain, belong to the lower
* grid, whilst the "real" upper node is within the upper grid */
}
/**
* Check that a connector connects different nodes
*
* @param connectorInput connectorInput to validate
*/
private static void connectsDifferentNodes(ConnectorInput connectorInput) {
if (connectorInput.getNodeA() == connectorInput.getNodeB()) {
throw new InvalidEntityException(
connectorInput.getClass().getSimpleName() + " connects the same node, but shouldn't",
connectorInput);
}
}
/**
* Check if subnets of connector's nodes are correct depending on if they should be equal or not
*
* @param connectorInput ConnectorInput to validate
* @param shouldBeDifferent determines if subnets should be equal or not
*/
private static void connectsNodesInDifferentSubnets(
ConnectorInput connectorInput, boolean shouldBeDifferent) {
boolean isDifferent =
connectorInput.getNodeA().getSubnet() != connectorInput.getNodeB().getSubnet();
if (shouldBeDifferent && !isDifferent) {
throw new InvalidEntityException(
connectorInput.getClass().getSimpleName() + " connects the same subnet, but shouldn't",
connectorInput);
}
if (!shouldBeDifferent && isDifferent) {
throw new InvalidEntityException(
connectorInput.getClass().getSimpleName() + " connects different subnets, but shouldn't",
connectorInput);
}
}
/**
* Check if voltage levels of connector's nodes are correct depending on if they should be equal
* or not
*
* @param connectorInput ConnectorInput to validate
* @param shouldBeDifferent determines if voltage levels should be different or not
*/
private static void connectsNodesWithDifferentVoltageLevels(
ConnectorInput connectorInput, boolean shouldBeDifferent) {
boolean vltLvlsAreEqual =
connectorInput.getNodeA().getVoltLvl().equals(connectorInput.getNodeB().getVoltLvl());
if (vltLvlsAreEqual && shouldBeDifferent) {
throw new InvalidEntityException(
connectorInput.getClass().getSimpleName()
+ " connects the same voltage level, but shouldn't",
connectorInput);
}
if (!vltLvlsAreEqual && !shouldBeDifferent) {
throw new InvalidEntityException(
connectorInput.getClass().getSimpleName()
+ " connects different voltage levels, but shouldn't",
connectorInput);
}
}
/**
* Check if voltage level of node a is higher than voltage level of node b.
*
* @param transformer Transformer2WInput to validate
*/
private static void connectsNodesToCorrectVoltageSides(Transformer2WInput transformer) {
try {
connectsNodesToCorrectVoltageSides(transformer.getNodeA(), transformer.getNodeB());
} catch (IllegalArgumentException e) {
throw new InvalidEntityException(
transformer.getClass().getSimpleName() + " has nodeA on the lower voltage side.",
transformer);
}
}
/**
* Checks whether the voltage level of node a exceeds the voltage level of node b
*
* @param nodeA Node a
* @param nodeB Node b
*/
public static void connectsNodesToCorrectVoltageSides(NodeInput nodeA, NodeInput nodeB) {
if (nodeB
.getVoltLvl()
.getNominalVoltage()
.isGreaterThan(nodeA.getVoltLvl().getNominalVoltage())) {
throw new IllegalArgumentException(
"nodeA must be on the higher voltage side of the transformer.");
}
}
/**
* Checks, if nodeA is greater than nodeB and nodeB is greater than nodeC of the {@link
* Transformer3WInput}
*
* @param transformer Transformer3WInput to validate
*/
private static void connectNodesToCorrectVoltageSides(Transformer3WInput transformer) {
try {
connectsNodesToCorrectVoltageSides(
transformer.getNodeA(), transformer.getNodeB(), transformer.getNodeC());
} catch (IllegalArgumentException e) {
throw new InvalidEntityException(
transformer.getClass().getSimpleName()
+ " has an invalid node voltage side configuration.",
e,
transformer);
}
}
/**
* Checks whether the voltage level sides are correctly assigned. (nodeA < nodeB < nodeC)
*
* @param nodeA NodeInput a of the transformer
* @param nodeB NodeInput b of the transformer
* @param nodeC NodeInput c of the transformer
*/
public static void connectsNodesToCorrectVoltageSides(
NodeInput nodeA, NodeInput nodeB, NodeInput nodeC) {
if (nodeA
.getVoltLvl()
.getNominalVoltage()
.isGreaterThan(nodeB.getVoltLvl().getNominalVoltage())) {
throw new IllegalArgumentException("Voltage level of nodeB must be greater than nodeA");
}
if (nodeB
.getVoltLvl()
.getNominalVoltage()
.isGreaterThan(nodeC.getVoltLvl().getNominalVoltage())) {
throw new IllegalArgumentException("Voltage level of nodeC must be greater than nodeB");
}
}
/**
* Check if the coordinates of the start and end points of a line equal the coordinates of the
* nodes
*
* @param line LineInput to validate
*/
private static void coordinatesOfLineEqualCoordinatesOfNodes(LineInput line) {
if (!(line.getGeoPosition()
.getStartPoint()
.isWithinDistance(line.getNodeA().getGeoPosition(), ALLOWED_COORDINATE_ERROR)
|| line.getGeoPosition()
.getEndPoint()
.isWithinDistance(line.getNodeA().getGeoPosition(), ALLOWED_COORDINATE_ERROR)))
throw new InvalidEntityException(
"Coordinates of start and end point do not match coordinates of connected nodes", line);
if (!(line.getGeoPosition()
.getStartPoint()
.isWithinDistance(line.getNodeB().getGeoPosition(), ALLOWED_COORDINATE_ERROR)
|| line.getGeoPosition()
.getEndPoint()
.isWithinDistance(line.getNodeB().getGeoPosition(), ALLOWED_COORDINATE_ERROR)))
throw new InvalidEntityException(
"Coordinates of start and end point do not match coordinates of connected nodes", line);
}
/**
* Check if the line length matches the cumulated distances between the single points of the line
*
* @param line LineInput to validate
*/
private static void lineLengthMatchesDistancesBetweenPointsOfLineString(LineInput line) {
// only if not geo positions of both nodes are dummy values
if ((line.getNodeA().getGeoPosition() != NodeInput.DEFAULT_GEO_POSITION
|| line.getNodeB().getGeoPosition() != NodeInput.DEFAULT_GEO_POSITION)
&& !QuantityUtil.isEquivalentAbs(
line.getLength(), GeoUtils.calcHaversine(line.getGeoPosition()), ALLOWED_LENGTH_ERROR))
throw new InvalidEntityException(
"Line length does not equal calculated distances between points building the line", line);
}
/**
* Check if tap position is within bounds
*
* @param transformer2W Transformer2WInput to validate
*/
private static void checkIfTapPositionIsWithinBounds(Transformer2WInput transformer2W) {
if (transformer2W.getTapPos() < transformer2W.getType().getTapMin()
|| transformer2W.getTapPos() > transformer2W.getType().getTapMax())
throw new InvalidEntityException(
"Tap position of " + transformer2W.getClass().getSimpleName() + " is outside of bounds",
transformer2W);
}
/**
* Check if tap position is within bounds
*
* @param transformer3W Transformer3WInput to validate
*/
private static void checkIfTapPositionIsWithinBounds(Transformer3WInput transformer3W) {
if (transformer3W.getTapPos() < transformer3W.getType().getTapMin()
|| transformer3W.getTapPos() > transformer3W.getType().getTapMax())
throw new InvalidEntityException(
"Tap position of " + transformer3W.getClass().getSimpleName() + " is outside of bounds",
transformer3W);
}
/**
* Check if vRated of transformer match voltLvl of nodes
*
* @param transformer2W Transformer2WInput to validate
*/
private static void ratedVoltageOfTransformer2WMatchesVoltagesOfNodes(
Transformer2WInput transformer2W) {
if (!QuantityUtil.isEquivalentAbs(
transformer2W.getType().getvRatedA(),
transformer2W.getNodeA().getVoltLvl().getNominalVoltage(),
ALLOWED_VOLTAGE_ERROR)
|| !QuantityUtil.isEquivalentAbs(
transformer2W.getType().getvRatedB(),
transformer2W.getNodeB().getVoltLvl().getNominalVoltage(),
ALLOWED_VOLTAGE_ERROR))
throw new InvalidEntityException(
"Rated voltages of "
+ transformer2W.getClass().getSimpleName()
+ " do not equal voltage levels at the nodes",
transformer2W);
}
/**
* Check if vRated of transformer match voltLvl of nodes
*
* @param transformer3W Transformer3WInput to validate
*/
private static void ratedVoltageOfTransformer3WMatchesVoltagesOfNodes(
Transformer3WInput transformer3W) {
if (!QuantityUtil.isEquivalentAbs(
transformer3W.getType().getvRatedA(),
transformer3W.getNodeA().getVoltLvl().getNominalVoltage(),
ALLOWED_VOLTAGE_ERROR)
|| !QuantityUtil.isEquivalentAbs(
transformer3W.getType().getvRatedB(),
transformer3W.getNodeB().getVoltLvl().getNominalVoltage(),
ALLOWED_VOLTAGE_ERROR)
|| !QuantityUtil.isEquivalentAbs(
transformer3W.getType().getvRatedC(),
transformer3W.getNodeC().getVoltLvl().getNominalVoltage(),
ALLOWED_VOLTAGE_ERROR))
throw new InvalidEntityException(
"Rated voltages of "
+ transformer3W.getClass().getSimpleName()
+ " do not equal voltage levels at the nodes",
transformer3W);
}
/**
* Check if voltage magnitude increase per tap position of transformer2WType is between 0% and
* 100%
*
* @param transformer2WType Transformer2WTypeInput to validate
*/
private static void checkVoltageMagnitudeChangePerTapPosition(
Transformer2WTypeInput transformer2WType) {
if (transformer2WType.getdV().isLessThan(Quantities.getQuantity(0d, Units.PERCENT))
|| transformer2WType.getdV().isGreaterThan(Quantities.getQuantity(100d, Units.PERCENT)))
throw new InvalidEntityException(
"Voltage magnitude increase per tap position must be between 0% and 100%",
transformer2WType);
}
/**
* Check if voltage magnitude increase per tap position of transformer3WType is between 0% and
* 100%
*
* @param transformer3WType Transformer3WTypeInput to validate
*/
private static void checkVoltageMagnitudeChangePerTapPosition(
Transformer3WTypeInput transformer3WType) {
if (transformer3WType.getdV().isLessThan(Quantities.getQuantity(0d, Units.PERCENT))
|| transformer3WType.getdV().isGreaterThan(Quantities.getQuantity(100d, Units.PERCENT)))
throw new InvalidEntityException(
"Voltage magnitude increase per tap position must be between 0% and 100%",
transformer3WType);
}
/**
* Check if minimum tap position is lower than maximum tap position
*
* @param transformer2WType Transformer2WTypeInput to validate
*/
private static void checkMinimumTapPositionIsLowerThanMaximumTapPosition(
Transformer2WTypeInput transformer2WType) {
if (transformer2WType.getTapMax() < transformer2WType.getTapMin())
throw new InvalidEntityException(
"Minimum tap position must be lower than maximum tap position", transformer2WType);
}
/**
* Check if minimum tap position is lower than maximum tap position
*
* @param transformer3WType Transformer3WTypeInput to validate
*/
private static void checkMinimumTapPositionIsLowerThanMaximumTapPosition(
Transformer3WTypeInput transformer3WType) {
if (transformer3WType.getTapMax() < transformer3WType.getTapMin())
throw new InvalidEntityException(
"Minimum tap position must be lower than maximum tap position", transformer3WType);
}
/**
* Check if neutral tap position lies between minimum and maximum tap position
*
* @param transformer2WType Transformer3WTypeInput to validate
*/
private static void checkNeutralTapPositionLiesBetweenMinAndMaxTapPosition(
Transformer2WTypeInput transformer2WType) {
if (transformer2WType.getTapNeutr() < transformer2WType.getTapMin()
|| transformer2WType.getTapNeutr() > transformer2WType.getTapMax())
throw new InvalidEntityException(
"Neutral tap position must be between minimum and maximum tap position",
transformer2WType);
}
/**
* Check if neutral tap position lies between minimum and maximum tap position
*
* @param transformer3WType Transformer3WTypeInput to validate
*/
private static void checkNeutralTapPositionLiesBetweenMinAndMaxTapPosition(
Transformer3WTypeInput transformer3WType) {
if (transformer3WType.getTapNeutr() < transformer3WType.getTapMin()
|| transformer3WType.getTapNeutr() > transformer3WType.getTapMax())
throw new InvalidEntityException(
"Neutral tap position must be between minimum and maximum tap position",
transformer3WType);
}
}