Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the implementation of private LoadTwoTransformersTapChangers #319

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading