Skip to content

Commit f03442f

Browse files
committed
controllingEm
1 parent 26c0e8c commit f03442f

38 files changed

+164
-73
lines changed

src/main/java/edu/ie3/datamodel/io/extractor/Extractor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ public static Set<UniqueInputEntity> extractElements(NestedEntity nestedEntity)
5151
if (nestedEntity instanceof HasLine nestedHasLine) {
5252
resultingList.add(nestedHasLine.getLine());
5353
}
54+
if (nestedEntity instanceof HasEm nestedHasEms) {
55+
if (nestedHasEms.getControllingEm().isPresent()) {
56+
resultingList.add(nestedHasEms.getControllingEm().get());
57+
}
58+
}
5459

5560
if (resultingList.contains(null)) {
5661
log.warn(
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* © 2024. TU Dortmund University,
3+
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
4+
* Research group Distribution grid planning and operation
5+
*/
6+
package edu.ie3.datamodel.io.extractor;
7+
8+
import edu.ie3.datamodel.models.input.EmInput;
9+
import java.util.Optional;
10+
11+
/**
12+
* Interface that should be implemented by all elements holding one or more {@link
13+
* edu.ie3.datamodel.models.input.EmInput} elements and should be processable by the {@link
14+
* Extractor}.
15+
*/
16+
public interface HasEm extends NestedEntity {
17+
Optional<EmInput> getControllingEm();
18+
}

src/main/java/edu/ie3/datamodel/models/input/EmInput.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
*/
66
package edu.ie3.datamodel.models.input;
77

8+
import edu.ie3.datamodel.io.extractor.HasEm;
89
import edu.ie3.datamodel.models.OperationTime;
910
import edu.ie3.datamodel.models.UniqueEntity;
1011
import java.util.Objects;
1112
import java.util.Optional;
1213
import java.util.UUID;
1314

14-
public class EmInput extends AssetInput {
15+
public class EmInput extends AssetInput implements HasEm {
1516

1617
/** Reference to the control strategy to be used for this model */
1718
private final String controlStrategy;
@@ -92,15 +93,20 @@ public String toString() {
9293
+ getUuid()
9394
+ ", id='"
9495
+ getId()
95-
+ ", operator="
96+
+ "', operator="
9697
+ getOperator().getUuid()
9798
+ ", operationTime="
9899
+ getOperationTime()
99100
+ ", controlStrategy="
100101
+ getControlStrategy()
101102
+ ", parentEm="
102103
+ getParentEm().map(UniqueEntity::getUuid).map(UUID::toString).orElse("")
103-
+ '}';
104+
+ "}";
105+
}
106+
107+
@Override
108+
public Optional<EmInput> getControllingEm() {
109+
return Optional.ofNullable(parentEm);
104110
}
105111

106112
public static class EmInputCopyBuilder extends AssetInputCopyBuilder<EmInputCopyBuilder> {

src/main/java/edu/ie3/datamodel/models/input/system/BmInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public String toString() {
150150
+ ", qCharacteristics='"
151151
+ getqCharacteristics()
152152
+ "', em="
153-
+ getEm()
153+
+ getControllingEm()
154154
+ ", type="
155155
+ type.getUuid()
156156
+ ", marketReaction="

src/main/java/edu/ie3/datamodel/models/input/system/ChpInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public String toString() {
151151
+ ", qCharacteristics='"
152152
+ getqCharacteristics()
153153
+ "', em="
154-
+ getEm()
154+
+ getControllingEm()
155155
+ ", thermalBus="
156156
+ thermalBus.getUuid()
157157
+ ", type="

src/main/java/edu/ie3/datamodel/models/input/system/EvInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public String toString() {
104104
+ ", qCharacteristics='"
105105
+ getqCharacteristics()
106106
+ "', em="
107-
+ getEm()
107+
+ getControllingEm()
108108
+ ", type="
109109
+ type.getUuid()
110110
+ '}';

src/main/java/edu/ie3/datamodel/models/input/system/EvcsInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public String toString() {
219219
+ ", qCharacteristics='"
220220
+ getqCharacteristics()
221221
+ "', em="
222-
+ getEm()
222+
+ getControllingEm()
223223
+ ", type="
224224
+ type
225225
+ ", chargingPoints="

src/main/java/edu/ie3/datamodel/models/input/system/FixedFeedInInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public String toString() {
116116
+ ", qCharacteristics='"
117117
+ getqCharacteristics()
118118
+ "', em="
119-
+ getEm()
119+
+ getControllingEm()
120120
+ ", sRated="
121121
+ sRated
122122
+ ", cosphiRated="

src/main/java/edu/ie3/datamodel/models/input/system/HpInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public String toString() {
119119
+ ", qCharacteristics='"
120120
+ getqCharacteristics()
121121
+ "', em="
122-
+ getEm()
122+
+ getControllingEm()
123123
+ ", type="
124124
+ type.getUuid()
125125
+ ", thermalBus="

src/main/java/edu/ie3/datamodel/models/input/system/LoadInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public String toString() {
255255
+ ", qCharacteristics='"
256256
+ getqCharacteristics()
257257
+ "', em="
258-
+ getEm()
258+
+ getControllingEm()
259259
+ ", dsm="
260260
+ dsm
261261
+ ", eConsAnnual="

0 commit comments

Comments
 (0)