Skip to content

Commit

Permalink
Enable the implementation of private LoadTwoTransformersTapChangers (#…
Browse files Browse the repository at this point in the history
…319)


Signed-off-by: lisrte <[email protected]>
  • Loading branch information
Lisrte authored Dec 12, 2023
1 parent aad040b commit 88a8161
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ import com.powsybl.iidm.network.Network
@AutoService(DynamicModelGroovyExtension.class)
class LoadTwoTransformersTapChangersGroovyExtension extends AbstractSimpleEquipmentGroovyExtension {

private static final BASE_LIB = "LoadTwoTransformersTapChangers"

LoadTwoTransformersTapChangersGroovyExtension() {
super("LoadTwoTransformersTapChangers")
super(BASE_LIB)
}

protected LoadTwoTransformersTapChangersGroovyExtension(String lib) {
super(lib)
}

@Override
Expand All @@ -38,7 +44,7 @@ class LoadTwoTransformersTapChangersGroovyExtension extends AbstractSimpleEquipm

@Override
LoadTwoTransformersTapChangers build() {
isInstantiable() ? new LoadTwoTransformersTapChangers(dynamicModelId, equipment, parameterSetId) : null
isInstantiable() ? new LoadTwoTransformersTapChangers(dynamicModelId, equipment, parameterSetId, equipmentConfig.lib) : null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
*/
public class LoadTwoTransformersTapChangers extends LoadTwoTransformers implements TapChangerModel {

public LoadTwoTransformersTapChangers(String dynamicModelId, Load load, String parameterSetId) {
super(dynamicModelId, load, parameterSetId, "LoadTwoTransformersTapChangers");
public LoadTwoTransformersTapChangers(String dynamicModelId, Load load, String parameterSetId, String lib) {
super(dynamicModelId, load, parameterSetId, lib);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static Stream<Arguments> provideLoads() {
Arguments.of("load_one_transformer_dyd", (Function<Network, BlackBoxModel>) n -> new LoadOneTransformer(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LOT")),
Arguments.of("load_one_transformer_tap_changer_dyd", (Function<Network, BlackBoxModel>) n -> new LoadOneTransformerTapChanger(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LOTTC")),
Arguments.of("load_two_transformers_dyd", (Function<Network, BlackBoxModel>) n -> new LoadTwoTransformers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTT")),
Arguments.of("load_two_transformers_tap_changers_dyd", (Function<Network, BlackBoxModel>) n -> new LoadTwoTransformersTapChangers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTTTC"))
Arguments.of("load_two_transformers_tap_changers_dyd", (Function<Network, BlackBoxModel>) n -> new LoadTwoTransformersTapChangers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTTTC", "LoadTwoTransformersTapChangers"))
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static Stream<Arguments> provideTapChangers() {
Arguments.of(TransformerSide.HIGH_VOLTAGE, (Function<Network, BlackBoxModel>) n -> new LoadOneTransformer(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LOT"), "LoadOneTransformer doesn't have a transformer side"),
Arguments.of(TransformerSide.NONE, (Function<Network, BlackBoxModel>) n -> new LoadOneTransformerTapChanger(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LOTTC"), "LoadOneTransformerTapChanger already have a tap changer"),
Arguments.of(TransformerSide.NONE, (Function<Network, BlackBoxModel>) n -> new LoadTwoTransformers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTT"), "LoadTwoTransformers must have a side connected to the Tap changer automaton"),
Arguments.of(TransformerSide.HIGH_VOLTAGE, (Function<Network, BlackBoxModel>) n -> new LoadTwoTransformersTapChangers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTTTC"), "LoadTwoTransformersTapChangers already have a tap changer")
Arguments.of(TransformerSide.HIGH_VOLTAGE, (Function<Network, BlackBoxModel>) n -> new LoadTwoTransformersTapChangers(DYN_LOAD_NAME, n.getLoad(LOAD_NAME), "LTTTC", "LoadTwoTransformersTapChangers"), "LoadTwoTransformersTapChangers already have a tap changer")
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void setupNetwork() {
protected void addDynamicModels() {
dynamicModels.add(new TransformerFixedRatio("BBM_NGEN_NHV1", network.getTwoWindingsTransformer("NGEN_NHV1"), "transformer", "TransformerFixedRatio"));
dynamicModels.add(new LoadOneTransformerTapChanger("BBM_LOAD", network.getLoad("LOAD"), "lot"));
dynamicModels.add(new LoadTwoTransformersTapChangers("BBM_LOAD2", network.getLoad("LOAD2"), "ltt"));
dynamicModels.add(new LoadTwoTransformersTapChangers("BBM_LOAD2", network.getLoad("LOAD2"), "ltt", "LoadTwoTransformersTapChangers"));
dynamicModels.add(new TapChangerBlockingAutomaton("BBM_TapChangerBlocking", "TapChangerPar",
network.getTwoWindingsTransformerStream().toList(),
List.of(network.getLoad("LOAD"), network.getLoad("LOAD2")),
Expand Down

0 comments on commit 88a8161

Please sign in to comment.