From ca55d271f5eae9be9587ff3215b0e0f000433821 Mon Sep 17 00:00:00 2001 From: lisrte Date: Mon, 3 Jul 2023 11:31:58 +0200 Subject: [PATCH 01/10] Split Bus model in three based on use case : - connection point for equipment connection (use static id for macro connect with default bus) - measurement point for automaton (replace default bus model) - bus of equipment for omegaref (use equipment id instead of bus id for macro connect) Signed-off-by: lisrte --- .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 58 +++++++------- .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 58 +++++++------- .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 58 +++++++------- .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 36 ++++----- .../powsybl/dynawaltz/DynaWaltzContext.java | 23 +++--- .../models/AbstractBlackBoxModel.java | 28 ++++++- ...Point.java => MeasurementPointSuffix.java} | 8 +- .../TapChangerBlockingAutomaton.java | 8 +- .../dynawaltz/models/buses/AbstractBus.java | 7 +- .../models/buses/BusOfEquipmentModel.java | 18 +++++ .../models/buses/ConnectionPoint.java | 31 +++++++ .../models/buses/DefaultBusOfEquipment.java | 19 +++++ ...odel.java => DefaultMeasurementPoint.java} | 26 ++---- .../{BusModel.java => MeasurementPoint.java} | 12 +-- .../models/buses/StaticDefaultBusModel.java | 63 +++++++++++++++ .../defaultmodels/DefaultModelsHandler.java | 8 +- .../models/events/NodeFaultEvent.java | 6 +- .../FrequencySynchronizedModel.java | 2 +- .../frequencysynchronizers/OmegaRef.java | 13 ++- .../generators/AbstractGeneratorModel.java | 7 +- .../generators/GridFormingConverter.java | 14 +--- .../generators/SynchronizedGenerator.java | 7 -- .../generators/SynchronizedWeccGen.java | 7 -- .../dynawaltz/models/generators/WeccGen.java | 7 +- .../dynawaltz/models/hvdc/AbstractHvdc.java | 15 ++-- .../dynawaltz/models/hvdc/DanglingSide.java | 10 +-- .../dynawaltz/models/hvdc/HvdcPvDangling.java | 5 +- .../models/hvdc/HvdcVscDangling.java | 4 +- .../dynawaltz/models/lines/StandardLine.java | 10 +-- .../dynawaltz/models/loads/AbstractLoad.java | 7 +- .../dynawaltz/models/loads/LoadAlphaBeta.java | 4 +- .../models/loads/LoadOneTransformer.java | 4 +- .../loads/LoadOneTransformerTapChanger.java | 4 +- .../models/loads/LoadTwoTransformers.java | 4 +- .../loads/LoadTwoTransformersTapChangers.java | 4 +- .../models/svarcs/StaticVarCompensator.java | 7 +- .../transformers/TransformerFixedRatio.java | 10 +-- .../dynawaltz/models/utils/BusUtils.java | 17 +--- dynawaltz/src/test/resources/apv_dyd.xml | 26 +++--- dynawaltz/src/test/resources/cla_dyd.xml | 8 +- .../src/test/resources/disconnect_dyd.xml | 6 +- .../disconnect_hvdc_pv_dangling_dyd.xml | 10 +-- .../test/resources/disconnect_hvdc_pv_dyd.xml | 12 +-- .../disconnect_hvdc_vsc_dangling_dyd.xml | 10 +-- .../resources/disconnect_hvdc_vsc_dyd.xml | 12 +-- dynawaltz/src/test/resources/dyd.xml | 80 +++++++++---------- .../src/test/resources/dyd_fictitious.xml | 6 +- dynawaltz/src/test/resources/events.xml | 12 +-- .../resources/grid_forming_converter_dyd.xml | 10 +-- .../test/resources/hvdc_pv_dangling_dyd.xml | 10 +-- dynawaltz/src/test/resources/hvdc_pv_dyd.xml | 12 +-- .../test/resources/hvdc_vsc_dangling_dyd.xml | 10 +-- dynawaltz/src/test/resources/hvdc_vsc_dyd.xml | 12 +-- .../test/resources/load_alpha_beta_dyd.xml | 6 +- .../resources/load_one_transformer_dyd.xml | 8 +- .../load_one_transformer_tap_changer_dyd.xml | 10 +-- .../resources/load_two_transformers_dyd.xml | 10 +-- ...load_two_transformers_tap_changers_dyd.xml | 14 ++-- .../src/test/resources/node_fault_dyd.xml | 4 +- .../src/test/resources/omega_ref_dyd.xml | 28 +++---- .../test/resources/phase_shifter_i_dyd.xml | 8 +- .../test/resources/set_point_inf_bus_dyd.xml | 4 +- dynawaltz/src/test/resources/svarc_dyd.xml | 4 +- .../resources/tap_changer_blocking_dyd.xml | 40 +++++----- .../tap_changer_blocking_tap_changer_dyd.xml | 24 +++--- .../src/test/resources/tap_changer_dyd.xml | 20 ++--- dynawaltz/src/test/resources/tfr_dyd.xml | 8 +- dynawaltz/src/test/resources/wecc_pv_dyd.xml | 10 +-- dynawaltz/src/test/resources/wecc_wt_dyd.xml | 4 +- .../test/resources/wecc_wt_synchro_dyd.xml | 10 +-- 70 files changed, 582 insertions(+), 495 deletions(-) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/{MeasurementPoint.java => MeasurementPointSuffix.java} (74%) create mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java create mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java create mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfEquipment.java rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{DefaultBusModel.java => DefaultMeasurementPoint.java} (57%) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{BusModel.java => MeasurementPoint.java} (60%) create mode 100644 dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StaticDefaultBusModel.java diff --git a/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd index 4a70b0fc9..9f9176a91 100644 --- a/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -53,16 +53,16 @@ - - + + - - + + - - + + @@ -76,8 +76,8 @@ - - + + @@ -102,35 +102,35 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + - + - + diff --git a/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd index e220bde93..42694b0c7 100644 --- a/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -51,24 +51,24 @@ - - + + - - + + - - + + - - + + @@ -93,31 +93,31 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + - + - + diff --git a/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd index 49a579af0..c693f387b 100644 --- a/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -50,24 +50,24 @@ - - + + - - + + - - + + - - + + @@ -89,30 +89,30 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - + - + - + - + diff --git a/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd index 342eebf1b..bc09cdf24 100644 --- a/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -24,16 +24,16 @@ - - + + - - + + @@ -43,26 +43,26 @@ - - - - - - - + + + + + + + - + - + - + - + - + - + - + diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java index 84fb404b9..57379d681 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java @@ -10,7 +10,9 @@ import com.powsybl.dynamicsimulation.Curve; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; import com.powsybl.dynawaltz.models.*; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.dynawaltz.models.buses.InfiniteBus; +import com.powsybl.dynawaltz.models.buses.StaticDefaultBusModel; import com.powsybl.dynawaltz.models.defaultmodels.DefaultModelsHandler; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizerModel; @@ -134,6 +136,17 @@ public T getPureDynamicModel(String dynamicId, Class connec throw new PowsyblException(String.format(MODEL_ID_EXCEPTION, dynamicId, connectableClass.getSimpleName())); } + public ConnectionPoint getConnectionPointDynamicModel(String staticId) { + BlackBoxModel bbm = staticIdBlackBoxModelMap.get(staticId); + if (bbm == null) { + return StaticDefaultBusModel.getInstance(); + } + if (bbm instanceof ConnectionPoint) { + return (ConnectionPoint) bbm; + } + throw new PowsyblException(String.format(MODEL_ID_EXCEPTION, staticId, "ConnectionPoint")); + } + private EquipmentBlackBoxModel mergeDuplicateStaticId(EquipmentBlackBoxModel bbm1, EquipmentBlackBoxModel bbm2) { throw new PowsyblException("Duplicate staticId: " + bbm1.getStaticId()); } @@ -156,20 +169,10 @@ public void addMacroConnect(String macroConnectorId, List macroConnectList.add(new MacroConnect(macroConnectorId, attributesFrom, attributesTo)); } - public void addMacroConnect(String macroConnectorId, List attributesFrom) { - macroConnectList.add(new MacroConnect(macroConnectorId, attributesFrom)); - } - public List getMacroConnectList() { return macroConnectList; } - public String addMacroConnector(String name1, List varConnections) { - String macroConnectorId = MacroConnector.createMacroConnectorId(name1); - macroConnectorsMap.computeIfAbsent(macroConnectorId, k -> new MacroConnector(macroConnectorId, varConnections)); - return macroConnectorId; - } - public String addMacroConnector(String name1, String name2, List varConnections) { String macroConnectorId = MacroConnector.createMacroConnectorId(name1, name2); macroConnectorsMap.computeIfAbsent(macroConnectorId, k -> new MacroConnector(macroConnectorId, varConnections)); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java index 23ce3aad0..45fece986 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java @@ -8,7 +8,10 @@ import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.DynaWaltzParameters; -import com.powsybl.iidm.network.Identifiable; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.utils.SideConverter; +import com.powsybl.iidm.network.*; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; @@ -149,4 +152,27 @@ protected final void createMacroConnections(Identifiable eq List fromAttributes = Stream.concat(getMacroConnectFromAttributes().stream(), Arrays.stream(connectFromAttributes)).collect(Collectors.toList()); context.addMacroConnect(macroConnectorId, fromAttributes, connectedModel.getMacroConnectToAttributes()); } + + protected void createTerminalMacroConnections(Bus bus, Function> varConnectionsSupplier, DynaWaltzContext context) { + ConnectionPoint connectedModel = context.getConnectionPointDynamicModel(bus.getId()); + String macroConnectorId = context.addMacroConnector(getName(), connectedModel.getName(), varConnectionsSupplier.apply(connectedModel)); + context.addMacroConnect(macroConnectorId, getMacroConnectFromAttributes(), connectedModel.getMacroConnectToAttributes()); + } + + protected void createTerminalMacroConnections(Injection equipment, Function> varConnectionsSupplier, DynaWaltzContext context) { + ConnectionPoint connectedModel = context.getConnectionPointDynamicModel(BusUtils.getConnectableBusStaticId(equipment)); + String macroConnectorId = context.addMacroConnector(getName(), connectedModel.getName(), varConnectionsSupplier.apply(connectedModel)); + context.addMacroConnect(macroConnectorId, getMacroConnectFromAttributes(), connectedModel.getMacroConnectToAttributes()); + } + + protected final void createTerminalMacroConnections(Terminal terminal, BiFunction> varConnectionsSupplier, DynaWaltzContext context, Side side) { + ConnectionPoint connectedModel = context.getConnectionPointDynamicModel(BusUtils.getConnectableBusStaticId(terminal)); + String macroConnectorId = context.addMacroConnector(getName(), connectedModel.getName(), side, varConnectionsSupplier.apply(connectedModel, side)); + context.addMacroConnect(macroConnectorId, getMacroConnectFromAttributes(), connectedModel.getMacroConnectToAttributes()); + } + + protected final void createTerminalMacroConnections(HvdcLine hvdc, BiFunction> varConnectionsSupplier, DynaWaltzContext context, Side side) { + HvdcConverterStation station = hvdc.getConverterStation(SideConverter.convert(side)); + createTerminalMacroConnections(station.getTerminal(), varConnectionsSupplier, context, side); + } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/MeasurementPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/MeasurementPointSuffix.java similarity index 74% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/MeasurementPoint.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/MeasurementPointSuffix.java index 5844725c0..926d6ed4f 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/MeasurementPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/MeasurementPointSuffix.java @@ -10,23 +10,23 @@ /** * @author Laurent Issertial */ -public final class MeasurementPoint implements MacroConnectionSuffix { +public final class MeasurementPointSuffix implements MacroConnectionSuffix { private static final String MEASURE_PREFIX = "Measure"; private final String idSuffix; private final String connectionSuffix; - private MeasurementPoint(String idSuffix, String connectionSuffix) { + private MeasurementPointSuffix(String idSuffix, String connectionSuffix) { this.idSuffix = idSuffix; this.connectionSuffix = connectionSuffix; } - public static MeasurementPoint of(int i) { + public static MeasurementPointSuffix of(int i) { if (i < 1) { throw new IllegalArgumentException(); } - return new MeasurementPoint(MEASURE_PREFIX + i, i != 1 ? String.valueOf(i) : ""); + return new MeasurementPointSuffix(MEASURE_PREFIX + i, i != 1 ? String.valueOf(i) : ""); } public String getIdSuffix() { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java index bd461d551..157844169 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java @@ -10,9 +10,9 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.AbstractPureDynamicBlackBoxModel; -import com.powsybl.dynawaltz.models.MeasurementPoint; +import com.powsybl.dynawaltz.models.MeasurementPointSuffix; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.MeasurementPoint; import com.powsybl.dynawaltz.models.transformers.TapChangerModel; import com.powsybl.iidm.network.Bus; import com.powsybl.iidm.network.IdentifiableType; @@ -86,7 +86,7 @@ public void createMacroConnections(DynaWaltzContext context) { } int i = 1; for (Bus bus : uMeasurements) { - createMacroConnections(bus, BusModel.class, this::getVarConnectionsWith, context, MeasurementPoint.of(i)); + createMacroConnections(bus, MeasurementPoint.class, this::getVarConnectionsWith, context, MeasurementPointSuffix.of(i)); i++; } } @@ -95,7 +95,7 @@ private List getVarConnectionsWith(TapChangerModel connected) { return connected.getTapChangerBlockerVarConnections(); } - private List getVarConnectionsWith(BusModel connected, String suffix) { + private List getVarConnectionsWith(MeasurementPoint connected, String suffix) { return connected.getUImpinVarName() .map(uImpinVarName -> List.of(new VarConnection("tapChangerBlocking_UMonitored" + suffix, uImpinVarName))) .orElse(Collections.emptyList()); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java index 432d0617a..3b6400083 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java @@ -20,7 +20,7 @@ /** * @author Laurent Issertial */ -public abstract class AbstractBus extends AbstractEquipmentBlackBoxModel implements BusModel { +public abstract class AbstractBus extends AbstractEquipmentBlackBoxModel implements ConnectionPoint, MeasurementPoint { protected AbstractBus(String dynamicModelId, Bus bus, String parameterSetId, String lib) { super(dynamicModelId, parameterSetId, bus, lib); @@ -59,11 +59,6 @@ public Optional getSwitchOffSignalVarName() { return Optional.empty(); } - @Override - public Optional getNumCCVarName() { - return Optional.empty(); - } - @Override public Optional getUImpinVarName() { return Optional.empty(); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java new file mode 100644 index 000000000..db9e4ee70 --- /dev/null +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com/) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.dynawaltz.models.buses; + +import com.powsybl.dynawaltz.models.Model; + +/** + * @author Laurent Issertial + */ +public interface BusOfEquipmentModel extends Model { + + String getNumCCVarName(); +} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java new file mode 100644 index 000000000..74f3223f3 --- /dev/null +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com/) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.dynawaltz.models.buses; + +import com.powsybl.dynawaltz.models.Model; +import com.powsybl.dynawaltz.models.Side; + +import java.util.Optional; + +/** + * @author Laurent Issertial + */ +public interface ConnectionPoint extends Model { + + String getTerminalVarName(); + + default String getTerminalVarName(Side side) { + return getTerminalVarName(); + } + + Optional getSwitchOffSignalVarName(); + + default Optional getSwitchOffSignalVarName(Side side) { + return getSwitchOffSignalVarName(); + } +} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfEquipment.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfEquipment.java new file mode 100644 index 000000000..ae8ab42c5 --- /dev/null +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfEquipment.java @@ -0,0 +1,19 @@ +package com.powsybl.dynawaltz.models.buses; + +import com.powsybl.dynawaltz.models.defaultmodels.AbstractDefaultModel; + +public class DefaultBusOfEquipment extends AbstractDefaultModel implements BusOfEquipmentModel { + + public DefaultBusOfEquipment(String staticId) { + super(staticId); + } + + @Override + public String getName() { + return "DefaultBusOfEquipment"; + } + + public String getNumCCVarName() { + return "@@NAME@@@NODE@_numcc"; + } +} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java similarity index 57% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java index 4423c7177..c26554568 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java @@ -1,8 +1,9 @@ /** - * Copyright (c) 2022, RTE (http://www.rte-france.com) + * Copyright (c) 2023, RTE (http://www.rte-france.com/) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 */ package com.powsybl.dynawaltz.models.buses; @@ -11,31 +12,18 @@ import java.util.Optional; /** + * @author Laurent Issertial * @author Florian Dupuy */ -public class DefaultBusModel extends AbstractDefaultModel implements BusModel { - public DefaultBusModel(String staticId) { +public class DefaultMeasurementPoint extends AbstractDefaultModel implements MeasurementPoint { + + public DefaultMeasurementPoint(String staticId) { super(staticId); } @Override public String getName() { - return "DefaultBus"; - } - - @Override - public String getTerminalVarName() { - return "@NAME@_ACPIN"; - } - - @Override - public Optional getSwitchOffSignalVarName() { - return Optional.of("@NAME@_switchOff"); - } - - @Override - public Optional getNumCCVarName() { - return Optional.of("@NAME@_numcc"); + return "DefaultMeasurementPoint"; } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java similarity index 60% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusModel.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java index 54e781deb..e8f077013 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java @@ -1,8 +1,9 @@ /** - * Copyright (c) 2022, RTE (http://www.rte-france.com) + * Copyright (c) 2023, RTE (http://www.rte-france.com/) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 */ package com.powsybl.dynawaltz.models.buses; @@ -11,14 +12,9 @@ import java.util.Optional; /** - * @author Florian Dupuy + * @author Laurent Issertial */ -public interface BusModel extends Model { - String getTerminalVarName(); - - Optional getSwitchOffSignalVarName(); - - Optional getNumCCVarName(); +public interface MeasurementPoint extends Model { Optional getUImpinVarName(); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StaticDefaultBusModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StaticDefaultBusModel.java new file mode 100644 index 000000000..4454d3f1e --- /dev/null +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StaticDefaultBusModel.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2023, RTE (http://www.rte-france.com/) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.dynawaltz.models.buses; + +import com.powsybl.dynawaltz.models.MacroConnectAttribute; +import com.powsybl.dynawaltz.models.Side; +import com.powsybl.dynawaltz.xml.DynaWaltzXmlConstants; + +import java.util.List; +import java.util.Optional; + +/** + * @author Laurent Issertial + */ +public final class StaticDefaultBusModel implements ConnectionPoint { + + private static StaticDefaultBusModel INSTANCE; + + private StaticDefaultBusModel() { + } + + public static StaticDefaultBusModel getInstance() { + if (INSTANCE == null) { + INSTANCE = new StaticDefaultBusModel(); + } + return INSTANCE; + } + + @Override + public String getName() { + return "DefaultBus"; + } + + @Override + public String getTerminalVarName() { + return "@STATIC_ID@@NODE@_ACPIN"; + } + + @Override + public String getTerminalVarName(Side side) { + return "@STATIC_ID@@NODE" + side.getSideNumber() + "@_ACPIN"; + } + + @Override + public Optional getSwitchOffSignalVarName() { + return Optional.of("@STATIC_ID@@NODE@_switchOff"); + } + + @Override + public Optional getSwitchOffSignalVarName(Side side) { + return Optional.of("@STATIC_ID@@NODE" + side.getSideNumber() + "@_switchOff"); + } + + @Override + public List getMacroConnectToAttributes() { + return List.of(MacroConnectAttribute.of("id2", DynaWaltzXmlConstants.NETWORK)); + } +} diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java index 51fd6668f..3b9f9f24c 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java @@ -8,8 +8,8 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.models.Model; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.buses.DefaultBusModel; +import com.powsybl.dynawaltz.models.buses.DefaultMeasurementPoint; +import com.powsybl.dynawaltz.models.buses.MeasurementPoint; import com.powsybl.dynawaltz.models.generators.GeneratorModel; import com.powsybl.dynawaltz.models.generators.DefaultGeneratorModel; import com.powsybl.dynawaltz.models.hvdc.DefaultHvdcModel; @@ -40,7 +40,7 @@ public class DefaultModelsHandler { private final Map, DefaultModelFactory> factoryMap; public DefaultModelsHandler() { - factoryMap = Map.of(BusModel.class, new DefaultModelFactory(DefaultBusModel::new), + factoryMap = Map.of(MeasurementPoint.class, new DefaultModelFactory(DefaultMeasurementPoint::new), GeneratorModel.class, new DefaultModelFactory(DefaultGeneratorModel::new), HvdcModel.class, new DefaultModelFactory(DefaultHvdcModel::new), LineModel.class, new DefaultModelFactory(DefaultLineModel::new), @@ -49,7 +49,7 @@ public DefaultModelsHandler() { StaticVarCompensatorModel.class, new DefaultModelFactory(DefaultStaticVarCompensatorModel::new), TransformerModel.class, new DefaultModelFactory(DefaultTransformerModel::new)); - powSyBlTypeToModel.put(IdentifiableType.BUS, BusModel.class); + powSyBlTypeToModel.put(IdentifiableType.BUS, MeasurementPoint.class); powSyBlTypeToModel.put(IdentifiableType.GENERATOR, GeneratorModel.class); powSyBlTypeToModel.put(IdentifiableType.HVDC_LINE, HvdcModel.class); powSyBlTypeToModel.put(IdentifiableType.LINE, LineModel.class); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java index 2e8608452..a0e3c2b62 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java @@ -9,7 +9,7 @@ import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.dynawaltz.parameters.ParameterType; import com.powsybl.dynawaltz.xml.ParametersXml; import com.powsybl.iidm.network.Bus; @@ -45,10 +45,10 @@ public String getLib() { @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(getEquipment(), BusModel.class, this::getVarConnectionsWith, context); + createTerminalMacroConnections((Bus) getEquipment(), this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(BusModel connected) { + private List getVarConnectionsWith(ConnectionPoint connected) { return List.of(new VarConnection("fault_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/FrequencySynchronizedModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/FrequencySynchronizedModel.java index 464c170c9..d9711a178 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/FrequencySynchronizedModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/FrequencySynchronizedModel.java @@ -39,5 +39,5 @@ default double getWeightGen(DynaWaltzParameters dynaWaltzParameters) { String getRunningVarName(); - String getConnectedBusId(); + String getStaticId(); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java index 889932e26..9d52b34a0 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java @@ -11,12 +11,12 @@ import com.powsybl.dynawaltz.DynaWaltzParameters; import com.powsybl.dynawaltz.models.MacroConnectAttribute; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.BusOfEquipmentModel; +import com.powsybl.dynawaltz.models.buses.DefaultBusOfEquipment; import com.powsybl.dynawaltz.xml.ParametersXml; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import java.util.Collections; import java.util.List; import static com.powsybl.dynawaltz.parameters.ParameterType.DOUBLE; @@ -68,10 +68,8 @@ private List getVarConnectionsWith(FrequencySynchronizedModel con return connected.getOmegaRefVarConnections(); } - private List getVarConnectionsWith(BusModel connected) { - return connected.getNumCCVarName() - .map(numCCVarName -> List.of(new VarConnection("numcc_node_@INDEX@", numCCVarName))) - .orElse(Collections.emptyList()); + private List getVarConnectionsWith(BusOfEquipmentModel connected) { + return List.of(new VarConnection("numcc_node_@INDEX@", connected.getNumCCVarName())); } @Override @@ -79,7 +77,8 @@ public void createMacroConnections(DynaWaltzContext context) throws PowsyblExcep int index = 0; for (FrequencySynchronizedModel eq : synchronizedEquipments) { createMacroConnections(eq, getVarConnectionsWith(eq), context, MacroConnectAttribute.ofIndex1(index)); - createMacroConnections(eq.getConnectedBusId(), BusModel.class, this::getVarConnectionsWith, context, MacroConnectAttribute.ofIndex1(index)); + BusOfEquipmentModel busOf = new DefaultBusOfEquipment(eq.getStaticId()); + createMacroConnections(busOf, getVarConnectionsWith(busOf), context, MacroConnectAttribute.ofIndex1(index)); index++; } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGeneratorModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGeneratorModel.java index 7414ea487..d72646102 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGeneratorModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGeneratorModel.java @@ -10,8 +10,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.iidm.network.Generator; import java.util.ArrayList; @@ -40,10 +39,10 @@ public List getVarsMapping() { @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWith, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(BusModel connected) { + private List getVarConnectionsWith(ConnectionPoint connected) { List varConnections = new ArrayList<>(2); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java index d30864f93..cac359c27 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java @@ -12,16 +12,13 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; import com.powsybl.iidm.network.Generator; import java.util.Arrays; import java.util.List; -import static com.powsybl.dynawaltz.models.utils.BusUtils.getConnectableBusStaticId; - /** * @author Laurent Issertial */ @@ -38,10 +35,10 @@ public GridFormingConverter(String dynamicModelId, Generator generator, String p @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWith, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(BusModel connected) { + private List getVarConnectionsWith(ConnectionPoint connected) { return List.of(new VarConnection("converter_terminal", connected.getTerminalVarName())); } @@ -59,11 +56,6 @@ public String getRunningVarName() { return "converter_running"; } - @Override - public String getConnectedBusId() { - return getConnectableBusStaticId(equipment); - } - @Override public List getOmegaRefVarConnections() { return List.of( diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGenerator.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGenerator.java index e32ed0703..bc8590ede 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGenerator.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedGenerator.java @@ -13,8 +13,6 @@ import java.util.List; -import static com.powsybl.dynawaltz.models.utils.BusUtils.getConnectableBusStaticId; - /** * @author Dimitri Baudrier * @author Laurent Issertial @@ -44,9 +42,4 @@ public List getSetPointVarConnections() { public String getOmegaRefPuVarName() { return "generator_omegaRefPu"; } - - @Override - public String getConnectedBusId() { - return getConnectableBusStaticId(equipment); - } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedWeccGen.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedWeccGen.java index c75760db8..f19c93a21 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedWeccGen.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/SynchronizedWeccGen.java @@ -10,8 +10,6 @@ import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; import com.powsybl.iidm.network.Generator; -import static com.powsybl.dynawaltz.models.utils.BusUtils.getConnectableBusStaticId; - /** * @author Laurent Issertial */ @@ -30,9 +28,4 @@ public String getOmegaRefPuVarName() { public String getRunningVarName() { return weccPrefix + "_injector_running"; } - - @Override - public String getConnectedBusId() { - return getConnectableBusStaticId(equipment); - } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java index 85421af72..3dc864fad 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java @@ -11,8 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.iidm.network.Generator; import java.util.List; @@ -37,10 +36,10 @@ public WeccGen(String dynamicModelId, Generator generator, String parameterSetId @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWith, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(BusModel connected) { + private List getVarConnectionsWith(ConnectionPoint connected) { return List.of(new VarConnection(weccPrefix + "_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java index 8dc6a1b62..9d32fd529 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java @@ -12,8 +12,7 @@ import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.iidm.network.HvdcLine; import java.util.ArrayList; @@ -41,8 +40,8 @@ protected AbstractHvdc(String dynamicModelId, HvdcLine hvdc, String parameterSet @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment.getConverterStation1().getTerminal()), BusModel.class, this::getVarConnectionsWith, context, Side.ONE); - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment.getConverterStation2().getTerminal()), BusModel.class, this::getVarConnectionsWith, context, Side.TWO); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context, Side.ONE); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context, Side.TWO); } @Override @@ -50,16 +49,16 @@ public List getVarsMapping() { return VAR_MAPPING; } - protected List getVarConnectionsWith(BusModel connected, Side side) { + protected List getVarConnectionsWith(ConnectionPoint connected, Side side) { List varConnections = new ArrayList<>(2); varConnections.add(getSimpleVarConnectionWithBus(connected, side)); - connected.getSwitchOffSignalVarName() + connected.getSwitchOffSignalVarName(side) .map(switchOff -> new VarConnection("hvdc_switchOffSignal1" + side.getSideSuffix(), switchOff)) .ifPresent(varConnections::add); return varConnections; } - protected final VarConnection getSimpleVarConnectionWithBus(BusModel connected, Side side) { - return new VarConnection(TERMINAL_PREFIX + side.getSideNumber(), connected.getTerminalVarName()); + protected final VarConnection getSimpleVarConnectionWithBus(ConnectionPoint connected, Side side) { + return new VarConnection(TERMINAL_PREFIX + side.getSideNumber(), connected.getTerminalVarName(side)); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java index c6e7998c9..06fa9ab22 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java @@ -2,7 +2,7 @@ import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import java.util.List; import java.util.Objects; @@ -27,13 +27,13 @@ public int getSideNumber() { return side.getSideNumber(); } - public void createMacroConnections(BiFunction> basicVarConnectionsSupplier, - BiConsumer>, Side> connectionCreator) { + public void createMacroConnections(BiFunction> basicVarConnectionsSupplier, + BiConsumer>, Side> connectionCreator) { connectionCreator.accept(this::getVarConnectionsWith, side); connectionCreator.accept(basicVarConnectionsSupplier, side.getOppositeSide()); } - private List getVarConnectionsWith(BusModel connected, Side side) { - return List.of(new VarConnection(prefix + side.getSideNumber(), connected.getTerminalVarName())); + private List getVarConnectionsWith(ConnectionPoint connected, Side side) { + return List.of(new VarConnection(prefix + side.getSideNumber(), connected.getTerminalVarName(side))); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcPvDangling.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcPvDangling.java index 33b2e7e8d..c2e098463 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcPvDangling.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcPvDangling.java @@ -10,8 +10,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.Side; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.utils.SideConverter; import com.powsybl.iidm.network.HvdcLine; /** @@ -30,7 +29,7 @@ public HvdcPvDangling(String dynamicModelId, HvdcLine hvdc, String parameterSetI public void createMacroConnections(DynaWaltzContext context) { danglingSide.createMacroConnections( this::getVarConnectionsWith, - (varCoSupplier, side) -> createMacroConnections(BusUtils.getConnectableBusStaticId(equipment, side), BusModel.class, varCoSupplier, context, side) + (varCoSupplier, side) -> createTerminalMacroConnections(equipment.getConverterStation(SideConverter.convert(side)).getTerminal(), varCoSupplier, context, side) ); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscDangling.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscDangling.java index 348ee87ef..f5afd7099 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscDangling.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/HvdcVscDangling.java @@ -10,8 +10,6 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.Side; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; import com.powsybl.iidm.network.HvdcLine; /** @@ -30,7 +28,7 @@ public HvdcVscDangling(String dynamicModelId, HvdcLine hvdc, String parameterSet public void createMacroConnections(DynaWaltzContext context) { danglingSide.createMacroConnections( this::getVarConnectionsWith, - (varCoSupplier, side) -> createMacroConnections(BusUtils.getConnectableBusStaticId(equipment, side), BusModel.class, varCoSupplier, context, side) + (varCoSupplier, side) -> createTerminalMacroConnections(equipment, varCoSupplier, context, side) ); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java index dd8713be7..0dffc2ac7 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java @@ -11,8 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.dynawaltz.models.utils.SideConverter; import com.powsybl.iidm.network.Line; @@ -27,7 +26,7 @@ public StandardLine(String dynamicModelId, Line line, String parameterSetId) { super(dynamicModelId, parameterSetId, line, "Line"); } - private List getVarConnectionsWith(BusModel connected, Side side) { + private List getVarConnectionsWith(ConnectionPoint connected, Side side) { return List.of(new VarConnection(getTerminalVarName(side), connected.getTerminalVarName())); } @@ -37,10 +36,7 @@ private String getTerminalVarName(Side side) { @Override public void createMacroConnections(DynaWaltzContext context) { - equipment.getTerminals().forEach(t -> { - String busStaticId = BusUtils.getConnectableBusStaticId(t); - createMacroConnections(busStaticId, BusModel.class, this::getVarConnectionsWith, context, SideConverter.convert(equipment.getSide(t))); - }); + equipment.getTerminals().forEach(t -> createTerminalMacroConnections(t, this::getVarConnectionsWith, context, SideConverter.convert(equipment.getSide(t)))); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java index ca2187ac7..cee383f35 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java @@ -9,8 +9,7 @@ import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.List; @@ -34,10 +33,10 @@ protected String getTerminalVarName() { @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWith, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - abstract List getVarConnectionsWith(BusModel connected); + abstract List getVarConnectionsWith(ConnectionPoint connected); @Override public String getSwitchOffSignalEventVarName() { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadAlphaBeta.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadAlphaBeta.java index a1bee86e3..8648d026a 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadAlphaBeta.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadAlphaBeta.java @@ -8,7 +8,7 @@ import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.ArrayList; @@ -35,7 +35,7 @@ public List getVarsMapping() { } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(ConnectionPoint connected) { List varConnections = new ArrayList<>(2); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java index 70ef6eedf..3925602c3 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java @@ -10,7 +10,7 @@ import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.ArrayList; @@ -44,7 +44,7 @@ public List getVarsMapping() { } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(ConnectionPoint connected) { List varConnections = new ArrayList<>(3); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java index 480ac6425..46b723f9f 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java @@ -10,7 +10,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.dynawaltz.models.transformers.TapChangerModel; import com.powsybl.iidm.network.Load; @@ -28,7 +28,7 @@ public LoadOneTransformerTapChanger(String dynamicModelId, Load load, String par } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(ConnectionPoint connected) { List varConnections = super.getVarConnectionsWith(connected); connected.getSwitchOffSignalVarName() .map(switchOff -> new VarConnection("tapChanger_switchOffSignal1", switchOff)) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java index 31274cd48..40d1c73d9 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java @@ -11,7 +11,7 @@ import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.ArrayList; @@ -40,7 +40,7 @@ protected LoadTwoTransformers(String dynamicModelId, Load load, String parameter } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(ConnectionPoint connected) { List varConnections = new ArrayList<>(3); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java index a7ce7fa3f..40d1a6c4a 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java @@ -10,7 +10,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.dynawaltz.models.transformers.TapChangerModel; import com.powsybl.iidm.network.Load; @@ -29,7 +29,7 @@ public LoadTwoTransformersTapChangers(String dynamicModelId, Load load, String p } @Override - protected List getVarConnectionsWith(BusModel connected) { + protected List getVarConnectionsWith(ConnectionPoint connected) { List varConnections = super.getVarConnectionsWith(connected); connected.getSwitchOffSignalVarName() .ifPresent(switchOff -> { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java index 225eb1d02..40d84d5fe 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java @@ -11,8 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import java.util.Arrays; import java.util.List; @@ -34,10 +33,10 @@ public StaticVarCompensator(String dynamicModelId, com.powsybl.iidm.network.Stat @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(BusUtils.getConnectableBusStaticId(equipment), BusModel.class, this::getVarConnectionsWithBus, context); + createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWithBus(BusModel connected) { + private List getVarConnectionsWith(ConnectionPoint connected) { return List.of(new VarConnection("SVarC_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java index 00e80c1f8..31debb09d 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java @@ -11,8 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusModel; -import com.powsybl.dynawaltz.models.utils.BusUtils; +import com.powsybl.dynawaltz.models.buses.ConnectionPoint; import com.powsybl.dynawaltz.models.utils.SideConverter; import com.powsybl.iidm.network.TwoWindingsTransformer; @@ -29,7 +28,7 @@ public TransformerFixedRatio(String dynamicModelId, TwoWindingsTransformer trans super(dynamicModelId, parameterSetId, transformer, lib); } - private List getVarConnectionsWith(BusModel connected, Side side) { + private List getVarConnectionsWith(ConnectionPoint connected, Side side) { return List.of(new VarConnection(getTerminalVarName(side), connected.getTerminalVarName())); } @@ -39,10 +38,7 @@ private String getTerminalVarName(Side side) { @Override public void createMacroConnections(DynaWaltzContext context) { - equipment.getTerminals().forEach(t -> { - String busStaticId = BusUtils.getConnectableBusStaticId(t); - createMacroConnections(busStaticId, BusModel.class, this::getVarConnectionsWith, context, SideConverter.convert(equipment.getSide(t))); - }); + equipment.getTerminals().forEach(t -> createTerminalMacroConnections(t, this::getVarConnectionsWith, context, SideConverter.convert(equipment.getSide(t)))); } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/utils/BusUtils.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/utils/BusUtils.java index bc68f7b98..fb3b6ee58 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/utils/BusUtils.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/utils/BusUtils.java @@ -7,7 +7,6 @@ */ package com.powsybl.dynawaltz.models.utils; -import com.powsybl.dynawaltz.models.Side; import com.powsybl.iidm.network.*; /** @@ -22,19 +21,7 @@ public static String getConnectableBusStaticId(Terminal terminal) { return terminal.getBusBreakerView().getConnectableBus().getId(); } - public static String getConnectableBusStaticId(Generator generator) { - return getConnectableBusStaticId(generator.getTerminal()); - } - - public static String getConnectableBusStaticId(StaticVarCompensator svarc) { - return getConnectableBusStaticId(svarc.getTerminal()); - } - - public static String getConnectableBusStaticId(HvdcLine hvdc, Side side) { - return getConnectableBusStaticId(hvdc.getConverterStation(SideConverter.convert(side)).getTerminal()); - } - - public static String getConnectableBusStaticId(Load load) { - return getConnectableBusStaticId(load.getTerminal()); + public static String getConnectableBusStaticId(Injection injection) { + return getConnectableBusStaticId(injection.getTerminal()); } } diff --git a/dynawaltz/src/test/resources/apv_dyd.xml b/dynawaltz/src/test/resources/apv_dyd.xml index cff7305db..05909df85 100644 --- a/dynawaltz/src/test/resources/apv_dyd.xml +++ b/dynawaltz/src/test/resources/apv_dyd.xml @@ -16,23 +16,23 @@ - - + + - - + + - - + + - - + + @@ -69,13 +69,13 @@ - - - + + + - + - + diff --git a/dynawaltz/src/test/resources/cla_dyd.xml b/dynawaltz/src/test/resources/cla_dyd.xml index a96984c77..4a3ac6cfb 100644 --- a/dynawaltz/src/test/resources/cla_dyd.xml +++ b/dynawaltz/src/test/resources/cla_dyd.xml @@ -19,10 +19,10 @@ - + - + @@ -32,8 +32,8 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_dyd.xml b/dynawaltz/src/test/resources/disconnect_dyd.xml index d19e6da4f..7ecf49327 100644 --- a/dynawaltz/src/test/resources/disconnect_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_dyd.xml @@ -8,8 +8,8 @@ - - + + @@ -28,7 +28,7 @@ - + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml index 8e75eeaf1..6c31a9cd2 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml @@ -5,11 +5,11 @@ - + - - + + @@ -22,7 +22,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml index ed5b27309..7d29bb935 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml @@ -5,12 +5,12 @@ - - + + - - + + @@ -23,7 +23,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml index 94291ba0a..bbbd3662d 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml @@ -5,11 +5,11 @@ - + - - + + @@ -22,7 +22,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml index 99755b917..5588f40ba 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml @@ -5,12 +5,12 @@ - - + + - - + + @@ -23,7 +23,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/dyd.xml b/dynawaltz/src/test/resources/dyd.xml index 3a791e720..4bcba9f39 100644 --- a/dynawaltz/src/test/resources/dyd.xml +++ b/dynawaltz/src/test/resources/dyd.xml @@ -34,43 +34,43 @@ - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + @@ -84,8 +84,8 @@ - - + + @@ -146,32 +146,32 @@ - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - + - + - + diff --git a/dynawaltz/src/test/resources/dyd_fictitious.xml b/dynawaltz/src/test/resources/dyd_fictitious.xml index 55bec847b..e4966f9c9 100644 --- a/dynawaltz/src/test/resources/dyd_fictitious.xml +++ b/dynawaltz/src/test/resources/dyd_fictitious.xml @@ -4,13 +4,13 @@ - - + + - + diff --git a/dynawaltz/src/test/resources/events.xml b/dynawaltz/src/test/resources/events.xml index 00431e2b4..fd0335d1a 100644 --- a/dynawaltz/src/test/resources/events.xml +++ b/dynawaltz/src/test/resources/events.xml @@ -8,16 +8,16 @@ - - + + - - + + @@ -30,9 +30,9 @@ - + - + diff --git a/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml b/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml index 722df7781..79112579f 100644 --- a/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml +++ b/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml @@ -5,22 +5,22 @@ - + - - + + - + - + diff --git a/dynawaltz/src/test/resources/hvdc_pv_dangling_dyd.xml b/dynawaltz/src/test/resources/hvdc_pv_dangling_dyd.xml index 39f65bf63..d01f4cbf5 100644 --- a/dynawaltz/src/test/resources/hvdc_pv_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_pv_dangling_dyd.xml @@ -4,11 +4,11 @@ - + - - + + @@ -18,6 +18,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/hvdc_pv_dyd.xml b/dynawaltz/src/test/resources/hvdc_pv_dyd.xml index d214a7e45..0e91ee88c 100644 --- a/dynawaltz/src/test/resources/hvdc_pv_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_pv_dyd.xml @@ -4,12 +4,12 @@ - - + + - - + + @@ -19,6 +19,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml b/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml index 50c4bd754..8d438c6ef 100644 --- a/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml @@ -4,11 +4,11 @@ - + - - + + @@ -18,6 +18,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml b/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml index 4cdcfc786..1a17573ca 100644 --- a/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml @@ -4,12 +4,12 @@ - - + + - - + + @@ -19,6 +19,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml b/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml index f8a5c52df..b792fb00d 100644 --- a/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml +++ b/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml @@ -4,13 +4,13 @@ - - + + - + diff --git a/dynawaltz/src/test/resources/load_one_transformer_dyd.xml b/dynawaltz/src/test/resources/load_one_transformer_dyd.xml index 510a89f48..a039fee62 100644 --- a/dynawaltz/src/test/resources/load_one_transformer_dyd.xml +++ b/dynawaltz/src/test/resources/load_one_transformer_dyd.xml @@ -4,14 +4,14 @@ - - - + + + - + diff --git a/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml b/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml index 06f3081a7..b99bf4bc0 100644 --- a/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml +++ b/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml @@ -4,15 +4,15 @@ - - - - + + + + - + diff --git a/dynawaltz/src/test/resources/load_two_transformers_dyd.xml b/dynawaltz/src/test/resources/load_two_transformers_dyd.xml index 899cec446..458683e1a 100644 --- a/dynawaltz/src/test/resources/load_two_transformers_dyd.xml +++ b/dynawaltz/src/test/resources/load_two_transformers_dyd.xml @@ -4,15 +4,15 @@ - - - - + + + + - + diff --git a/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml b/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml index 6da4b5b9d..9032b16b6 100644 --- a/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml +++ b/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml @@ -4,17 +4,17 @@ - - - - - - + + + + + + - + diff --git a/dynawaltz/src/test/resources/node_fault_dyd.xml b/dynawaltz/src/test/resources/node_fault_dyd.xml index b789d91df..0ce4dd20c 100644 --- a/dynawaltz/src/test/resources/node_fault_dyd.xml +++ b/dynawaltz/src/test/resources/node_fault_dyd.xml @@ -2,7 +2,7 @@ - + - + diff --git a/dynawaltz/src/test/resources/omega_ref_dyd.xml b/dynawaltz/src/test/resources/omega_ref_dyd.xml index b1e5728f8..9691120f7 100644 --- a/dynawaltz/src/test/resources/omega_ref_dyd.xml +++ b/dynawaltz/src/test/resources/omega_ref_dyd.xml @@ -11,24 +11,24 @@ - - + + - - + + - - + + - - + + @@ -54,13 +54,13 @@ - - - + + + - + - + - + diff --git a/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml b/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml index ae1527cd9..d9ee0072b 100644 --- a/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml +++ b/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml @@ -9,12 +9,12 @@ - + - + - - + + diff --git a/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml b/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml index e13280f9b..42f45e864 100644 --- a/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml +++ b/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml @@ -13,7 +13,7 @@ - + @@ -25,6 +25,6 @@ - + diff --git a/dynawaltz/src/test/resources/svarc_dyd.xml b/dynawaltz/src/test/resources/svarc_dyd.xml index 36acc0b3e..a6da75648 100644 --- a/dynawaltz/src/test/resources/svarc_dyd.xml +++ b/dynawaltz/src/test/resources/svarc_dyd.xml @@ -4,7 +4,7 @@ - + @@ -12,5 +12,5 @@ - + diff --git a/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml b/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml index b8202377f..4e88a602d 100644 --- a/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml @@ -9,24 +9,24 @@ - + - + - - - - + + + + - - - - - - + + + + + + @@ -41,10 +41,10 @@ - + - + @@ -57,14 +57,14 @@ - - - - + + + + - - + + diff --git a/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml b/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml index 79a0d84a2..c43a426cf 100644 --- a/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml @@ -14,15 +14,15 @@ - - - + + + - - - - + + + + @@ -48,7 +48,7 @@ - + @@ -61,14 +61,14 @@ - - - + + + - + diff --git a/dynawaltz/src/test/resources/tap_changer_dyd.xml b/dynawaltz/src/test/resources/tap_changer_dyd.xml index f0780a439..7e61a3244 100644 --- a/dynawaltz/src/test/resources/tap_changer_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_dyd.xml @@ -13,15 +13,15 @@ - - - + + + - - - - + + + + @@ -48,9 +48,9 @@ - - - + + + diff --git a/dynawaltz/src/test/resources/tfr_dyd.xml b/dynawaltz/src/test/resources/tfr_dyd.xml index be6210e6b..c0ffdde1a 100644 --- a/dynawaltz/src/test/resources/tfr_dyd.xml +++ b/dynawaltz/src/test/resources/tfr_dyd.xml @@ -2,11 +2,11 @@ - + - + - - + + diff --git a/dynawaltz/src/test/resources/wecc_pv_dyd.xml b/dynawaltz/src/test/resources/wecc_pv_dyd.xml index 40cce1c0c..0826a37c2 100644 --- a/dynawaltz/src/test/resources/wecc_pv_dyd.xml +++ b/dynawaltz/src/test/resources/wecc_pv_dyd.xml @@ -5,21 +5,21 @@ - + - - + + - + - + diff --git a/dynawaltz/src/test/resources/wecc_wt_dyd.xml b/dynawaltz/src/test/resources/wecc_wt_dyd.xml index 782625d6c..f7f4481b0 100644 --- a/dynawaltz/src/test/resources/wecc_wt_dyd.xml +++ b/dynawaltz/src/test/resources/wecc_wt_dyd.xml @@ -4,12 +4,12 @@ - + - + diff --git a/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml b/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml index 3a6b98a9e..88cbd4fde 100644 --- a/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml +++ b/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml @@ -5,21 +5,21 @@ - + - - + + - + - + From a0c3154436001e18fe85e152b65bcc888d425259 Mon Sep 17 00:00:00 2001 From: lisrte Date: Mon, 3 Jul 2023 15:02:59 +0200 Subject: [PATCH 02/10] Replace OmegaRef with SetPoint when a StandardBus is found Signed-off-by: lisrte --- .../src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java index 57379d681..3500e13eb 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java @@ -10,8 +10,8 @@ import com.powsybl.dynamicsimulation.Curve; import com.powsybl.dynamicsimulation.DynamicSimulationParameters; import com.powsybl.dynawaltz.models.*; +import com.powsybl.dynawaltz.models.buses.AbstractBus; import com.powsybl.dynawaltz.models.buses.ConnectionPoint; -import com.powsybl.dynawaltz.models.buses.InfiniteBus; import com.powsybl.dynawaltz.models.buses.StaticDefaultBusModel; import com.powsybl.dynawaltz.models.defaultmodels.DefaultModelsHandler; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; @@ -62,7 +62,7 @@ public DynaWaltzContext(Network network, String workingVariantId, List new MacroStaticReference(k, bbm.getVarsMapping())); From 9619def267f09442858468f131a19fcb40f67b0e Mon Sep 17 00:00:00 2001 From: lisrte Date: Fri, 7 Jul 2023 17:08:06 +0200 Subject: [PATCH 03/10] Use MeasurementPoint instead of ConnectionPoint in NodeFaultEvent Signed-off-by: lisrte --- .../com/powsybl/dynawaltz/DynaWaltzContext.java | 4 ++-- .../dynawaltz/models/AbstractBlackBoxModel.java | 6 ------ ...ticDefaultBusModel.java => DefaultBusModel.java} | 13 ++++++++----- .../models/buses/DefaultMeasurementPoint.java | 5 +++++ .../dynawaltz/models/buses/MeasurementPoint.java | 2 ++ .../dynawaltz/models/events/NodeFaultEvent.java | 6 +++--- dynawaltz/src/test/resources/node_fault_dyd.xml | 6 +++--- 7 files changed, 23 insertions(+), 19 deletions(-) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{StaticDefaultBusModel.java => DefaultBusModel.java} (76%) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java index 3500e13eb..37bd8e10e 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java @@ -12,7 +12,7 @@ import com.powsybl.dynawaltz.models.*; import com.powsybl.dynawaltz.models.buses.AbstractBus; import com.powsybl.dynawaltz.models.buses.ConnectionPoint; -import com.powsybl.dynawaltz.models.buses.StaticDefaultBusModel; +import com.powsybl.dynawaltz.models.buses.DefaultBusModel; import com.powsybl.dynawaltz.models.defaultmodels.DefaultModelsHandler; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizerModel; @@ -139,7 +139,7 @@ public T getPureDynamicModel(String dynamicId, Class connec public ConnectionPoint getConnectionPointDynamicModel(String staticId) { BlackBoxModel bbm = staticIdBlackBoxModelMap.get(staticId); if (bbm == null) { - return StaticDefaultBusModel.getInstance(); + return DefaultBusModel.getInstance(); } if (bbm instanceof ConnectionPoint) { return (ConnectionPoint) bbm; diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java index 45fece986..33bbefd60 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java @@ -153,12 +153,6 @@ protected final void createMacroConnections(Identifiable eq context.addMacroConnect(macroConnectorId, fromAttributes, connectedModel.getMacroConnectToAttributes()); } - protected void createTerminalMacroConnections(Bus bus, Function> varConnectionsSupplier, DynaWaltzContext context) { - ConnectionPoint connectedModel = context.getConnectionPointDynamicModel(bus.getId()); - String macroConnectorId = context.addMacroConnector(getName(), connectedModel.getName(), varConnectionsSupplier.apply(connectedModel)); - context.addMacroConnect(macroConnectorId, getMacroConnectFromAttributes(), connectedModel.getMacroConnectToAttributes()); - } - protected void createTerminalMacroConnections(Injection equipment, Function> varConnectionsSupplier, DynaWaltzContext context) { ConnectionPoint connectedModel = context.getConnectionPointDynamicModel(BusUtils.getConnectableBusStaticId(equipment)); String macroConnectorId = context.addMacroConnector(getName(), connectedModel.getName(), varConnectionsSupplier.apply(connectedModel)); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StaticDefaultBusModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java similarity index 76% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StaticDefaultBusModel.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java index 4454d3f1e..ef24b0076 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/StaticDefaultBusModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java @@ -15,18 +15,21 @@ import java.util.Optional; /** + * Used for the connection between an equipment and a bus. + * Since the equipment static id (@STATIC_ID@ in varname) is the only information needed in order to create var connections, + * DefaultBusModel is implemented as a singleton * @author Laurent Issertial */ -public final class StaticDefaultBusModel implements ConnectionPoint { +public final class DefaultBusModel implements ConnectionPoint { - private static StaticDefaultBusModel INSTANCE; + private static DefaultBusModel INSTANCE; - private StaticDefaultBusModel() { + private DefaultBusModel() { } - public static StaticDefaultBusModel getInstance() { + public static DefaultBusModel getInstance() { if (INSTANCE == null) { - INSTANCE = new StaticDefaultBusModel(); + INSTANCE = new DefaultBusModel(); } return INSTANCE; } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java index c26554568..75462a4d4 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java @@ -26,6 +26,11 @@ public String getName() { return "DefaultMeasurementPoint"; } + @Override + public String getTerminalVarName() { + return "@NAME@_ACPIN"; + } + @Override public Optional getUImpinVarName() { return Optional.of("@NAME@_U"); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java index e8f077013..a4c989d5b 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java @@ -16,6 +16,8 @@ */ public interface MeasurementPoint extends Model { + String getTerminalVarName(); + Optional getUImpinVarName(); Optional getUpuImpinVarName(); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java index a0e3c2b62..51c783d65 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java @@ -9,7 +9,7 @@ import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.MeasurementPoint; import com.powsybl.dynawaltz.parameters.ParameterType; import com.powsybl.dynawaltz.xml.ParametersXml; import com.powsybl.iidm.network.Bus; @@ -45,10 +45,10 @@ public String getLib() { @Override public void createMacroConnections(DynaWaltzContext context) { - createTerminalMacroConnections((Bus) getEquipment(), this::getVarConnectionsWith, context); + createMacroConnections(getEquipment(), MeasurementPoint.class, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(ConnectionPoint connected) { + private List getVarConnectionsWith(MeasurementPoint connected) { return List.of(new VarConnection("fault_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/test/resources/node_fault_dyd.xml b/dynawaltz/src/test/resources/node_fault_dyd.xml index 0ce4dd20c..f836f0ab1 100644 --- a/dynawaltz/src/test/resources/node_fault_dyd.xml +++ b/dynawaltz/src/test/resources/node_fault_dyd.xml @@ -1,8 +1,8 @@ - - + + - + From 7b1a30bf1b29b25a42503e2e5b2a0c37fbb76c68 Mon Sep 17 00:00:00 2001 From: lisrte Date: Fri, 29 Sep 2023 13:54:37 +0200 Subject: [PATCH 04/10] Add javadoc Signed-off-by: lisrte --- .../com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java | 2 ++ .../com/powsybl/dynawaltz/models/buses/ConnectionPoint.java | 1 + .../com/powsybl/dynawaltz/models/buses/MeasurementPoint.java | 1 + 3 files changed, 4 insertions(+) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java index db9e4ee70..c910d642e 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java @@ -10,6 +10,8 @@ import com.powsybl.dynawaltz.models.Model; /** + * View of equipment from the bus to which it is connected + * Used by FrequencySynchronizer in order to get NummCC var name * @author Laurent Issertial */ public interface BusOfEquipmentModel extends Model { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java index 74f3223f3..ea9a567fb 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java @@ -13,6 +13,7 @@ import java.util.Optional; /** + * Interface use for buses by equipments for connection with the network * @author Laurent Issertial */ public interface ConnectionPoint extends Model { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java index a4c989d5b..4eff119c1 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java @@ -12,6 +12,7 @@ import java.util.Optional; /** + * Interface for buses used by automatons for measure * @author Laurent Issertial */ public interface MeasurementPoint extends Model { From 87c8a303dbbb7daa16aadf7686bda13803913e0a Mon Sep 17 00:00:00 2001 From: lisrte Date: Fri, 29 Sep 2023 16:37:36 +0200 Subject: [PATCH 05/10] Fix code smell Signed-off-by: lisrte --- .../powsybl/dynawaltz/models/buses/DefaultBusModel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java index ef24b0076..7872a3733 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusModel.java @@ -22,16 +22,16 @@ */ public final class DefaultBusModel implements ConnectionPoint { - private static DefaultBusModel INSTANCE; + private static DefaultBusModel instance; private DefaultBusModel() { } public static DefaultBusModel getInstance() { - if (INSTANCE == null) { - INSTANCE = new DefaultBusModel(); + if (instance == null) { + instance = new DefaultBusModel(); } - return INSTANCE; + return instance; } @Override From cbc7c6567e415d721f297c2437d7124940b48cb9 Mon Sep 17 00:00:00 2001 From: lisrte Date: Mon, 2 Oct 2023 13:57:28 +0200 Subject: [PATCH 06/10] Fix post merge main Signed-off-by: lisrte --- .../com/powsybl/dynawaltz/models/buses/DefaultBus.java | 2 +- .../dynawaltz/models/frequencysynchronizers/OmegaRef.java | 1 - .../src/test/resources/tap_changer_blocking_empty_dyd.xml | 8 ++++---- dynawaltz/src/test/resources/tap_changer_empty_dyd.xml | 6 +++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java index a644a2040..d58e68284 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java @@ -7,8 +7,8 @@ */ package com.powsybl.dynawaltz.models.buses; -import com.powsybl.dynawaltz.models.MacroConnectAttribute; import com.powsybl.dynawaltz.models.Side; +import com.powsybl.dynawaltz.models.macroconnections.MacroConnectAttribute; import com.powsybl.dynawaltz.xml.DynaWaltzXmlConstants; import java.util.List; diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java index ed4184c55..25004fc3e 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java @@ -15,7 +15,6 @@ import com.powsybl.dynawaltz.models.buses.DefaultBusOfEquipment; import com.powsybl.dynawaltz.parameters.ParametersSet; -import java.util.Collections; import java.util.List; import java.util.function.Consumer; diff --git a/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml b/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml index 265b326d9..e7d9f0d29 100644 --- a/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml @@ -4,14 +4,14 @@ - - - + + + - + diff --git a/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml b/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml index f8a5c52df..b792fb00d 100644 --- a/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml @@ -4,13 +4,13 @@ - - + + - + From 48976241ffdde8ba1630e87718c3437d22db0937 Mon Sep 17 00:00:00 2001 From: lisrte Date: Thu, 5 Oct 2023 09:54:30 +0200 Subject: [PATCH 07/10] Fix code smell Use 'eager initialized singleton' implementation for DefaultBus Signed-off-by: lisrte --- .../main/java/com/powsybl/dynawaltz/DynaWaltzContext.java | 4 ++-- .../com/powsybl/dynawaltz/models/buses/DefaultBus.java | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java index cd6020207..4261ef82d 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java @@ -173,8 +173,8 @@ public ConnectionPoint getConnectionPointDynamicModel(String staticId) { if (bbm == null) { return DefaultBus.getInstance(); } - if (bbm instanceof ConnectionPoint) { - return (ConnectionPoint) bbm; + if (bbm instanceof ConnectionPoint cp) { + return cp; } throw new PowsyblException(String.format(MODEL_ID_EXCEPTION, staticId, "ConnectionPoint")); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java index d58e68284..8ce339ce5 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java @@ -22,16 +22,13 @@ */ public final class DefaultBus implements ConnectionPoint { - private static DefaultBus instance; + private static final DefaultBus INSTANCE = new DefaultBus(); private DefaultBus() { } public static DefaultBus getInstance() { - if (instance == null) { - instance = new DefaultBus(); - } - return instance; + return INSTANCE; } @Override From bd0461caf5992b5cec9dbc1cf5b833436aec89fc Mon Sep 17 00:00:00 2001 From: lisrte Date: Fri, 13 Oct 2023 10:58:43 +0200 Subject: [PATCH 08/10] Renaming Signed-off-by: lisrte --- .../java/com/powsybl/dynawaltz/DynaWaltzContext.java | 6 +++--- .../dynawaltz/models/AbstractBlackBoxModel.java | 12 ++++++------ .../automatons/TapChangerBlockingAutomaton.java | 6 +++--- .../powsybl/dynawaltz/models/buses/AbstractBus.java | 2 +- ...surementPoint.java => ActionConnectionPoint.java} | 4 ++-- ...del.java => BusOfFrequencySynchronizedModel.java} | 4 ++-- ...tPoint.java => DefaultActionConnectionPoint.java} | 4 ++-- .../powsybl/dynawaltz/models/buses/DefaultBus.java | 2 +- ...t.java => DefaultBusOfFrequencySynchronized.java} | 4 ++-- ...ctionPoint.java => EquipmentConnectionPoint.java} | 2 +- .../models/defaultmodels/DefaultModelsHandler.java | 8 ++++---- .../dynawaltz/models/events/NodeFaultEvent.java | 6 +++--- .../models/frequencysynchronizers/OmegaRef.java | 8 ++++---- .../models/generators/AbstractGenerator.java | 4 ++-- .../models/generators/GridFormingConverter.java | 4 ++-- .../powsybl/dynawaltz/models/generators/WeccGen.java | 4 ++-- .../powsybl/dynawaltz/models/hvdc/AbstractHvdc.java | 6 +++--- .../powsybl/dynawaltz/models/hvdc/DanglingSide.java | 8 ++++---- .../powsybl/dynawaltz/models/lines/StandardLine.java | 4 ++-- .../powsybl/dynawaltz/models/loads/AbstractLoad.java | 4 ++-- .../com/powsybl/dynawaltz/models/loads/BaseLoad.java | 4 ++-- .../dynawaltz/models/loads/LoadOneTransformer.java | 4 ++-- .../models/loads/LoadOneTransformerTapChanger.java | 4 ++-- .../dynawaltz/models/loads/LoadTwoTransformers.java | 4 ++-- .../models/loads/LoadTwoTransformersTapChangers.java | 4 ++-- .../models/svarcs/StaticVarCompensator.java | 4 ++-- .../models/transformers/TransformerFixedRatio.java | 4 ++-- 27 files changed, 65 insertions(+), 65 deletions(-) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{MeasurementPoint.java => ActionConnectionPoint.java} (81%) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{BusOfEquipmentModel.java => BusOfFrequencySynchronizedModel.java} (79%) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{DefaultMeasurementPoint.java => DefaultActionConnectionPoint.java} (86%) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{DefaultBusOfEquipment.java => DefaultBusOfFrequencySynchronized.java} (63%) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{ConnectionPoint.java => EquipmentConnectionPoint.java} (94%) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java index 4261ef82d..6427bf928 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java @@ -11,7 +11,7 @@ import com.powsybl.dynamicsimulation.DynamicSimulationParameters; import com.powsybl.dynawaltz.models.*; import com.powsybl.dynawaltz.models.buses.AbstractBus; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.buses.DefaultBus; import com.powsybl.dynawaltz.models.defaultmodels.DefaultModelsHandler; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; @@ -168,12 +168,12 @@ public T getPureDynamicModel(String dynamicId, Class connec } } - public ConnectionPoint getConnectionPointDynamicModel(String staticId) { + public EquipmentConnectionPoint getConnectionPointDynamicModel(String staticId) { BlackBoxModel bbm = staticIdBlackBoxModelMap.get(staticId); if (bbm == null) { return DefaultBus.getInstance(); } - if (bbm instanceof ConnectionPoint cp) { + if (bbm instanceof EquipmentConnectionPoint cp) { return cp; } throw new PowsyblException(String.format(MODEL_ID_EXCEPTION, staticId, "ConnectionPoint")); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java index be2f9f5d2..c5a62731c 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/AbstractBlackBoxModel.java @@ -12,7 +12,7 @@ import com.powsybl.dynawaltz.models.macroconnections.MacroConnectionSuffix; import com.powsybl.dynawaltz.parameters.ParametersSet; import com.powsybl.iidm.network.Identifiable; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.utils.BusUtils; import com.powsybl.dynawaltz.models.utils.SideConverter; import com.powsybl.iidm.network.*; @@ -176,19 +176,19 @@ protected final void createMacroConnections(Identifiable eq context.addMacroConnect(macroConnectorId, fromAttributes, connectedModel.getMacroConnectToAttributes()); } - protected void createTerminalMacroConnections(Injection equipment, Function> varConnectionsSupplier, DynaWaltzContext context) { - ConnectionPoint connectedModel = context.getConnectionPointDynamicModel(BusUtils.getConnectableBusStaticId(equipment)); + protected void createTerminalMacroConnections(Injection equipment, Function> varConnectionsSupplier, DynaWaltzContext context) { + EquipmentConnectionPoint connectedModel = context.getConnectionPointDynamicModel(BusUtils.getConnectableBusStaticId(equipment)); String macroConnectorId = context.addMacroConnector(getName(), connectedModel.getName(), varConnectionsSupplier.apply(connectedModel)); context.addMacroConnect(macroConnectorId, getMacroConnectFromAttributes(), connectedModel.getMacroConnectToAttributes()); } - protected final void createTerminalMacroConnections(Terminal terminal, BiFunction> varConnectionsSupplier, DynaWaltzContext context, Side side) { - ConnectionPoint connectedModel = context.getConnectionPointDynamicModel(BusUtils.getConnectableBusStaticId(terminal)); + protected final void createTerminalMacroConnections(Terminal terminal, BiFunction> varConnectionsSupplier, DynaWaltzContext context, Side side) { + EquipmentConnectionPoint connectedModel = context.getConnectionPointDynamicModel(BusUtils.getConnectableBusStaticId(terminal)); String macroConnectorId = context.addMacroConnector(getName(), connectedModel.getName(), side, varConnectionsSupplier.apply(connectedModel, side)); context.addMacroConnect(macroConnectorId, getMacroConnectFromAttributes(), connectedModel.getMacroConnectToAttributes()); } - protected final void createTerminalMacroConnections(HvdcLine hvdc, BiFunction> varConnectionsSupplier, DynaWaltzContext context, Side side) { + protected final void createTerminalMacroConnections(HvdcLine hvdc, BiFunction> varConnectionsSupplier, DynaWaltzContext context, Side side) { HvdcConverterStation station = hvdc.getConverterStation(SideConverter.convert(side)); createTerminalMacroConnections(station.getTerminal(), varConnectionsSupplier, context, side); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java index 31de677df..ee1a9a9e0 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/automatons/TapChangerBlockingAutomaton.java @@ -12,7 +12,7 @@ import com.powsybl.dynawaltz.models.AbstractPureDynamicBlackBoxModel; import com.powsybl.dynawaltz.models.MeasurementPointSuffix; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.MeasurementPoint; +import com.powsybl.dynawaltz.models.buses.ActionConnectionPoint; import com.powsybl.dynawaltz.models.transformers.TapChangerModel; import com.powsybl.iidm.network.Bus; import com.powsybl.iidm.network.IdentifiableType; @@ -99,7 +99,7 @@ public void createMacroConnections(DynaWaltzContext context) { if (!transformers.isEmpty() || skippedTapChangers < (loadsWithTransformer.size() + tapChangerAutomatonIds.size())) { int i = 1; for (Bus bus : uMeasurements) { - createMacroConnections(bus, MeasurementPoint.class, this::getVarConnectionsWith, context, MeasurementPointSuffix.of(i)); + createMacroConnections(bus, ActionConnectionPoint.class, this::getVarConnectionsWith, context, MeasurementPointSuffix.of(i)); i++; } } else { @@ -112,7 +112,7 @@ private List getVarConnectionsWith(TapChangerModel connected) { return connected.getTapChangerBlockerVarConnections(); } - private List getVarConnectionsWith(MeasurementPoint connected, String suffix) { + private List getVarConnectionsWith(ActionConnectionPoint connected, String suffix) { return connected.getUImpinVarName() .map(uImpinVarName -> List.of(new VarConnection("tapChangerBlocking_UMonitored" + suffix, uImpinVarName))) .orElse(Collections.emptyList()); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java index 08dd3e744..1f56d21d6 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/AbstractBus.java @@ -20,7 +20,7 @@ /** * @author Laurent Issertial */ -public abstract class AbstractBus extends AbstractEquipmentBlackBoxModel implements ConnectionPoint, MeasurementPoint { +public abstract class AbstractBus extends AbstractEquipmentBlackBoxModel implements EquipmentConnectionPoint, ActionConnectionPoint { protected AbstractBus(String dynamicModelId, Bus bus, String parameterSetId, String lib) { super(dynamicModelId, parameterSetId, bus, lib); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ActionConnectionPoint.java similarity index 81% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ActionConnectionPoint.java index 4eff119c1..9dadb83bc 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/MeasurementPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ActionConnectionPoint.java @@ -12,10 +12,10 @@ import java.util.Optional; /** - * Interface for buses used by automatons for measure + * Interface for buses used by automatons for measure or event for various actions * @author Laurent Issertial */ -public interface MeasurementPoint extends Model { +public interface ActionConnectionPoint extends Model { String getTerminalVarName(); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfFrequencySynchronizedModel.java similarity index 79% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfFrequencySynchronizedModel.java index c910d642e..ffcc73c58 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfEquipmentModel.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/BusOfFrequencySynchronizedModel.java @@ -10,11 +10,11 @@ import com.powsybl.dynawaltz.models.Model; /** - * View of equipment from the bus to which it is connected + * View of frequency synchronized equipment from the bus to which it is connected * Used by FrequencySynchronizer in order to get NummCC var name * @author Laurent Issertial */ -public interface BusOfEquipmentModel extends Model { +public interface BusOfFrequencySynchronizedModel extends Model { String getNumCCVarName(); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java similarity index 86% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java index 75462a4d4..af0933632 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultMeasurementPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java @@ -15,9 +15,9 @@ * @author Laurent Issertial * @author Florian Dupuy */ -public class DefaultMeasurementPoint extends AbstractDefaultModel implements MeasurementPoint { +public class DefaultActionConnectionPoint extends AbstractDefaultModel implements ActionConnectionPoint { - public DefaultMeasurementPoint(String staticId) { + public DefaultActionConnectionPoint(String staticId) { super(staticId); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java index 8ce339ce5..dec599942 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java @@ -20,7 +20,7 @@ * DefaultBusModel is implemented as a singleton * @author Laurent Issertial */ -public final class DefaultBus implements ConnectionPoint { +public final class DefaultBus implements EquipmentConnectionPoint { private static final DefaultBus INSTANCE = new DefaultBus(); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfEquipment.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfFrequencySynchronized.java similarity index 63% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfEquipment.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfFrequencySynchronized.java index ae8ab42c5..ed59655c8 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfEquipment.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBusOfFrequencySynchronized.java @@ -2,9 +2,9 @@ import com.powsybl.dynawaltz.models.defaultmodels.AbstractDefaultModel; -public class DefaultBusOfEquipment extends AbstractDefaultModel implements BusOfEquipmentModel { +public class DefaultBusOfFrequencySynchronized extends AbstractDefaultModel implements BusOfFrequencySynchronizedModel { - public DefaultBusOfEquipment(String staticId) { + public DefaultBusOfFrequencySynchronized(String staticId) { super(staticId); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/EquipmentConnectionPoint.java similarity index 94% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/EquipmentConnectionPoint.java index ea9a567fb..4ef77177c 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/ConnectionPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/EquipmentConnectionPoint.java @@ -16,7 +16,7 @@ * Interface use for buses by equipments for connection with the network * @author Laurent Issertial */ -public interface ConnectionPoint extends Model { +public interface EquipmentConnectionPoint extends Model { String getTerminalVarName(); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java index b2e71f857..86a60025d 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java @@ -8,8 +8,8 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.models.Model; -import com.powsybl.dynawaltz.models.buses.DefaultMeasurementPoint; -import com.powsybl.dynawaltz.models.buses.MeasurementPoint; +import com.powsybl.dynawaltz.models.buses.DefaultActionConnectionPoint; +import com.powsybl.dynawaltz.models.buses.ActionConnectionPoint; import com.powsybl.dynawaltz.models.generators.GeneratorModel; import com.powsybl.dynawaltz.models.generators.DefaultGenerator; import com.powsybl.dynawaltz.models.hvdc.DefaultHvdc; @@ -44,7 +44,7 @@ public class DefaultModelsHandler { private final Map, DefaultModelFactory> factoryMap; public DefaultModelsHandler() { - factoryMap = Map.of(MeasurementPoint.class, new DefaultModelFactory(DefaultMeasurementPoint::new), + factoryMap = Map.of(ActionConnectionPoint.class, new DefaultModelFactory(DefaultActionConnectionPoint::new), GeneratorModel.class, new DefaultModelFactory(DefaultGenerator::new), HvdcModel.class, new DefaultModelFactory(DefaultHvdc::new), LineModel.class, new DefaultModelFactory(DefaultLine::new), @@ -53,7 +53,7 @@ public DefaultModelsHandler() { StaticVarCompensatorModel.class, new DefaultModelFactory(DefaultStaticVarCompensator::new), TransformerModel.class, new DefaultModelFactory(DefaultTransformer::new)); - powSyBlTypeToModel.put(IdentifiableType.BUS, MeasurementPoint.class); + powSyBlTypeToModel.put(IdentifiableType.BUS, ActionConnectionPoint.class); powSyBlTypeToModel.put(IdentifiableType.GENERATOR, GeneratorModel.class); powSyBlTypeToModel.put(IdentifiableType.HVDC_LINE, HvdcModel.class); powSyBlTypeToModel.put(IdentifiableType.LINE, LineModel.class); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java index b58737a69..8f4226486 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/events/NodeFaultEvent.java @@ -9,7 +9,7 @@ import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.MeasurementPoint; +import com.powsybl.dynawaltz.models.buses.ActionConnectionPoint; import com.powsybl.dynawaltz.parameters.ParametersSet; import com.powsybl.iidm.network.Bus; @@ -43,10 +43,10 @@ public String getLib() { @Override public void createMacroConnections(DynaWaltzContext context) { - createMacroConnections(getEquipment(), MeasurementPoint.class, this::getVarConnectionsWith, context); + createMacroConnections(getEquipment(), ActionConnectionPoint.class, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(MeasurementPoint connected) { + private List getVarConnectionsWith(ActionConnectionPoint connected) { return List.of(new VarConnection("fault_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java index 25004fc3e..feeee4350 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java @@ -11,8 +11,8 @@ import com.powsybl.dynawaltz.DynaWaltzParameters; import com.powsybl.dynawaltz.models.macroconnections.MacroConnectAttribute; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.BusOfEquipmentModel; -import com.powsybl.dynawaltz.models.buses.DefaultBusOfEquipment; +import com.powsybl.dynawaltz.models.buses.BusOfFrequencySynchronizedModel; +import com.powsybl.dynawaltz.models.buses.DefaultBusOfFrequencySynchronized; import com.powsybl.dynawaltz.parameters.ParametersSet; import java.util.List; @@ -61,7 +61,7 @@ private List getVarConnectionsWith(FrequencySynchronizedModel con return connected.getOmegaRefVarConnections(); } - private List getVarConnectionsWith(BusOfEquipmentModel connected) { + private List getVarConnectionsWith(BusOfFrequencySynchronizedModel connected) { return List.of(new VarConnection("numcc_node_@INDEX@", connected.getNumCCVarName())); } @@ -70,7 +70,7 @@ public void createMacroConnections(DynaWaltzContext context) throws PowsyblExcep int index = 0; for (FrequencySynchronizedModel eq : synchronizedEquipments) { createMacroConnections(eq, getVarConnectionsWith(eq), context, MacroConnectAttribute.ofIndex1(index)); - BusOfEquipmentModel busOf = new DefaultBusOfEquipment(eq.getStaticId()); + BusOfFrequencySynchronizedModel busOf = new DefaultBusOfFrequencySynchronized(eq.getStaticId()); createMacroConnections(busOf, getVarConnectionsWith(busOf), context, MacroConnectAttribute.ofIndex1(index)); index++; } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGenerator.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGenerator.java index fc6b615d8..52e4205ef 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGenerator.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/AbstractGenerator.java @@ -10,7 +10,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Generator; import java.util.ArrayList; @@ -42,7 +42,7 @@ public void createMacroConnections(DynaWaltzContext context) { createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(ConnectionPoint connected) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = new ArrayList<>(2); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java index cac359c27..833007b69 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/GridFormingConverter.java @@ -12,7 +12,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; import com.powsybl.iidm.network.Generator; @@ -38,7 +38,7 @@ public void createMacroConnections(DynaWaltzContext context) { createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(ConnectionPoint connected) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected) { return List.of(new VarConnection("converter_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java index 3dc864fad..07365edba 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/generators/WeccGen.java @@ -11,7 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Generator; import java.util.List; @@ -39,7 +39,7 @@ public void createMacroConnections(DynaWaltzContext context) { createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(ConnectionPoint connected) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected) { return List.of(new VarConnection(weccPrefix + "_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java index 9d32fd529..8f83acc66 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/AbstractHvdc.java @@ -12,7 +12,7 @@ import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.HvdcLine; import java.util.ArrayList; @@ -49,7 +49,7 @@ public List getVarsMapping() { return VAR_MAPPING; } - protected List getVarConnectionsWith(ConnectionPoint connected, Side side) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected, Side side) { List varConnections = new ArrayList<>(2); varConnections.add(getSimpleVarConnectionWithBus(connected, side)); connected.getSwitchOffSignalVarName(side) @@ -58,7 +58,7 @@ protected List getVarConnectionsWith(ConnectionPoint connected, S return varConnections; } - protected final VarConnection getSimpleVarConnectionWithBus(ConnectionPoint connected, Side side) { + protected final VarConnection getSimpleVarConnectionWithBus(EquipmentConnectionPoint connected, Side side) { return new VarConnection(TERMINAL_PREFIX + side.getSideNumber(), connected.getTerminalVarName(side)); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java index 06fa9ab22..86d93f717 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/hvdc/DanglingSide.java @@ -2,7 +2,7 @@ import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import java.util.List; import java.util.Objects; @@ -27,13 +27,13 @@ public int getSideNumber() { return side.getSideNumber(); } - public void createMacroConnections(BiFunction> basicVarConnectionsSupplier, - BiConsumer>, Side> connectionCreator) { + public void createMacroConnections(BiFunction> basicVarConnectionsSupplier, + BiConsumer>, Side> connectionCreator) { connectionCreator.accept(this::getVarConnectionsWith, side); connectionCreator.accept(basicVarConnectionsSupplier, side.getOppositeSide()); } - private List getVarConnectionsWith(ConnectionPoint connected, Side side) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected, Side side) { return List.of(new VarConnection(prefix + side.getSideNumber(), connected.getTerminalVarName(side))); } } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java index 0dffc2ac7..47d6d09de 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/lines/StandardLine.java @@ -11,7 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.utils.SideConverter; import com.powsybl.iidm.network.Line; @@ -26,7 +26,7 @@ public StandardLine(String dynamicModelId, Line line, String parameterSetId) { super(dynamicModelId, parameterSetId, line, "Line"); } - private List getVarConnectionsWith(ConnectionPoint connected, Side side) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected, Side side) { return List.of(new VarConnection(getTerminalVarName(side), connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java index cee383f35..68b157657 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/AbstractLoad.java @@ -9,7 +9,7 @@ import com.powsybl.dynawaltz.DynaWaltzContext; import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.List; @@ -36,7 +36,7 @@ public void createMacroConnections(DynaWaltzContext context) { createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - abstract List getVarConnectionsWith(ConnectionPoint connected); + abstract List getVarConnectionsWith(EquipmentConnectionPoint connected); @Override public String getSwitchOffSignalEventVarName() { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoad.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoad.java index 9741d6ce9..962a89196 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoad.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/BaseLoad.java @@ -8,7 +8,7 @@ import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.ArrayList; @@ -35,7 +35,7 @@ public List getVarsMapping() { } @Override - protected List getVarConnectionsWith(ConnectionPoint connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = new ArrayList<>(2); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java index 3925602c3..fff652f41 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformer.java @@ -10,7 +10,7 @@ import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.ArrayList; @@ -44,7 +44,7 @@ public List getVarsMapping() { } @Override - protected List getVarConnectionsWith(ConnectionPoint connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = new ArrayList<>(3); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java index 46b723f9f..6b55ee0c7 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadOneTransformerTapChanger.java @@ -10,7 +10,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.transformers.TapChangerModel; import com.powsybl.iidm.network.Load; @@ -28,7 +28,7 @@ public LoadOneTransformerTapChanger(String dynamicModelId, Load load, String par } @Override - protected List getVarConnectionsWith(ConnectionPoint connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = super.getVarConnectionsWith(connected); connected.getSwitchOffSignalVarName() .map(switchOff -> new VarConnection("tapChanger_switchOffSignal1", switchOff)) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java index 40d1c73d9..bf581f1e5 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformers.java @@ -11,7 +11,7 @@ import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.iidm.network.Load; import java.util.ArrayList; @@ -40,7 +40,7 @@ protected LoadTwoTransformers(String dynamicModelId, Load load, String parameter } @Override - protected List getVarConnectionsWith(ConnectionPoint connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = new ArrayList<>(3); varConnections.add(new VarConnection(getTerminalVarName(), connected.getTerminalVarName())); connected.getSwitchOffSignalVarName() diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java index 40d1a6c4a..991b314ef 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/loads/LoadTwoTransformersTapChangers.java @@ -10,7 +10,7 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.dynawaltz.models.TransformerSide; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.transformers.TapChangerModel; import com.powsybl.iidm.network.Load; @@ -29,7 +29,7 @@ public LoadTwoTransformersTapChangers(String dynamicModelId, Load load, String p } @Override - protected List getVarConnectionsWith(ConnectionPoint connected) { + protected List getVarConnectionsWith(EquipmentConnectionPoint connected) { List varConnections = super.getVarConnectionsWith(connected); connected.getSwitchOffSignalVarName() .ifPresent(switchOff -> { diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java index 40d84d5fe..ecfcebe86 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/svarcs/StaticVarCompensator.java @@ -11,7 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.VarConnection; import com.powsybl.dynawaltz.models.VarMapping; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import java.util.Arrays; import java.util.List; @@ -36,7 +36,7 @@ public void createMacroConnections(DynaWaltzContext context) { createTerminalMacroConnections(equipment, this::getVarConnectionsWith, context); } - private List getVarConnectionsWith(ConnectionPoint connected) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected) { return List.of(new VarConnection("SVarC_terminal", connected.getTerminalVarName())); } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java index 31debb09d..d2c2d44b9 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/transformers/TransformerFixedRatio.java @@ -11,7 +11,7 @@ import com.powsybl.dynawaltz.models.AbstractEquipmentBlackBoxModel; import com.powsybl.dynawaltz.models.Side; import com.powsybl.dynawaltz.models.VarConnection; -import com.powsybl.dynawaltz.models.buses.ConnectionPoint; +import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; import com.powsybl.dynawaltz.models.utils.SideConverter; import com.powsybl.iidm.network.TwoWindingsTransformer; @@ -28,7 +28,7 @@ public TransformerFixedRatio(String dynamicModelId, TwoWindingsTransformer trans super(dynamicModelId, parameterSetId, transformer, lib); } - private List getVarConnectionsWith(ConnectionPoint connected, Side side) { + private List getVarConnectionsWith(EquipmentConnectionPoint connected, Side side) { return List.of(new VarConnection(getTerminalVarName(side), connected.getTerminalVarName())); } From 918f7889a518284b45b4f54e16dba87731f1eb24 Mon Sep 17 00:00:00 2001 From: lisrte Date: Wed, 18 Oct 2023 10:17:25 +0200 Subject: [PATCH 09/10] Fix code review Signed-off-by: lisrte --- .../main/java/com/powsybl/dynawaltz/DynaWaltzContext.java | 4 ++-- ...faultBus.java => DefaultEquipmentConnectionPoint.java} | 8 ++++---- .../models/defaultmodels/DefaultModelsHandler.java | 2 ++ .../dynawaltz/models/frequencysynchronizers/OmegaRef.java | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) rename dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/{DefaultBus.java => DefaultEquipmentConnectionPoint.java} (84%) diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java index a644f98d9..608d940ee 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/DynaWaltzContext.java @@ -12,7 +12,7 @@ import com.powsybl.dynawaltz.models.*; import com.powsybl.dynawaltz.models.buses.AbstractBus; import com.powsybl.dynawaltz.models.buses.EquipmentConnectionPoint; -import com.powsybl.dynawaltz.models.buses.DefaultBus; +import com.powsybl.dynawaltz.models.buses.DefaultEquipmentConnectionPoint; import com.powsybl.dynawaltz.models.defaultmodels.DefaultModelsHandler; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizedModel; import com.powsybl.dynawaltz.models.frequencysynchronizers.FrequencySynchronizerModel; @@ -176,7 +176,7 @@ public T getPureDynamicModel(String dynamicId, Class connec public EquipmentConnectionPoint getConnectionPointDynamicModel(String staticId) { BlackBoxModel bbm = staticIdBlackBoxModelMap.get(staticId); if (bbm == null) { - return DefaultBus.getInstance(); + return DefaultEquipmentConnectionPoint.getInstance(); } if (bbm instanceof EquipmentConnectionPoint cp) { return cp; diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java similarity index 84% rename from dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java rename to dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java index dec599942..1cd4ecd2f 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultBus.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java @@ -20,14 +20,14 @@ * DefaultBusModel is implemented as a singleton * @author Laurent Issertial */ -public final class DefaultBus implements EquipmentConnectionPoint { +public final class DefaultEquipmentConnectionPoint implements EquipmentConnectionPoint { - private static final DefaultBus INSTANCE = new DefaultBus(); + private static final DefaultEquipmentConnectionPoint INSTANCE = new DefaultEquipmentConnectionPoint(); - private DefaultBus() { + private DefaultEquipmentConnectionPoint() { } - public static DefaultBus getInstance() { + public static DefaultEquipmentConnectionPoint getInstance() { return INSTANCE; } diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java index 86a60025d..442178885 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/defaultmodels/DefaultModelsHandler.java @@ -53,6 +53,8 @@ public DefaultModelsHandler() { StaticVarCompensatorModel.class, new DefaultModelFactory(DefaultStaticVarCompensator::new), TransformerModel.class, new DefaultModelFactory(DefaultTransformer::new)); + // When using the bus equipment DefaultModelsHandler will always instantiate the DefaultActionConnectionPoint default model, + // for EquipmentConnectionPoint the DefaultBus singleton will be accessed via DynaWaltzContext::getConnectionPointDynamicModel powSyBlTypeToModel.put(IdentifiableType.BUS, ActionConnectionPoint.class); powSyBlTypeToModel.put(IdentifiableType.GENERATOR, GeneratorModel.class); powSyBlTypeToModel.put(IdentifiableType.HVDC_LINE, HvdcModel.class); diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java index feeee4350..8eb2d0b57 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/frequencysynchronizers/OmegaRef.java @@ -70,6 +70,7 @@ public void createMacroConnections(DynaWaltzContext context) throws PowsyblExcep int index = 0; for (FrequencySynchronizedModel eq : synchronizedEquipments) { createMacroConnections(eq, getVarConnectionsWith(eq), context, MacroConnectAttribute.ofIndex1(index)); + // If a bus with a dynamic model is found SetPoint is used in place of OmegaRef, thus at this point we don't have to handle dynamic model buses BusOfFrequencySynchronizedModel busOf = new DefaultBusOfFrequencySynchronized(eq.getStaticId()); createMacroConnections(busOf, getVarConnectionsWith(busOf), context, MacroConnectAttribute.ofIndex1(index)); index++; From cbd307de2a52960c5cbc2140ddcee555f4eccb80 Mon Sep 17 00:00:00 2001 From: lisrte Date: Wed, 18 Oct 2023 11:18:46 +0200 Subject: [PATCH 10/10] Rename DefaultActionConnectionPoint and DefaultEquipmentConnectionPoint getName method Signed-off-by: lisrte --- .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 38 ++++++++-------- .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 38 ++++++++-------- .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 38 ++++++++-------- .../dynawaltz-inputs/powsybl_dynawaltz.dyd | 16 +++---- .../buses/DefaultActionConnectionPoint.java | 2 +- .../DefaultEquipmentConnectionPoint.java | 2 +- dynawaltz/src/test/resources/apv_dyd.xml | 12 ++--- dynawaltz/src/test/resources/cla_dyd.xml | 8 ++-- .../src/test/resources/disconnect_dyd.xml | 4 +- .../disconnect_hvdc_pv_dangling_dyd.xml | 8 ++-- .../test/resources/disconnect_hvdc_pv_dyd.xml | 8 ++-- .../disconnect_hvdc_vsc_dangling_dyd.xml | 8 ++-- .../resources/disconnect_hvdc_vsc_dyd.xml | 8 ++-- dynawaltz/src/test/resources/dyd.xml | 44 +++++++++---------- .../src/test/resources/dyd_fictitious.xml | 4 +- dynawaltz/src/test/resources/events.xml | 4 +- .../resources/grid_forming_converter_dyd.xml | 4 +- .../test/resources/hvdc_p_dangling_dyd.xml | 8 ++-- dynawaltz/src/test/resources/hvdc_p_dyd.xml | 8 ++-- .../test/resources/hvdc_vsc_dangling_dyd.xml | 8 ++-- dynawaltz/src/test/resources/hvdc_vsc_dyd.xml | 8 ++-- .../test/resources/load_alpha_beta_dyd.xml | 4 +- .../resources/load_one_transformer_dyd.xml | 4 +- .../load_one_transformer_tap_changer_dyd.xml | 4 +- .../resources/load_two_transformers_dyd.xml | 4 +- ...load_two_transformers_tap_changers_dyd.xml | 4 +- .../src/test/resources/node_fault_dyd.xml | 4 +- .../src/test/resources/omega_ref_dyd.xml | 12 ++--- .../test/resources/phase_shifter_i_dyd.xml | 8 ++-- .../test/resources/set_point_inf_bus_dyd.xml | 4 +- dynawaltz/src/test/resources/svarc_dyd.xml | 4 +- .../resources/tap_changer_blocking_dyd.xml | 24 +++++----- .../tap_changer_blocking_empty_dyd.xml | 4 +- .../tap_changer_blocking_tap_changer_dyd.xml | 14 +++--- .../src/test/resources/tap_changer_dyd.xml | 10 ++--- .../test/resources/tap_changer_empty_dyd.xml | 4 +- dynawaltz/src/test/resources/tfr_dyd.xml | 8 ++-- dynawaltz/src/test/resources/wecc_pv_dyd.xml | 4 +- dynawaltz/src/test/resources/wecc_wt_dyd.xml | 4 +- .../test/resources/wecc_wt_synchro_dyd.xml | 4 +- 40 files changed, 203 insertions(+), 203 deletions(-) diff --git a/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd index 9f9176a91..31f7aa04c 100644 --- a/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee14-currentlimitautomaton/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -52,15 +52,15 @@ - + - + - + @@ -102,22 +102,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd index 42694b0c7..5ec4dc0b3 100644 --- a/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee14-disconnectline/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -50,15 +50,15 @@ - + - + - + @@ -93,22 +93,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd index c693f387b..c7d4d570f 100644 --- a/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee14-macroconnects/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -49,15 +49,15 @@ - + - + - + @@ -89,22 +89,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd b/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd index bc09cdf24..e8dcc5bb7 100644 --- a/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd +++ b/dynawaltz-dsl/src/test/resources/ieee57-disconnectgenerator/dynawaltz-inputs/powsybl_dynawaltz.dyd @@ -23,7 +23,7 @@ - + @@ -43,13 +43,13 @@ - - - - - - - + + + + + + + diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java index af0933632..fa5ef173d 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultActionConnectionPoint.java @@ -23,7 +23,7 @@ public DefaultActionConnectionPoint(String staticId) { @Override public String getName() { - return "DefaultMeasurementPoint"; + return "DefaultActionConnectionPoint"; } @Override diff --git a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java index 1cd4ecd2f..1da6f4c9c 100644 --- a/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java +++ b/dynawaltz/src/main/java/com/powsybl/dynawaltz/models/buses/DefaultEquipmentConnectionPoint.java @@ -33,7 +33,7 @@ public static DefaultEquipmentConnectionPoint getInstance() { @Override public String getName() { - return "DefaultBus"; + return "DefaultEquipmentConnectionPoint"; } @Override diff --git a/dynawaltz/src/test/resources/apv_dyd.xml b/dynawaltz/src/test/resources/apv_dyd.xml index 05909df85..5604eff39 100644 --- a/dynawaltz/src/test/resources/apv_dyd.xml +++ b/dynawaltz/src/test/resources/apv_dyd.xml @@ -15,15 +15,15 @@ - + - + - + @@ -69,9 +69,9 @@ - - - + + + diff --git a/dynawaltz/src/test/resources/cla_dyd.xml b/dynawaltz/src/test/resources/cla_dyd.xml index 4a3ac6cfb..2024bff15 100644 --- a/dynawaltz/src/test/resources/cla_dyd.xml +++ b/dynawaltz/src/test/resources/cla_dyd.xml @@ -18,10 +18,10 @@ - + - + @@ -32,8 +32,8 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_dyd.xml b/dynawaltz/src/test/resources/disconnect_dyd.xml index 7ecf49327..5daadbbf6 100644 --- a/dynawaltz/src/test/resources/disconnect_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_dyd.xml @@ -7,7 +7,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml index 6c31a9cd2..62194fbec 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dangling_dyd.xml @@ -4,10 +4,10 @@ - + - + @@ -22,7 +22,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml index 7d29bb935..62fd89a2f 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_pv_dyd.xml @@ -4,11 +4,11 @@ - + - + @@ -23,7 +23,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml index bbbd3662d..54440fb29 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dangling_dyd.xml @@ -4,10 +4,10 @@ - + - + @@ -22,7 +22,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml index 5588f40ba..28aaf84a3 100644 --- a/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml +++ b/dynawaltz/src/test/resources/disconnect_hvdc_vsc_dyd.xml @@ -4,11 +4,11 @@ - + - + @@ -23,7 +23,7 @@ - - + + diff --git a/dynawaltz/src/test/resources/dyd.xml b/dynawaltz/src/test/resources/dyd.xml index 4bcba9f39..7ba5ddea3 100644 --- a/dynawaltz/src/test/resources/dyd.xml +++ b/dynawaltz/src/test/resources/dyd.xml @@ -33,43 +33,43 @@ - + - + - + - + - + - + - + - + - + - + @@ -146,18 +146,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/dynawaltz/src/test/resources/dyd_fictitious.xml b/dynawaltz/src/test/resources/dyd_fictitious.xml index e4966f9c9..2a84f989a 100644 --- a/dynawaltz/src/test/resources/dyd_fictitious.xml +++ b/dynawaltz/src/test/resources/dyd_fictitious.xml @@ -3,7 +3,7 @@ - + @@ -12,5 +12,5 @@ - + diff --git a/dynawaltz/src/test/resources/events.xml b/dynawaltz/src/test/resources/events.xml index fd0335d1a..4dacda7de 100644 --- a/dynawaltz/src/test/resources/events.xml +++ b/dynawaltz/src/test/resources/events.xml @@ -7,7 +7,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml b/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml index 79112579f..730a02372 100644 --- a/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml +++ b/dynawaltz/src/test/resources/grid_forming_converter_dyd.xml @@ -4,7 +4,7 @@ - + @@ -20,7 +20,7 @@ - + diff --git a/dynawaltz/src/test/resources/hvdc_p_dangling_dyd.xml b/dynawaltz/src/test/resources/hvdc_p_dangling_dyd.xml index d01f4cbf5..339f38446 100644 --- a/dynawaltz/src/test/resources/hvdc_p_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_p_dangling_dyd.xml @@ -3,10 +3,10 @@ - + - + @@ -18,6 +18,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/hvdc_p_dyd.xml b/dynawaltz/src/test/resources/hvdc_p_dyd.xml index 0e91ee88c..ade52c952 100644 --- a/dynawaltz/src/test/resources/hvdc_p_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_p_dyd.xml @@ -3,11 +3,11 @@ - + - + @@ -19,6 +19,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml b/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml index 8d438c6ef..4942f42eb 100644 --- a/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_vsc_dangling_dyd.xml @@ -3,10 +3,10 @@ - + - + @@ -18,6 +18,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml b/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml index 1a17573ca..9b4b144cb 100644 --- a/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml +++ b/dynawaltz/src/test/resources/hvdc_vsc_dyd.xml @@ -3,11 +3,11 @@ - + - + @@ -19,6 +19,6 @@ - - + + diff --git a/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml b/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml index b792fb00d..ae6a68a67 100644 --- a/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml +++ b/dynawaltz/src/test/resources/load_alpha_beta_dyd.xml @@ -3,7 +3,7 @@ - + @@ -12,5 +12,5 @@ - + diff --git a/dynawaltz/src/test/resources/load_one_transformer_dyd.xml b/dynawaltz/src/test/resources/load_one_transformer_dyd.xml index a039fee62..73bc2c0aa 100644 --- a/dynawaltz/src/test/resources/load_one_transformer_dyd.xml +++ b/dynawaltz/src/test/resources/load_one_transformer_dyd.xml @@ -3,7 +3,7 @@ - + @@ -13,5 +13,5 @@ - + diff --git a/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml b/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml index b99bf4bc0..a27fb14ba 100644 --- a/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml +++ b/dynawaltz/src/test/resources/load_one_transformer_tap_changer_dyd.xml @@ -3,7 +3,7 @@ - + @@ -14,5 +14,5 @@ - + diff --git a/dynawaltz/src/test/resources/load_two_transformers_dyd.xml b/dynawaltz/src/test/resources/load_two_transformers_dyd.xml index 458683e1a..7942b2e2f 100644 --- a/dynawaltz/src/test/resources/load_two_transformers_dyd.xml +++ b/dynawaltz/src/test/resources/load_two_transformers_dyd.xml @@ -3,7 +3,7 @@ - + @@ -14,5 +14,5 @@ - + diff --git a/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml b/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml index 9032b16b6..37be45e74 100644 --- a/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml +++ b/dynawaltz/src/test/resources/load_two_transformers_tap_changers_dyd.xml @@ -3,7 +3,7 @@ - + @@ -16,5 +16,5 @@ - + diff --git a/dynawaltz/src/test/resources/node_fault_dyd.xml b/dynawaltz/src/test/resources/node_fault_dyd.xml index f836f0ab1..dba85ae14 100644 --- a/dynawaltz/src/test/resources/node_fault_dyd.xml +++ b/dynawaltz/src/test/resources/node_fault_dyd.xml @@ -1,8 +1,8 @@ - + - + diff --git a/dynawaltz/src/test/resources/omega_ref_dyd.xml b/dynawaltz/src/test/resources/omega_ref_dyd.xml index 9691120f7..d1344a8a0 100644 --- a/dynawaltz/src/test/resources/omega_ref_dyd.xml +++ b/dynawaltz/src/test/resources/omega_ref_dyd.xml @@ -10,15 +10,15 @@ - + - + - + @@ -54,9 +54,9 @@ - - - + + + diff --git a/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml b/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml index d9ee0072b..183d6607c 100644 --- a/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml +++ b/dynawaltz/src/test/resources/phase_shifter_i_dyd.xml @@ -8,13 +8,13 @@ - + - + - - + + diff --git a/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml b/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml index 42f45e864..66536f548 100644 --- a/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml +++ b/dynawaltz/src/test/resources/set_point_inf_bus_dyd.xml @@ -12,7 +12,7 @@ - + @@ -25,6 +25,6 @@ - + diff --git a/dynawaltz/src/test/resources/svarc_dyd.xml b/dynawaltz/src/test/resources/svarc_dyd.xml index a6da75648..f3cb4bffd 100644 --- a/dynawaltz/src/test/resources/svarc_dyd.xml +++ b/dynawaltz/src/test/resources/svarc_dyd.xml @@ -3,7 +3,7 @@ - + @@ -12,5 +12,5 @@ - + diff --git a/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml b/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml index 4e88a602d..eb0c07a46 100644 --- a/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_blocking_dyd.xml @@ -8,19 +8,19 @@ - + - + - + - + @@ -41,10 +41,10 @@ - + - + @@ -57,14 +57,14 @@ - - - - + + + + - - + + diff --git a/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml b/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml index e7d9f0d29..e5a37b183 100644 --- a/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_blocking_empty_dyd.xml @@ -3,7 +3,7 @@ - + @@ -13,5 +13,5 @@ - + diff --git a/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml b/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml index c43a426cf..5131bf04f 100644 --- a/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_blocking_tap_changer_dyd.xml @@ -13,12 +13,12 @@ - + - + @@ -48,7 +48,7 @@ - + @@ -61,14 +61,14 @@ - - - + + + - + diff --git a/dynawaltz/src/test/resources/tap_changer_dyd.xml b/dynawaltz/src/test/resources/tap_changer_dyd.xml index 7e61a3244..1a9df0fd0 100644 --- a/dynawaltz/src/test/resources/tap_changer_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_dyd.xml @@ -12,12 +12,12 @@ - + - + @@ -48,9 +48,9 @@ - - - + + + diff --git a/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml b/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml index b792fb00d..ae6a68a67 100644 --- a/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml +++ b/dynawaltz/src/test/resources/tap_changer_empty_dyd.xml @@ -3,7 +3,7 @@ - + @@ -12,5 +12,5 @@ - + diff --git a/dynawaltz/src/test/resources/tfr_dyd.xml b/dynawaltz/src/test/resources/tfr_dyd.xml index c0ffdde1a..cde84c87b 100644 --- a/dynawaltz/src/test/resources/tfr_dyd.xml +++ b/dynawaltz/src/test/resources/tfr_dyd.xml @@ -1,12 +1,12 @@ - + - + - - + + diff --git a/dynawaltz/src/test/resources/wecc_pv_dyd.xml b/dynawaltz/src/test/resources/wecc_pv_dyd.xml index 0826a37c2..9b696f255 100644 --- a/dynawaltz/src/test/resources/wecc_pv_dyd.xml +++ b/dynawaltz/src/test/resources/wecc_pv_dyd.xml @@ -4,7 +4,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/dynawaltz/src/test/resources/wecc_wt_dyd.xml b/dynawaltz/src/test/resources/wecc_wt_dyd.xml index f7f4481b0..f55b2fb98 100644 --- a/dynawaltz/src/test/resources/wecc_wt_dyd.xml +++ b/dynawaltz/src/test/resources/wecc_wt_dyd.xml @@ -3,7 +3,7 @@ - + @@ -11,5 +11,5 @@ - + diff --git a/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml b/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml index 88cbd4fde..014354498 100644 --- a/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml +++ b/dynawaltz/src/test/resources/wecc_wt_synchro_dyd.xml @@ -4,7 +4,7 @@ - + @@ -19,7 +19,7 @@ - +