-
Notifications
You must be signed in to change notification settings - Fork 5
/
FixedFeedInInput.java
169 lines (152 loc) · 4.72 KB
/
FixedFeedInInput.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
/*
* © 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.StandardUnits;
import edu.ie3.datamodel.models.input.NodeInput;
import edu.ie3.datamodel.models.input.OperatorInput;
import edu.ie3.datamodel.models.input.system.characteristic.ReactivePowerCharacteristic;
import java.util.Objects;
import java.util.UUID;
import javax.measure.quantity.Power;
import tech.units.indriya.ComparableQuantity;
/** Dummy class to represent a constant feed in regardless of its type */
public class FixedFeedInInput extends SystemParticipantInput {
/** Rated apparent power (typically in kVA) */
private final ComparableQuantity<Power> sRated;
/** Rated power factor */
private final double cosPhiRated;
/**
* Constructor for an operated feed in
*
* @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 qCharacteristics Description of a reactive power characteristic
* @param sRated Rated apparent power
* @param cosPhiRated Power factor
*/
public FixedFeedInInput(
UUID uuid,
String id,
OperatorInput operator,
OperationTime operationTime,
NodeInput node,
ReactivePowerCharacteristic qCharacteristics,
ComparableQuantity<Power> sRated,
double cosPhiRated) {
super(uuid, id, operator, operationTime, node, qCharacteristics);
this.sRated = sRated.to(StandardUnits.S_RATED);
this.cosPhiRated = cosPhiRated;
}
/**
* Constructor for an operated, always on feed in
*
* @param uuid of the input entity
* @param id of the asset
* @param node the asset is connected to
* @param qCharacteristics Description of a reactive power characteristic
* @param sRated Rated apparent power
* @param cosPhiRated Power factor
*/
public FixedFeedInInput(
UUID uuid,
String id,
NodeInput node,
ReactivePowerCharacteristic qCharacteristics,
ComparableQuantity<Power> sRated,
double cosPhiRated) {
super(uuid, id, node, qCharacteristics);
this.sRated = sRated.to(StandardUnits.S_RATED);
this.cosPhiRated = cosPhiRated;
}
public ComparableQuantity<Power> getsRated() {
return sRated;
}
public double getCosPhiRated() {
return cosPhiRated;
}
public FixedFeedInInputCopyBuilder copy() {
return new FixedFeedInInputCopyBuilder(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof FixedFeedInInput that)) return false;
if (!super.equals(o)) return false;
return sRated.equals(that.sRated);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), sRated);
}
@Override
public String toString() {
return "FixedFeedInInput{"
+ "uuid="
+ getUuid()
+ ", id="
+ getId()
+ ", operator="
+ getOperator().getUuid()
+ ", operationTime="
+ getOperationTime()
+ ", node="
+ getNode().getUuid()
+ ", qCharacteristics='"
+ getqCharacteristics()
+ '\''
+ ", sRated="
+ sRated
+ ", cosphiRated="
+ cosPhiRated
+ '}';
}
/**
* A builder pattern based approach to create copies of {@link FixedFeedInInput} entities with
* altered field values. For detailed field descriptions refer to java docs of {@link
* FixedFeedInInput}
*
* @version 0.1
* @since 05.06.20
*/
public static class FixedFeedInInputCopyBuilder
extends SystemParticipantInputCopyBuilder<FixedFeedInInputCopyBuilder> {
private ComparableQuantity<Power> sRated;
private double cosPhiRated;
private FixedFeedInInputCopyBuilder(FixedFeedInInput entity) {
super(entity);
this.sRated = entity.getsRated();
this.cosPhiRated = entity.getCosPhiRated();
}
@Override
public FixedFeedInInput build() {
return new FixedFeedInInput(
getUuid(),
getId(),
getOperator(),
getOperationTime(),
getNode(),
getqCharacteristics(),
sRated,
cosPhiRated);
}
public FixedFeedInInputCopyBuilder sRated(ComparableQuantity<Power> sRated) {
this.sRated = sRated;
return this;
}
public FixedFeedInInputCopyBuilder cosPhiRated(double cosPhiRated) {
this.cosPhiRated = cosPhiRated;
return this;
}
@Override
protected FixedFeedInInputCopyBuilder thisInstance() {
return this;
}
}
}