diff --git a/cgmes/cgmes-completion/src/test/java/com/powsybl/cgmes/completion/CgmesCompletionTest.java b/cgmes/cgmes-completion/src/test/java/com/powsybl/cgmes/completion/CgmesCompletionTest.java index b61319a8186..c6140f57a81 100644 --- a/cgmes/cgmes-completion/src/test/java/com/powsybl/cgmes/completion/CgmesCompletionTest.java +++ b/cgmes/cgmes-completion/src/test/java/com/powsybl/cgmes/completion/CgmesCompletionTest.java @@ -9,12 +9,13 @@ import com.google.common.jimfs.Configuration; import com.google.common.jimfs.Jimfs; -import com.powsybl.cgmes.conformity.CgmesConformity1ModifiedCatalog; import com.powsybl.cgmes.conversion.CgmesImport; import com.powsybl.cgmes.conversion.CgmesModelExtension; import com.powsybl.cgmes.model.CgmesModel; import com.powsybl.commons.config.InMemoryPlatformConfig; import com.powsybl.commons.datasource.ReadOnlyDataSource; +import com.powsybl.commons.datasource.ResourceDataSource; +import com.powsybl.commons.datasource.ResourceSet; import com.powsybl.computation.ComputationManager; import com.powsybl.computation.local.LocalComputationManager; import com.powsybl.iidm.network.Importers; @@ -52,7 +53,8 @@ void tearDown() throws Exception { @Test void miniGridNodeBreakerMissingVoltageLevel() throws IOException { - ReadOnlyDataSource dataSource = CgmesConformity1ModifiedCatalog.miniGridNodeBreakerMissingVoltageLevel().dataSource(); + ReadOnlyDataSource dataSource = new ResourceDataSource("CGMES file", + new ResourceSet("/", "missing_voltagelevel.xml")); Properties importParams = new Properties(); importParams.put(CgmesImport.PRE_PROCESSORS, "createMissingContainers"); @@ -74,7 +76,7 @@ void miniGridNodeBreakerMissingVoltageLevel() throws IOException { // Check that a specific terminal has a voltage level, navigating the CGMES model CgmesModel cgmes = network.getExtension(CgmesModelExtension.class).getCgmesModel(); - String terminalId = "4915762d-133e-4209-8545-2822d095d7cd"; + String terminalId = "T_BBS"; String voltageLevelId = cgmes.voltageLevel(cgmes.terminal(terminalId), cgmes.isNodeBreaker()); if (voltageLevelId == null || voltageLevelId.isEmpty()) { fail("Missing voltage level for terminal " + terminalId); diff --git a/cgmes/cgmes-completion/src/test/resources/missing_voltagelevel.xml b/cgmes/cgmes-completion/src/test/resources/missing_voltagelevel.xml new file mode 100644 index 00000000000..52386cf0ec4 --- /dev/null +++ b/cgmes/cgmes-completion/src/test/resources/missing_voltagelevel.xml @@ -0,0 +1,40 @@ + + + 2021-03-01T23:00:00Z + 2021-03-02T10:22:58Z + Nodes containers mapping + 001 + http://entsoe.eu/CIM/EquipmentCore/3/1 + http://entsoe.eu/CIM/EquipmentOperation/3/1 + powsybl.org + + + Geographical region + + + Subgeographical region + + + + Substation + + + + Node + + + + Busbar section + + + + + Terminal BBS + + + + + 110 kV + 110 + + diff --git a/cgmes/cgmes-conformity/src/main/java/com/powsybl/cgmes/conformity/CgmesConformity1ModifiedCatalog.java b/cgmes/cgmes-conformity/src/main/java/com/powsybl/cgmes/conformity/CgmesConformity1ModifiedCatalog.java index 43afe45c5c2..56f544f35e6 100644 --- a/cgmes/cgmes-conformity/src/main/java/com/powsybl/cgmes/conformity/CgmesConformity1ModifiedCatalog.java +++ b/cgmes/cgmes-conformity/src/main/java/com/powsybl/cgmes/conformity/CgmesConformity1ModifiedCatalog.java @@ -986,23 +986,6 @@ public static GridModelReferenceResources miniNodeBreakerLoadBreakSwitch() { MINI_GRID_BD_TP)); } - public static GridModelReferenceResources miniNodeBreakerCimLine() { - String base = ENTSOE_CONFORMITY_1_MODIFIED - + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_cim_line/"; - return new GridModelReferenceResources( - "MiniGrid-NodeBreaker-Cim-Line", - null, - new ResourceSet(base, - MINI_GRID_EQ), - new ResourceSet(MINI_GRID_NODE_BREAKER_BASE, - MINI_GRID_SV, - MINI_GRID_DL, - MINI_GRID_SSH, - MINI_GRID_TP), - new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ, - MINI_GRID_BD_TP)); - } - public static GridModelReferenceResources miniNodeBreakerProtectedSwitch() { String base = ENTSOE_CONFORMITY_1_MODIFIED + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_protected_switch/"; @@ -1020,57 +1003,6 @@ public static GridModelReferenceResources miniNodeBreakerProtectedSwitch() { MINI_GRID_BD_TP)); } - public static GridModelReferenceResources miniNodeBreakerSwitchBetweenVoltageLevelsOpen() { - String base = ENTSOE_CONFORMITY_1_MODIFIED - + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switchVLsOpen/"; - return new GridModelReferenceResources( - "MiniGrid-NodeBreaker-switchBetweenVoltageLevelsOpen", - null, - new ResourceSet(base, - MINI_GRID_EQ, - MINI_GRID_SSH), - new ResourceSet(MINI_GRID_NODE_BREAKER_BASE, - MINI_GRID_SV, - MINI_GRID_DL, - MINI_GRID_TP), - new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ, - MINI_GRID_BD_TP)); - } - - public static GridModelReferenceResources miniNodeBreakerJoinVoltageLevelSwitch() { - String base = ENTSOE_CONFORMITY_1_MODIFIED - + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelSwitch/"; - return new GridModelReferenceResources( - "MiniGrid-NodeBreaker-joinVoltageLevel-switch", - null, - new ResourceSet(base, - MINI_GRID_EQ), - new ResourceSet(MINI_GRID_NODE_BREAKER_BASE, - MINI_GRID_SV, - MINI_GRID_DL, - MINI_GRID_SSH, - MINI_GRID_TP), - new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ, - MINI_GRID_BD_TP)); - } - - public static GridModelReferenceResources miniNodeBreakerJoinVoltageLevelTx() { - String base = ENTSOE_CONFORMITY_1_MODIFIED - + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelTx/"; - return new GridModelReferenceResources( - "MiniGrid-NodeBreaker-joinVoltageLevel-tx", - null, - new ResourceSet(base, - MINI_GRID_EQ), - new ResourceSet(MINI_GRID_NODE_BREAKER_BASE, - MINI_GRID_SV, - MINI_GRID_DL, - MINI_GRID_SSH, - MINI_GRID_TP), - new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ, - MINI_GRID_BD_TP)); - } - public static GridModelReference miniNodeBreakerInternalLineZ0() { String base = ENTSOE_CONFORMITY_1_MODIFIED + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_internal_line_z0/"; @@ -1088,22 +1020,6 @@ public static GridModelReference miniNodeBreakerInternalLineZ0() { MINI_GRID_BD_TP)); } - public static GridModelReference miniNodeBreakerSubstationNode() { - String base = ENTSOE_CONFORMITY_1_MODIFIED - + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_substation_node/"; - return new GridModelReferenceResources( - "MiniGrid-NodeBreaker-Substation-Node", - null, - new ResourceSet(base, - MINI_GRID_EQ), - new ResourceSet(MINI_GRID_NODE_BREAKER_BASE, - MINI_GRID_SV, - MINI_GRID_SSH, - MINI_GRID_TP), - new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ, - MINI_GRID_BD_TP)); - } - public static GridModelReference miniNodeBreakerMissingSubstationRegion() { String base = ENTSOE_CONFORMITY_1_MODIFIED + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_missing_substation_region/"; @@ -1613,22 +1529,6 @@ public static GridModelReferenceResources smallGridBusBranchWithBusbarSectionsAn SMALL_GRID_BD_TP)); } - public static GridModelReference miniGridNodeBreakerMissingVoltageLevel() { - String base = ENTSOE_CONFORMITY_1_MODIFIED - + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_missing_voltage_level/"; - return new GridModelReferenceResources( - "MiniGrid-NodeBreaker-BaseCase-Complete-v3-missing-voltage-levels", - null, - new ResourceSet(base, - MINI_GRID_EQ), - new ResourceSet(MINI_GRID_NODE_BREAKER_BASE, - MINI_GRID_SSH, - MINI_GRID_SV, - MINI_GRID_TP), - new ResourceSet(MINI_GRID_NODE_BREAKER_BD_BASE, MINI_GRID_BD_EQ, - MINI_GRID_BD_TP)); - } - public static GridModelReferenceResources miniGridNodeBreakerSwitchTypePreserved() { String base = ENTSOE_CONFORMITY_1_MODIFIED + "/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switch_type_preserved/"; diff --git a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_cim_line/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml b/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_cim_line/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml deleted file mode 100644 index b4314659570..00000000000 --- a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_cim_line/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml +++ /dev/null @@ -1,4548 +0,0 @@ - - - - 2030-01-02T09:00:00 - 2015-02-05T12:20:50.830 - CGMES Conformity Assessment: Mini Grid Base Case Test Configuration. The model is owned by ENTSO-E and is provided by ENTSO-E "as it is". To the fullest extent permitted by law, ENTSO-E shall not be liable for any damages of any kind arising out of the use of the model (including any of its subsequent modifications). ENTSO-E neither warrants, nor represents that the use of the model will not infringe the rights of third parties. Any use of the model shall include a reference to ENTSO-E. ENTSO-E web site is the only official source of information related to the model. - 4 - http://entsoe.eu/CIM/EquipmentCore/3/1 - http://entsoe.eu/CIM/EquipmentOperation/3/1 - http://entsoe.eu/CIM/EquipmentShortCircuit/3/1 - http://A1.de/Planning/ENTSOE/2 - - - - - L5_0_1 - 1 - - - - - - L5_1_1 - 2 - - - - - - L5_0_2 - 1 - - - - - - L5_1_2 - 2 - - - - - - L5_0_3 - 1 - - - - - - L5_1_3 - 2 - - - - - - L6_0 - 1 - - - - - - L6_1 - 2 - - - - - - L4_0 - 1 - - - - - - L4_1 - 2 - - - - - - L1_0 - 1 - - - - - - L1_1 - 2 - - - - - - L2_0 - 1 - - - - - - L2_1 - 2 - - - - - - L3_a_0 - 1 - - - - - - L3_a_1 - 2 - - - - - - L3_b_0 - 1 - - - - - - L3_b_1 - 2 - - - - - - T5_0 - 1 - - - - - - T5_1 - 2 - - - - - - T6_0 - 1 - - - - - - T6_1 - 2 - - - - - - T2_0 - 1 - - - - - - T2_1 - 2 - - - - - - T1_0 - 1 - - - - - - T1_1 - 2 - - - - - - T4_0 - 1 - - - - - - T4_1 - 2 - - - - - - T4_2 - 3 - - - - - - T3_0 - 1 - - - - - - T3_1 - 2 - - - - - - T3_2 - 3 - - - - - - G2_0 - 1 - - - - - - G1_0 - 1 - - - - - - G3_0 - 1 - - - - - - M1_0 - 1 - - - - - - M2_0 - 1 - - - - - - ASM-1229750300_0 - 1 - - - - - - Q1_0 - 1 - - - - - - Q2_0 - 1 - - - - - - 380kV - 380 - - - 21kV - 21 - - - 10kV - 10 - - - 110kV - 110 - - - 30kV - 30 - - - S2 10kV - - - - - S5 10kV - - - - - S4 10kV - - - - - S3 21kV - - - - - S2 110kV - - - - - S3 110kV - - - - - S1 380kV - - - - - S1 30kV - - - - - S4 110kV - - - - - S1 110kV - - - - - Sub1 - - - - Sub2 - - - - Sub3 - - - - Sub4 - - - - Sub5 - - - - AA - - - Z1 - - - - PATL - 45000 - - - - - TATL - 900 - - - - - TATL - 60 - - - - - Gen-1 - G2 - false - - 0 - 127.5 - 0 - - - G2 - - - 0.9 - 100 - 10.5 - - false - 43.6 - -43.6 - 100 - 0 - 0.004535 - 0.16 - 2 - 2 - - - 7.5 - 0.005 - 0.1 - 0.16 - - - Gen-2 - G1 - false - - 0 - 90 - 0 - - - G1 - - 0.85 - 150 - 21 - - false - 79 - -79 - 100 - 0 - 0.00068 - 0.14 - 1.8 - 1.8 - - - 0.002 - 0.1 - 0.14 - - - Gen-3 - G3 - false - - 0 - 8 - 0 - - - G3 - - 0.8 - 10 - 10.5 - - false - 6 - -6 - 100 - 0 - 0.00163 - 0.1 - 1.8 - 1.8 - - - 0.018 - 0.08 - 0.1 - - - M3 - false - - 0.88 - 5.828 - 10 - false - 97.5 - 5 - 1 - 5 - false - 0.1 - - - M2a - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - M2b - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - Q1 - - 0 - true - 38000 - 800 - 600 - 0.15 - 0.1 - 3.029 - 0 - -800 - -600 - 0.1 - 0.1 - 1 - 1.1 - - - Q2 - - 0 - true - 16000 - 88 - 66 - 0.2 - 0.1 - 3.34865 - 0 - -88 - -66 - 0 - 0 - 0 - 1.1 - - - Line-7-1 - L5-1 - false - - - 15 - 0 - 0 - 0 - 0 - 0.6 - 1.1 - 80 - 1.93 - 5.5 - - - Line-7-2 - L5-2 - false - - - 15 - 0 - 0 - 0 - 0 - 0.6 - 1.1 - 80 - 1.93 - 5.5 - - - Line-7-3 - L5-3 - false - - - 15 - 0 - 0 - 0 - 0 - 0.6 - 1.1 - 80 - 1.93 - 5.5 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-4 - L6 - false - - - 1 - 0 - 0 - 0 - 0 - 0.082 - 0.082 - 80 - 0.086 - 0.086 - - - Ratings - - - - Normal - - - 1155 - - - ShortTerm - - - 1328 - - - Emergency - - - 1617 - - - Line-5 - L4 - false - - - 10 - 0 - 0 - 0 - 0 - 0.96 - 2.2 - 80 - 3.88 - 11 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-1 - L1 - false - - - 20 - 0 - 0 - 0 - 0 - 2.4 - 6.4 - 80 - 7.8 - 25.2 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-6 - L2 - false - - - 10 - 0 - 0 - 0 - 0 - 1.2 - 3.2 - 80 - 3.9 - 12.6 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-2 - L3_a - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-3 - L3_b - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Trafo-1 - T5 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T5 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T5 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-2 - T6 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T6 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T6 - 0 - 2 - true - 100 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-3 - T2 - false - - 115 - true - false - - - T2 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 100 - 0 - 120 - 0 - 0.72 - 0.72 - 17.2649937 - 17.2649937 - - - - Ratings - - - - Normal - - - 481 - - - ShortTerm - - - 553 - - - Emergency - - - 673 - - - T2 - 2 - false - - - 0 - - 0 - 5 - 100 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 5498 - - - ShortTerm - - - 6323 - - - Emergency - - - 7698 - - - Trafo-4 - T1 - false - - 115 - true - false - - - T1 - 2 - false - - - 0 - - 0 - 5 - 150 - 0 - 21 - 0 - 0.0147 - 0.0147 - 0.47017 - 0.446662 - - - - Ratings - - - - Normal - - - 4123 - - - ShortTerm - - - 4742 - - - Emergency - - - 5773 - - - T1 - 25 - 1 - true - 13 - 21 - 13 - - 1 - - - - T1 - 0 - 1 - true - 22 - - - 0 - - 0 - 0 - 150 - 0 - 115 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 753 - - - ShortTerm - - - 866 - - - Emergency - - - 1054 - - - T4 - false - - false - - - T4 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.0254571438 - 0.0254571438 - 1.259741 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 0 - 2 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T4 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - Trafo-5 - T3 - false - - false - - - T3 - 0 - 1 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - T3 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - T3 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T3 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.02545714286 - 0.02545714286 - 1.259740894 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - 68-116_0 - 1 - - - - - - 68-116_1 - 2 - - - - - - Injection_0 - 1 - - - - - - 71-73_0 - 1 - - - - - - 71-73_1 - 2 - - - - - - Injection_0 - 1 - - - - - - XQ1-N1 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - XQ2-N5 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - Injection1 - - - 0.63185 - 2.85315 - 0.63185 - false - 6.3185 - 19.021 - 6.3185 - - - Injection2 - - - 0.43445 - 2.86738 - 0.43445 - false - 4.3445 - 14.3369 - 4.3445 - - - CONNECTIVITY_NODE1 - - - - BUSBAR1 - - - - - L5_0_BUSBAR - 1 - - - - - - BAY_L5_0 - - - - L5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR1 - - - false - false - - - L5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE2 - - - - L5_0_ADDB1 - 1 - - - - - - BREAKER1 - - - false - false - - - L5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE3 - - - - L5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR2 - - - false - false - - - L5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE4 - - - - CONNECTIVITY_NODE4_2 - - - - CONNECTIVITY_NODE5 - - - - BUSBAR2 - - - - - L5_1_BUSBAR - 2 - - - - - - BAY_L5_1 - - - - L5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR3 - - - false - false - - - L5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE6 - - - - L5_1_ADDB1 - 1 - - - - - - BREAKER2 - - - false - false - - - L5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE7 - - - - L5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR4 - - - false - false - - - L5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE8 - - - - CONNECTIVITY_NODE8_2 - - - - CONNECTIVITY_NODE9 - - - - BUSBAR3 - - - - - L6_0_BUSBAR - 1 - - - - - - BAY_L6_0 - - - - L6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR5 - - - false - false - - - L6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE10 - - - - L6_0_ADDB1 - 1 - - - - - - BREAKER3 - - - false - false - - - L6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE11 - - - - L6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR6 - - - false - false - - - L6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE12 - - - - CONNECTIVITY_NODE13 - - - - BUSBAR4 - - - - - L6_1_BUSBAR - 2 - - - - - - BAY_L6_1 - - - - L6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR7 - - - false - false - - - L6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE14 - - - - L6_1_ADDB1 - 1 - - - - - - BREAKER4 - - - false - false - - - L6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE15 - - - - L6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR8 - - - false - false - - - L6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE16 - - - - BAY_L4_0 - - - - L4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR9 - - - false - false - - - L4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE17 - - - - L4_0_ADDB1 - 1 - - - - - - BREAKER5 - - - false - false - - - L4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE18 - - - - L4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR10 - - - false - false - - - L4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE19 - - - - CONNECTIVITY_NODE20 - - - - BUSBAR5 - - - - - L4_1_BUSBAR - 2 - - - - - - BAY_L4_1 - - - - L4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR11 - - - false - false - - - L4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE21 - - - - L4_1_ADDB1 - 1 - - - - - - BREAKER6 - - - false - false - - - L4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE22 - - - - L4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR12 - - - false - false - - - L4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE23 - - - - CONNECTIVITY_NODE24 - - - - BUSBAR6 - - - - - L1_0_BUSBAR - 1 - - - - - - BAY_L1_0 - - - - L1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR13 - - - false - false - - - L1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE25 - - - - L1_0_ADDB1 - 1 - - - - - - BREAKER7 - - - false - false - - - L1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE26 - - - - L1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR14 - - - false - false - - - L1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE27 - - - - BAY_L1_1 - - - - L1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR15 - - - false - false - - - L1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE28 - - - - L1_1_ADDB1 - 1 - - - - - - BREAKER8 - - - false - false - - - L1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE29 - - - - L1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR16 - - - false - false - - - L1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE30 - - - - BAY_L2_0 - - - - L2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR17 - - - false - false - - - L2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE31 - - - - L2_0_ADDB1 - 1 - - - - - - BREAKER9 - - - false - false - - - L2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE32 - - - - L2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR18 - - - false - false - - - L2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE33 - - - - BAY_L2_1 - - - - L2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR19 - - - false - false - - - L2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE34 - - - - L2_1_ADDB1 - 1 - - - - - - BREAKER10 - - - false - false - - - L2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE35 - - - - L2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR20 - - - false - false - - - L2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE36 - - - - BAY_L3_a_0 - - - - L3_a_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR21 - - - false - false - - - L3_a_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE37 - - - - L3_a_0_ADDB1 - 1 - - - - - - BREAKER11 - - - false - false - - - L3_a_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE38 - - - - L3_a_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR22 - - - false - false - - - L3_a_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE39 - - - - BAY_L3_a_1 - - - - L3_a_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR23 - - - false - false - - - L3_a_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE40 - - - - L3_a_1_ADDB1 - 1 - - - - - - BREAKER12 - - - false - false - - - L3_a_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE41 - - - - L3_a_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR24 - - - false - false - - - L3_a_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE42 - - - - BAY_L3_b_0 - - - - L3_b_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR25 - - - false - false - - - L3_b_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE43 - - - - L3_b_0_ADDB1 - 1 - - - - - - BREAKER13 - - - false - false - - - L3_b_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE44 - - - - L3_b_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR26 - - - false - false - - - L3_b_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE45 - - - - BAY_L3_b_1 - - - - L3_b_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR27 - - - false - false - - - L3_b_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE46 - - - - L3_b_1_ADDB1 - 1 - - - - - - BREAKER14 - - - false - false - - - L3_b_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE47 - - - - L3_b_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR28 - - - false - false - - - L3_b_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE48 - - - - BAY_T5_0 - - - - T5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR29 - - - false - false - - - T5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE49 - - - - T5_0_ADDB1 - 1 - - - - - - BREAKER15 - - - false - false - - - T5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE50 - - - - T5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR30 - - - false - false - - - T5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE51 - - - - BAY_T5_1 - - - - T5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR31 - - - false - false - - - T5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE52 - - - - T5_1_ADDB1 - 1 - - - - - - BREAKER16 - - - false - false - - - T5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE53 - - - - T5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR32 - - - false - false - - - T5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE54 - - - - BAY_T6_0 - - - - T6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR33 - - - false - false - - - T6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE55 - - - - T6_0_ADDB1 - 1 - - - - - - BREAKER17 - - - false - false - - - T6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE56 - - - - T6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR34 - - - false - false - - - T6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE57 - - - - BAY_T6_1 - - - - T6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR35 - - - false - false - - - T6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE58 - - - - T6_1_ADDB1 - 1 - - - - - - BREAKER18 - - - false - false - - - T6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE59 - - - - T6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR36 - - - false - false - - - T6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE60 - - - - BAY_T2_0 - - - - T2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR37 - - - false - false - - - T2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE61 - - - - T2_0_ADDB1 - 1 - - - - - - BREAKER19 - - - false - false - - - T2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE62 - - - - T2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR38 - - - false - false - - - T2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE63 - - - - CONNECTIVITY_NODE64 - - - - BUSBAR7 - - - - - T2_1_BUSBAR - 2 - - - - - - BAY_T2_1 - - - - T2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR39 - - - false - false - - - T2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE65 - - - - T2_1_ADDB1 - 1 - - - - - - BREAKER20 - - - false - false - - - T2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE66 - - - - T2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR40 - - - false - false - - - T2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE67 - - - - CONNECTIVITY_NODE68 - - - - BUSBAR8 - - - - - T1_0_BUSBAR - 1 - - - - - - BAY_T1_0 - - - - T1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR41 - - - false - false - - - T1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE69 - - - - T1_0_ADDB1 - 1 - - - - - - BREAKER21 - - - false - false - - - T1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE70 - - - - T1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR42 - - - false - false - - - T1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE71 - - - - BAY_T1_1 - - - - T1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR43 - - - false - false - - - T1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE72 - - - - T1_1_ADDB1 - 1 - - - - - - BREAKER22 - - - false - false - - - T1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE73 - - - - T1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR44 - - - false - false - - - T1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE74 - - - - CONNECTIVITY_NODE75 - - - - BUSBAR9 - - - - - T4_0_BUSBAR - 1 - - - - - - BAY_T4_0 - - - - T4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR45 - - - false - false - - - T4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE76 - - - - T4_0_ADDB1 - 1 - - - - - - BREAKER23 - - - false - false - - - T4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE77 - - - - T4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR46 - - - false - false - - - T4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE78 - - - - BAY_T4_1 - - - - T4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR47 - - - false - false - - - T4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE79 - - - - T4_1_ADDB1 - 1 - - - - - - BREAKER24 - - - false - false - - - T4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE80 - - - - T4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR48 - - - false - false - - - T4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE81 - - - - CONNECTIVITY_NODE82 - - - - BUSBAR10 - - - - - T4_2_BUSBAR - 3 - - - - - - BAY_T4_2 - - - - T4_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR49 - - - false - false - - - T4_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE83 - - - - T4_2_ADDB1 - 1 - - - - - - BREAKER25 - - - false - false - - - T4_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE84 - - - - T4_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR50 - - - false - false - - - T4_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE85 - - - - BAY_T3_0 - - - - T3_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR51 - - - false - false - - - T3_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE86 - - - - T3_0_ADDB1 - 1 - - - - - - BREAKER26 - - - false - false - - - T3_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE87 - - - - T3_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR52 - - - false - false - - - T3_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE88 - - - - BAY_T3_1 - - - - T3_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR53 - - - false - false - - - T3_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE89 - - - - T3_1_ADDB1 - 1 - - - - - - BREAKER27 - - - false - false - - - T3_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE90 - - - - T3_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR54 - - - false - false - - - T3_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE91 - - - - CONNECTIVITY_NODE92 - - - - BUSBAR11 - - - - - T3_2_BUSBAR - 3 - - - - - - BAY_T3_2 - - - - T3_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR55 - - - false - false - - - T3_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE93 - - - - T3_2_ADDB1 - 1 - - - - - - BREAKER28 - - - false - false - - - T3_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE94 - - - - T3_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR56 - - - false - false - - - T3_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE95 - - - - BAY_68-116_0 - - - - 68-116_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR57 - - - false - false - - - 68-116_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE96 - - - - 68-116_0_ADDB1 - 1 - - - - - - BREAKER29 - - - false - false - - - 68-116_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE97 - - - - 68-116_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR58 - - - false - false - - - 68-116_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE98 - - - - BAY_71-73_0 - - - - 71-73_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR59 - - - false - false - - - 71-73_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE100 - - - - 71-73_0_ADDB1 - 1 - - - - - - BREAKER30 - - - false - false - - - 71-73_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE101 - - - - 71-73_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR60 - - - false - false - - - 71-73_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE102 - - - - GEN_A1 - - - - - _CA_A1 - - - - 5 - 1 - - - 4 - 1 - - - 6 - 1 - - - 7 - 1 - - - 3 - 1 - - - 2 - 1 - - - HG2 - 1 - - - HG1 - 1 - - - H - 1 - - - 1 - 1 - - - 8 - 1 - - - Container for Line-7 - - - - Container for Line-4 - - - - Container for Line-5 - - - - Container for Line-1 - - - - Container for Line-6 - - - - Container for Line-2 - - - - Container for Line-3 - - - - TwinBrch SM - - - - - PATLT - 4000 - - - - - Normal - - - 525 - - - Normal - - - 1155 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 481 - - - Normal - - - 5498 - - - Normal - - - 4123 - - - Normal - - - 753 - - - Normal - - - 962 - - - Normal - - - 1683 - - - Normal - - - 505 - - - Normal - - - 505 - - - Normal - - - 1683 - - - Normal - - - 962 - - - Normal - - - 1000 - - - Normal - - - 1000 - - \ No newline at end of file diff --git a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelSwitch/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml b/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelSwitch/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml deleted file mode 100644 index eeab428fcc8..00000000000 --- a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelSwitch/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml +++ /dev/null @@ -1,4487 +0,0 @@ - - - - 2030-01-02T09:00:00 - 2015-02-05T12:20:50.830 - CGMES Conformity Assessment: Mini Grid Base Case Test Configuration. The model is owned by ENTSO-E and is provided by ENTSO-E "as it is". To the fullest extent permitted by law, ENTSO-E shall not be liable for any damages of any kind arising out of the use of the model (including any of its subsequent modifications). ENTSO-E neither warrants, nor represents that the use of the model will not infringe the rights of third parties. Any use of the model shall include a reference to ENTSO-E. ENTSO-E web site is the only official source of information related to the model. - 4 - http://entsoe.eu/CIM/EquipmentCore/3/1 - http://entsoe.eu/CIM/EquipmentOperation/3/1 - http://entsoe.eu/CIM/EquipmentShortCircuit/3/1 - http://A1.de/Planning/ENTSOE/2 - - - - - L5_0 - 1 - - - - - - L5_1 - 2 - - - - - - L6_0 - 1 - - - - - - L6_1 - 2 - - - - - - L4_0 - 1 - - - - - - L4_1 - 2 - - - - - - L1_0 - 1 - - - - - - L1_1 - 2 - - - - - - L2_0 - 1 - - - - - - L2_1 - 2 - - - - - - L3_a_0 - 1 - - - - - - L3_a_1 - 2 - - - - - - L3_b_0 - 1 - - - - - - L3_b_1 - 2 - - - - - - T5_0 - 1 - - - - - - T5_1 - 2 - - - - - - T6_0 - 1 - - - - - - T6_1 - 2 - - - - - - T2_0 - 1 - - - - - - T2_1 - 2 - - - - - - T1_0 - 1 - - - - - - T1_1 - 2 - - - - - - T4_0 - 1 - - - - - - T4_1 - 2 - - - - - - T4_2 - 3 - - - - - - T3_0 - 1 - - - - - - T3_1 - 2 - - - - - - T3_2 - 3 - - - - - - G2_0 - 1 - - - - - - G1_0 - 1 - - - - - - G3_0 - 1 - - - - - - M1_0 - 1 - - - - - - M2_0 - 1 - - - - - - ASM-1229750300_0 - 1 - - - - - - Q1_0 - 1 - - - - - - Q2_0 - 1 - - - - - - 380kV - 380 - - - 21kV - 21 - - - 10kV - 10 - - - 110kV - 110 - - - 30kV - 30 - - - S2 10kV - - - - - S5 10kV - - - - - S4 10kV - - - - - S3 21kV - - - - - S2 110kV - - - - - S3 110kV - - - - - S1 380kV - - - - - S1 30kV - - - - - S4 110kV - - - - - S4B 110kV - - - - - S1 110kV - - - - - Sub1 - - - - Sub2 - - - - Sub3 - - - - Sub4 - - - - Sub5 - - - - AA - - - Z1 - - - - PATL - 45000 - - - - - TATL - 900 - - - - - TATL - 60 - - - - - Gen-1 - G2 - false - - 0 - 127.5 - 0 - - - G2 - - - 0.9 - 100 - 10.5 - - false - 43.6 - -43.6 - 100 - 0 - 0.004535 - 0.16 - 2 - 2 - - - 7.5 - 0.005 - 0.1 - 0.16 - - - Gen-2 - G1 - false - - 0 - 90 - 0 - - - G1 - - 0.85 - 150 - 21 - - false - 79 - -79 - 100 - 0 - 0.00068 - 0.14 - 1.8 - 1.8 - - - 0.002 - 0.1 - 0.14 - - - Gen-3 - G3 - false - - 0 - 8 - 0 - - - G3 - - 0.8 - 10 - 10.5 - - false - 6 - -6 - 100 - 0 - 0.00163 - 0.1 - 1.8 - 1.8 - - - 0.018 - 0.08 - 0.1 - - - M3 - false - - 0.88 - 5.828 - 10 - false - 97.5 - 5 - 1 - 5 - false - 0.1 - - - M2a - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - M2b - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - Q1 - - 0 - true - 38000 - 800 - 600 - 0.15 - 0.1 - 3.029 - 0 - -800 - -600 - 0.1 - 0.1 - 1 - 1.1 - - - Q2 - - 0 - true - 16000 - 88 - 66 - 0.2 - 0.1 - 3.34865 - 0 - -88 - -66 - 0 - 0 - 0 - 1.1 - - - Line-7 - L5 - false - - - 15 - 0 - 0 - 0 - 0 - 1.8 - 3.3 - 80 - 5.79 - 16.5 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-4 - L6 - false - - - 1 - 0 - 0 - 0 - 0 - 0.082 - 0.082 - 80 - 0.086 - 0.086 - - - Ratings - - - - Normal - - - 1155 - - - ShortTerm - - - 1328 - - - Emergency - - - 1617 - - - Line-5 - L4 - false - - - 10 - 0 - 0 - 0 - 0 - 0.96 - 2.2 - 80 - 3.88 - 11 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-1 - L1 - false - - - 20 - 0 - 0 - 0 - 0 - 2.4 - 6.4 - 80 - 7.8 - 25.2 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-6 - L2 - false - - - 10 - 0 - 0 - 0 - 0 - 1.2 - 3.2 - 80 - 3.9 - 12.6 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-2 - L3_a - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-3 - L3_b - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Trafo-1 - T5 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T5 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T5 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-2 - T6 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T6 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T6 - 0 - 2 - true - 100 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-3 - T2 - false - - 115 - true - false - - - T2 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 100 - 0 - 120 - 0 - 0.72 - 0.72 - 17.2649937 - 17.2649937 - - - - Ratings - - - - Normal - - - 481 - - - ShortTerm - - - 553 - - - Emergency - - - 673 - - - T2 - 2 - false - - - 0 - - 0 - 5 - 100 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 5498 - - - ShortTerm - - - 6323 - - - Emergency - - - 7698 - - - Trafo-4 - T1 - false - - 115 - true - false - - - T1 - 2 - false - - - 0 - - 0 - 5 - 150 - 0 - 21 - 0 - 0.0147 - 0.0147 - 0.47017 - 0.446662 - - - - Ratings - - - - Normal - - - 4123 - - - ShortTerm - - - 4742 - - - Emergency - - - 5773 - - - T1 - 25 - 1 - true - 13 - 21 - 13 - - 1 - - - - T1 - 0 - 1 - true - 22 - - - 0 - - 0 - 0 - 150 - 0 - 115 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 753 - - - ShortTerm - - - 866 - - - Emergency - - - 1054 - - - T4 - false - - false - - - T4 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.0254571438 - 0.0254571438 - 1.259741 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 0 - 2 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T4 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - Trafo-5 - T3 - false - - false - - - T3 - 0 - 1 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - T3 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - T3 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T3 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.02545714286 - 0.02545714286 - 1.259740894 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - 68-116_0 - 1 - - - - - - 68-116_1 - 2 - - - - - - Injection_0 - 1 - - - - - - 71-73_0 - 1 - - - - - - 71-73_1 - 2 - - - - - - Injection_0 - 1 - - - - - - XQ1-N1 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - XQ2-N5 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - Injection1 - - - 0.63185 - 2.85315 - 0.63185 - false - 6.3185 - 19.021 - 6.3185 - - - Injection2 - - - 0.43445 - 2.86738 - 0.43445 - false - 4.3445 - 14.3369 - 4.3445 - - - CONNECTIVITY_NODE1 - - - - BUSBAR1 - - - - - L5_0_BUSBAR - 1 - - - - - - BAY_L5_0 - - - - BAY_L5B_0 - - - - L5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR1 - - - false - false - - - L5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE2 - - - - L5_0_ADDB1 - 1 - - - - - - BREAKER1 - - - false - false - - - L5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE3 - - - - L5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR2 - - - false - false - - - L5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE4 - - - - CONNECTIVITY_NODE5 - - - - BUSBAR2 - - - - - L5_1_BUSBAR - 2 - - - - - - BAY_L5_1 - - - - L5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR3 - - - false - false - - - L5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE6 - - - - L5_1_ADDB1 - 1 - - - - - - BREAKER2 - - - false - false - - - L5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE7 - - - - L5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR4 - - - false - false - - - L5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE8 - - - - CONNECTIVITY_NODE9 - - - - BUSBAR3 - - - - - L6_0_BUSBAR - 1 - - - - - - BAY_L6_0 - - - - L6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR5 - - - false - false - - - L6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE10 - - - - L6_0_ADDB1 - 1 - - - - - - BREAKER3 - - - false - false - - - L6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE11 - - - - L6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR6 - - - false - false - - - L6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE12 - - - - CONNECTIVITY_NODE13 - - - - BUSBAR4 - - - - - L6_1_BUSBAR - 2 - - - - - - BAY_L6_1 - - - - L6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR7 - - - false - false - - - L6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE14 - - - - L6_1_ADDB1 - 1 - - - - - - BREAKER4 - - - false - false - - - L6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE15 - - - - L6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR8 - - - false - false - - - L6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE16 - - - - BAY_L4_0 - - - - L4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR9 - - - false - false - - - L4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE17 - - - - L4_0_ADDB1 - 1 - - - - - - BREAKER5 - - - false - false - - - L4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE18 - - - - L4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR10 - - - false - false - - - L4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE19 - - - - CONNECTIVITY_NODE20 - - - - BUSBAR5 - - - - - L4_1_BUSBAR - 2 - - - - - - BAY_L4_1 - - - - L4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR11 - - - false - false - - - L4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE21 - - - - L4_1_ADDB1 - 1 - - - - - - BREAKER6 - - - false - false - - - L4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE22 - - - - L4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR12 - - - false - false - - - L4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE23 - - - - CONNECTIVITY_NODE24 - - - - BUSBAR6 - - - - - L1_0_BUSBAR - 1 - - - - - - BAY_L1_0 - - - - L1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR13 - - - false - false - - - L1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE25 - - - - L1_0_ADDB1 - 1 - - - - - - BREAKER7 - - - false - false - - - L1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE26 - - - - L1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR14 - - - false - false - - - L1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE27 - - - - BAY_L1_1 - - - - L1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR15 - - - false - false - - - L1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE28 - - - - L1_1_ADDB1 - 1 - - - - - - BREAKER8 - - - false - false - - - L1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE29 - - - - L1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR16 - - - false - false - - - L1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE30 - - - - BAY_L2_0 - - - - L2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR17 - - - false - false - - - L2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE31 - - - - L2_0_ADDB1 - 1 - - - - - - BREAKER9 - - - false - false - - - L2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE32 - - - - L2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR18 - - - false - false - - - L2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE33 - - - - BAY_L2_1 - - - - L2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR19 - - - false - false - - - L2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE34 - - - - L2_1_ADDB1 - 1 - - - - - - BREAKER10 - - - false - false - - - L2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE35 - - - - L2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR20 - - - false - false - - - L2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE36 - - - - BAY_L3_a_0 - - - - L3_a_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR21 - - - false - false - - - L3_a_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE37 - - - - L3_a_0_ADDB1 - 1 - - - - - - BREAKER11 - - - false - false - - - L3_a_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE38 - - - - L3_a_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR22 - - - false - false - - - L3_a_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE39 - - - - BAY_L3_a_1 - - - - L3_a_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR23 - - - false - false - - - L3_a_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE40 - - - - L3_a_1_ADDB1 - 1 - - - - - - BREAKER12 - - - false - false - - - L3_a_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE41 - - - - L3_a_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR24 - - - false - false - - - L3_a_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE42 - - - - BAY_L3_b_0 - - - - L3_b_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR25 - - - false - false - - - L3_b_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE43 - - - - L3_b_0_ADDB1 - 1 - - - - - - BREAKER13 - - - false - false - - - L3_b_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE44 - - - - L3_b_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR26 - - - false - false - - - L3_b_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE45 - - - - BAY_L3_b_1 - - - - L3_b_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR27 - - - false - false - - - L3_b_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE46 - - - - L3_b_1_ADDB1 - 1 - - - - - - BREAKER14 - - - false - false - - - L3_b_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE47 - - - - L3_b_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR28 - - - false - false - - - L3_b_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE48 - - - - BAY_T5_0 - - - - T5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR29 - - - false - false - - - T5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE49 - - - - T5_0_ADDB1 - 1 - - - - - - BREAKER15 - - - false - false - - - T5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE50 - - - - T5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR30 - - - false - false - - - T5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE51 - - - - BAY_T5_1 - - - - T5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR31 - - - false - false - - - T5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE52 - - - - T5_1_ADDB1 - 1 - - - - - - BREAKER16 - - - false - false - - - T5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE53 - - - - T5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR32 - - - false - false - - - T5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE54 - - - - BAY_T6_0 - - - - T6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR33 - - - false - false - - - T6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE55 - - - - T6_0_ADDB1 - 1 - - - - - - BREAKER17 - - - false - false - - - T6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE56 - - - - T6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR34 - - - false - false - - - T6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE57 - - - - BAY_T6_1 - - - - T6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR35 - - - false - false - - - T6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE58 - - - - T6_1_ADDB1 - 1 - - - - - - BREAKER18 - - - false - false - - - T6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE59 - - - - T6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR36 - - - false - false - - - T6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE60 - - - - BAY_T2_0 - - - - T2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR37 - - - false - false - - - T2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE61 - - - - T2_0_ADDB1 - 1 - - - - - - BREAKER19 - - - false - false - - - T2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE62 - - - - T2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR38 - - - false - false - - - T2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE63 - - - - CONNECTIVITY_NODE64 - - - - BUSBAR7 - - - - - T2_1_BUSBAR - 2 - - - - - - BAY_T2_1 - - - - T2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR39 - - - false - false - - - T2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE65 - - - - T2_1_ADDB1 - 1 - - - - - - BREAKER20 - - - false - false - - - T2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE66 - - - - T2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR40 - - - false - false - - - T2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE67 - - - - CONNECTIVITY_NODE68 - - - - BUSBAR8 - - - - - T1_0_BUSBAR - 1 - - - - - - BAY_T1_0 - - - - T1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR41 - - - false - false - - - T1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE69 - - - - T1_0_ADDB1 - 1 - - - - - - BREAKER21 - - - false - false - - - T1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE70 - - - - T1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR42 - - - false - false - - - T1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE71 - - - - BAY_T1_1 - - - - T1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR43 - - - false - false - - - T1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE72 - - - - T1_1_ADDB1 - 1 - - - - - - BREAKER22 - - - false - false - - - T1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE73 - - - - T1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR44 - - - false - false - - - T1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE74 - - - - CONNECTIVITY_NODE75 - - - - BUSBAR9 - - - - - T4_0_BUSBAR - 1 - - - - - - BAY_T4_0 - - - - T4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR45 - - - false - false - - - T4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE76 - - - - T4_0_ADDB1 - 1 - - - - - - BREAKER23 - - - false - false - - - T4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE77 - - - - T4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR46 - - - false - false - - - T4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE78 - - - - BAY_T4_1 - - - - T4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR47 - - - false - false - - - T4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE79 - - - - T4_1_ADDB1 - 1 - - - - - - BREAKER24 - - - false - false - - - T4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE80 - - - - T4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR48 - - - false - false - - - T4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE81 - - - - CONNECTIVITY_NODE82 - - - - BUSBAR10 - - - - - T4_2_BUSBAR - 3 - - - - - - BAY_T4_2 - - - - T4_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR49 - - - false - false - - - T4_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE83 - - - - T4_2_ADDB1 - 1 - - - - - - BREAKER25 - - - false - false - - - T4_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE84 - - - - T4_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR50 - - - false - false - - - T4_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE85 - - - - BAY_T3_0 - - - - T3_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR51 - - - false - false - - - T3_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE86 - - - - T3_0_ADDB1 - 1 - - - - - - BREAKER26 - - - false - false - - - T3_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE87 - - - - T3_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR52 - - - false - false - - - T3_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE88 - - - - BAY_T3_1 - - - - T3_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR53 - - - false - false - - - T3_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE89 - - - - T3_1_ADDB1 - 1 - - - - - - BREAKER27 - - - false - false - - - T3_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE90 - - - - T3_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR54 - - - false - false - - - T3_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE91 - - - - CONNECTIVITY_NODE92 - - - - BUSBAR11 - - - - - T3_2_BUSBAR - 3 - - - - - - BAY_T3_2 - - - - T3_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR55 - - - false - false - - - T3_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE93 - - - - T3_2_ADDB1 - 1 - - - - - - BREAKER28 - - - false - false - - - T3_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE94 - - - - T3_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR56 - - - false - false - - - T3_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE95 - - - - BAY_68-116_0 - - - - 68-116_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR57 - - - false - false - - - 68-116_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE96 - - - - 68-116_0_ADDB1 - 1 - - - - - - BREAKER29 - - - false - false - - - 68-116_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE97 - - - - 68-116_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR58 - - - false - false - - - 68-116_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE98 - - - - BAY_71-73_0 - - - - 71-73_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR59 - - - false - false - - - 71-73_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE100 - - - - 71-73_0_ADDB1 - 1 - - - - - - BREAKER30 - - - false - false - - - 71-73_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE101 - - - - 71-73_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR60 - - - false - false - - - 71-73_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE102 - - - - GEN_A1 - - - - - _CA_A1 - - - - 5 - 1 - - - 4 - 1 - - - 6 - 1 - - - 7 - 1 - - - 3 - 1 - - - 2 - 1 - - - HG2 - 1 - - - HG1 - 1 - - - H - 1 - - - 1 - 1 - - - 8 - 1 - - - Container for Line-7 - - - - Container for Line-4 - - - - Container for Line-5 - - - - Container for Line-1 - - - - Container for Line-6 - - - - Container for Line-2 - - - - Container for Line-3 - - - - TwinBrch SM - - - - - PATLT - 4000 - - - - - Normal - - - 525 - - - Normal - - - 1155 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 481 - - - Normal - - - 5498 - - - Normal - - - 4123 - - - Normal - - - 753 - - - Normal - - - 962 - - - Normal - - - 1683 - - - Normal - - - 505 - - - Normal - - - 505 - - - Normal - - - 1683 - - - Normal - - - 962 - - - Normal - - - 1000 - - - Normal - - - 1000 - - \ No newline at end of file diff --git a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelTx/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml b/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelTx/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml deleted file mode 100644 index a656dd01d3b..00000000000 --- a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_joinVoltageLevelTx/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml +++ /dev/null @@ -1,4482 +0,0 @@ - - - - 2030-01-02T09:00:00 - 2015-02-05T12:20:50.830 - CGMES Conformity Assessment: Mini Grid Base Case Test Configuration. The model is owned by ENTSO-E and is provided by ENTSO-E "as it is". To the fullest extent permitted by law, ENTSO-E shall not be liable for any damages of any kind arising out of the use of the model (including any of its subsequent modifications). ENTSO-E neither warrants, nor represents that the use of the model will not infringe the rights of third parties. Any use of the model shall include a reference to ENTSO-E. ENTSO-E web site is the only official source of information related to the model. - 4 - http://entsoe.eu/CIM/EquipmentCore/3/1 - http://entsoe.eu/CIM/EquipmentOperation/3/1 - http://entsoe.eu/CIM/EquipmentShortCircuit/3/1 - http://A1.de/Planning/ENTSOE/2 - - - - - L5_0 - 1 - - - - - - L5_1 - 2 - - - - - - L6_0 - 1 - - - - - - L6_1 - 2 - - - - - - L4_0 - 1 - - - - - - L4_1 - 2 - - - - - - L1_0 - 1 - - - - - - L1_1 - 2 - - - - - - L2_0 - 1 - - - - - - L2_1 - 2 - - - - - - L3_a_0 - 1 - - - - - - L3_a_1 - 2 - - - - - - L3_b_0 - 1 - - - - - - L3_b_1 - 2 - - - - - - T5_0 - 1 - - - - - - T5_1 - 2 - - - - - - T6_0 - 1 - - - - - - T6_1 - 2 - - - - - - T2_0 - 1 - - - - - - T2_1 - 2 - - - - - - T1_0 - 1 - - - - - - T1_1 - 2 - - - - - - T4_0 - 1 - - - - - - T4_1 - 2 - - - - - - T4_2 - 3 - - - - - - T3_0 - 1 - - - - - - T3_1 - 2 - - - - - - T3_2 - 3 - - - - - - G2_0 - 1 - - - - - - G1_0 - 1 - - - - - - G3_0 - 1 - - - - - - M1_0 - 1 - - - - - - M2_0 - 1 - - - - - - ASM-1229750300_0 - 1 - - - - - - Q1_0 - 1 - - - - - - Q2_0 - 1 - - - - - - 380kV - 380 - - - 21kV - 21 - - - 10kV - 10 - - - 110kV - 110 - - - 30kV - 30 - - - S2 10kV - - - - - S5 10kV - - - - - S4 10kV - - - - - S3 21kV - - - - - S2 110kV - - - - - S3 110kV - - - - - S1 380kV - - - - - S1 30kV - - - - - S4 110kV - - - - - S1 110kV - - - - - Sub1 - - - - Sub2 - - - - Sub3 - - - - Sub4 - - - - Sub4B - - - - Sub5 - - - - AA - - - Z1 - - - - PATL - 45000 - - - - - TATL - 900 - - - - - TATL - 60 - - - - - Gen-1 - G2 - false - - 0 - 127.5 - 0 - - - G2 - - - 0.9 - 100 - 10.5 - - false - 43.6 - -43.6 - 100 - 0 - 0.004535 - 0.16 - 2 - 2 - - - 7.5 - 0.005 - 0.1 - 0.16 - - - Gen-2 - G1 - false - - 0 - 90 - 0 - - - G1 - - 0.85 - 150 - 21 - - false - 79 - -79 - 100 - 0 - 0.00068 - 0.14 - 1.8 - 1.8 - - - 0.002 - 0.1 - 0.14 - - - Gen-3 - G3 - false - - 0 - 8 - 0 - - - G3 - - 0.8 - 10 - 10.5 - - false - 6 - -6 - 100 - 0 - 0.00163 - 0.1 - 1.8 - 1.8 - - - 0.018 - 0.08 - 0.1 - - - M3 - false - - 0.88 - 5.828 - 10 - false - 97.5 - 5 - 1 - 5 - false - 0.1 - - - M2a - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - M2b - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - Q1 - - 0 - true - 38000 - 800 - 600 - 0.15 - 0.1 - 3.029 - 0 - -800 - -600 - 0.1 - 0.1 - 1 - 1.1 - - - Q2 - - 0 - true - 16000 - 88 - 66 - 0.2 - 0.1 - 3.34865 - 0 - -88 - -66 - 0 - 0 - 0 - 1.1 - - - Line-7 - L5 - false - - - 15 - 0 - 0 - 0 - 0 - 1.8 - 3.3 - 80 - 5.79 - 16.5 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-4 - L6 - false - - - 1 - 0 - 0 - 0 - 0 - 0.082 - 0.082 - 80 - 0.086 - 0.086 - - - Ratings - - - - Normal - - - 1155 - - - ShortTerm - - - 1328 - - - Emergency - - - 1617 - - - Line-5 - L4 - false - - - 10 - 0 - 0 - 0 - 0 - 0.96 - 2.2 - 80 - 3.88 - 11 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-1 - L1 - false - - - 20 - 0 - 0 - 0 - 0 - 2.4 - 6.4 - 80 - 7.8 - 25.2 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-6 - L2 - false - - - 10 - 0 - 0 - 0 - 0 - 1.2 - 3.2 - 80 - 3.9 - 12.6 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-2 - L3_a - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-3 - L3_b - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Trafo-1 - T5 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T5 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T5 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-2 - T6 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T6 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T6 - 0 - 2 - true - 100 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-3 - T2 - false - - 115 - true - false - - - T2 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 100 - 0 - 120 - 0 - 0.72 - 0.72 - 17.2649937 - 17.2649937 - - - - Ratings - - - - Normal - - - 481 - - - ShortTerm - - - 553 - - - Emergency - - - 673 - - - T2 - 2 - false - - - 0 - - 0 - 5 - 100 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 5498 - - - ShortTerm - - - 6323 - - - Emergency - - - 7698 - - - Trafo-4 - T1 - false - - 115 - true - false - - - T1 - 2 - false - - - 0 - - 0 - 5 - 150 - 0 - 21 - 0 - 0.0147 - 0.0147 - 0.47017 - 0.446662 - - - - Ratings - - - - Normal - - - 4123 - - - ShortTerm - - - 4742 - - - Emergency - - - 5773 - - - T1 - 25 - 1 - true - 13 - 21 - 13 - - 1 - - - - T1 - 0 - 1 - true - 22 - - - 0 - - 0 - 0 - 150 - 0 - 115 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 753 - - - ShortTerm - - - 866 - - - Emergency - - - 1054 - - - T4 - false - - false - - - T4 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.0254571438 - 0.0254571438 - 1.259741 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 0 - 2 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T4 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - Trafo-5 - T3 - false - - false - - - T3 - 0 - 1 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - T3 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - T3 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T3 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.02545714286 - 0.02545714286 - 1.259740894 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - 68-116_0 - 1 - - - - - - 68-116_1 - 2 - - - - - - Injection_0 - 1 - - - - - - 71-73_0 - 1 - - - - - - 71-73_1 - 2 - - - - - - Injection_0 - 1 - - - - - - XQ1-N1 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - XQ2-N5 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - Injection1 - - - 0.63185 - 2.85315 - 0.63185 - false - 6.3185 - 19.021 - 6.3185 - - - Injection2 - - - 0.43445 - 2.86738 - 0.43445 - false - 4.3445 - 14.3369 - 4.3445 - - - CONNECTIVITY_NODE1 - - - - BUSBAR1 - - - - - L5_0_BUSBAR - 1 - - - - - - BAY_L5_0 - - - - L5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR1 - - - false - false - - - L5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE2 - - - - L5_0_ADDB1 - 1 - - - - - - BREAKER1 - - - false - false - - - L5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE3 - - - - L5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR2 - - - false - false - - - L5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE4 - - - - CONNECTIVITY_NODE5 - - - - BUSBAR2 - - - - - L5_1_BUSBAR - 2 - - - - - - BAY_L5_1 - - - - L5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR3 - - - false - false - - - L5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE6 - - - - L5_1_ADDB1 - 1 - - - - - - BREAKER2 - - - false - false - - - L5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE7 - - - - L5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR4 - - - false - false - - - L5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE8 - - - - CONNECTIVITY_NODE9 - - - - BUSBAR3 - - - - - L6_0_BUSBAR - 1 - - - - - - BAY_L6_0 - - - - L6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR5 - - - false - false - - - L6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE10 - - - - L6_0_ADDB1 - 1 - - - - - - BREAKER3 - - - false - false - - - L6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE11 - - - - L6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR6 - - - false - false - - - L6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE12 - - - - CONNECTIVITY_NODE13 - - - - BUSBAR4 - - - - - L6_1_BUSBAR - 2 - - - - - - BAY_L6_1 - - - - L6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR7 - - - false - false - - - L6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE14 - - - - L6_1_ADDB1 - 1 - - - - - - BREAKER4 - - - false - false - - - L6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE15 - - - - L6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR8 - - - false - false - - - L6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE16 - - - - BAY_L4_0 - - - - L4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR9 - - - false - false - - - L4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE17 - - - - L4_0_ADDB1 - 1 - - - - - - BREAKER5 - - - false - false - - - L4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE18 - - - - L4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR10 - - - false - false - - - L4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE19 - - - - CONNECTIVITY_NODE20 - - - - BUSBAR5 - - - - - L4_1_BUSBAR - 2 - - - - - - BAY_L4_1 - - - - L4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR11 - - - false - false - - - L4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE21 - - - - L4_1_ADDB1 - 1 - - - - - - BREAKER6 - - - false - false - - - L4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE22 - - - - L4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR12 - - - false - false - - - L4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE23 - - - - CONNECTIVITY_NODE24 - - - - BUSBAR6 - - - - - L1_0_BUSBAR - 1 - - - - - - BAY_L1_0 - - - - L1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR13 - - - false - false - - - L1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE25 - - - - L1_0_ADDB1 - 1 - - - - - - BREAKER7 - - - false - false - - - L1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE26 - - - - L1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR14 - - - false - false - - - L1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE27 - - - - BAY_L1_1 - - - - L1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR15 - - - false - false - - - L1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE28 - - - - L1_1_ADDB1 - 1 - - - - - - BREAKER8 - - - false - false - - - L1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE29 - - - - L1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR16 - - - false - false - - - L1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE30 - - - - BAY_L2_0 - - - - L2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR17 - - - false - false - - - L2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE31 - - - - L2_0_ADDB1 - 1 - - - - - - BREAKER9 - - - false - false - - - L2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE32 - - - - L2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR18 - - - false - false - - - L2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE33 - - - - BAY_L2_1 - - - - L2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR19 - - - false - false - - - L2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE34 - - - - L2_1_ADDB1 - 1 - - - - - - BREAKER10 - - - false - false - - - L2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE35 - - - - L2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR20 - - - false - false - - - L2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE36 - - - - BAY_L3_a_0 - - - - L3_a_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR21 - - - false - false - - - L3_a_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE37 - - - - L3_a_0_ADDB1 - 1 - - - - - - BREAKER11 - - - false - false - - - L3_a_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE38 - - - - L3_a_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR22 - - - false - false - - - L3_a_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE39 - - - - BAY_L3_a_1 - - - - L3_a_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR23 - - - false - false - - - L3_a_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE40 - - - - L3_a_1_ADDB1 - 1 - - - - - - BREAKER12 - - - false - false - - - L3_a_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE41 - - - - L3_a_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR24 - - - false - false - - - L3_a_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE42 - - - - BAY_L3_b_0 - - - - L3_b_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR25 - - - false - false - - - L3_b_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE43 - - - - L3_b_0_ADDB1 - 1 - - - - - - BREAKER13 - - - false - false - - - L3_b_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE44 - - - - L3_b_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR26 - - - false - false - - - L3_b_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE45 - - - - BAY_L3_b_1 - - - - L3_b_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR27 - - - false - false - - - L3_b_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE46 - - - - L3_b_1_ADDB1 - 1 - - - - - - BREAKER14 - - - false - false - - - L3_b_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE47 - - - - L3_b_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR28 - - - false - false - - - L3_b_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE48 - - - - BAY_T5_0 - - - - T5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR29 - - - false - false - - - T5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE49 - - - - T5_0_ADDB1 - 1 - - - - - - BREAKER15 - - - false - false - - - T5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE50 - - - - T5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR30 - - - false - false - - - T5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE51 - - - - BAY_T5_1 - - - - T5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR31 - - - false - false - - - T5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE52 - - - - T5_1_ADDB1 - 1 - - - - - - BREAKER16 - - - false - false - - - T5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE53 - - - - T5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR32 - - - false - false - - - T5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE54 - - - - BAY_T6_0 - - - - T6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR33 - - - false - false - - - T6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE55 - - - - T6_0_ADDB1 - 1 - - - - - - BREAKER17 - - - false - false - - - T6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE56 - - - - T6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR34 - - - false - false - - - T6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE57 - - - - BAY_T6_1 - - - - T6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR35 - - - false - false - - - T6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE58 - - - - T6_1_ADDB1 - 1 - - - - - - BREAKER18 - - - false - false - - - T6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE59 - - - - T6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR36 - - - false - false - - - T6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE60 - - - - BAY_T2_0 - - - - T2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR37 - - - false - false - - - T2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE61 - - - - T2_0_ADDB1 - 1 - - - - - - BREAKER19 - - - false - false - - - T2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE62 - - - - T2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR38 - - - false - false - - - T2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE63 - - - - CONNECTIVITY_NODE64 - - - - BUSBAR7 - - - - - T2_1_BUSBAR - 2 - - - - - - BAY_T2_1 - - - - T2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR39 - - - false - false - - - T2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE65 - - - - T2_1_ADDB1 - 1 - - - - - - BREAKER20 - - - false - false - - - T2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE66 - - - - T2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR40 - - - false - false - - - T2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE67 - - - - CONNECTIVITY_NODE68 - - - - BUSBAR8 - - - - - T1_0_BUSBAR - 1 - - - - - - BAY_T1_0 - - - - T1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR41 - - - false - false - - - T1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE69 - - - - T1_0_ADDB1 - 1 - - - - - - BREAKER21 - - - false - false - - - T1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE70 - - - - T1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR42 - - - false - false - - - T1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE71 - - - - BAY_T1_1 - - - - T1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR43 - - - false - false - - - T1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE72 - - - - T1_1_ADDB1 - 1 - - - - - - BREAKER22 - - - false - false - - - T1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE73 - - - - T1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR44 - - - false - false - - - T1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE74 - - - - CONNECTIVITY_NODE75 - - - - BUSBAR9 - - - - - T4_0_BUSBAR - 1 - - - - - - BAY_T4_0 - - - - T4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR45 - - - false - false - - - T4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE76 - - - - T4_0_ADDB1 - 1 - - - - - - BREAKER23 - - - false - false - - - T4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE77 - - - - T4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR46 - - - false - false - - - T4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE78 - - - - BAY_T4_1 - - - - T4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR47 - - - false - false - - - T4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE79 - - - - T4_1_ADDB1 - 1 - - - - - - BREAKER24 - - - false - false - - - T4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE80 - - - - T4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR48 - - - false - false - - - T4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE81 - - - - CONNECTIVITY_NODE82 - - - - BUSBAR10 - - - - - T4_2_BUSBAR - 3 - - - - - - BAY_T4_2 - - - - T4_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR49 - - - false - false - - - T4_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE83 - - - - T4_2_ADDB1 - 1 - - - - - - BREAKER25 - - - false - false - - - T4_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE84 - - - - T4_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR50 - - - false - false - - - T4_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE85 - - - - BAY_T3_0 - - - - T3_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR51 - - - false - false - - - T3_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE86 - - - - T3_0_ADDB1 - 1 - - - - - - BREAKER26 - - - false - false - - - T3_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE87 - - - - T3_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR52 - - - false - false - - - T3_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE88 - - - - BAY_T3_1 - - - - T3_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR53 - - - false - false - - - T3_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE89 - - - - T3_1_ADDB1 - 1 - - - - - - BREAKER27 - - - false - false - - - T3_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE90 - - - - T3_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR54 - - - false - false - - - T3_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE91 - - - - CONNECTIVITY_NODE92 - - - - BUSBAR11 - - - - - T3_2_BUSBAR - 3 - - - - - - BAY_T3_2 - - - - T3_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR55 - - - false - false - - - T3_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE93 - - - - T3_2_ADDB1 - 1 - - - - - - BREAKER28 - - - false - false - - - T3_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE94 - - - - T3_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR56 - - - false - false - - - T3_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE95 - - - - BAY_68-116_0 - - - - 68-116_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR57 - - - false - false - - - 68-116_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE96 - - - - 68-116_0_ADDB1 - 1 - - - - - - BREAKER29 - - - false - false - - - 68-116_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE97 - - - - 68-116_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR58 - - - false - false - - - 68-116_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE98 - - - - BAY_71-73_0 - - - - 71-73_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR59 - - - false - false - - - 71-73_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE100 - - - - 71-73_0_ADDB1 - 1 - - - - - - BREAKER30 - - - false - false - - - 71-73_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE101 - - - - 71-73_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR60 - - - false - false - - - 71-73_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE102 - - - - GEN_A1 - - - - - _CA_A1 - - - - 5 - 1 - - - 4 - 1 - - - 6 - 1 - - - 7 - 1 - - - 3 - 1 - - - 2 - 1 - - - HG2 - 1 - - - HG1 - 1 - - - H - 1 - - - 1 - 1 - - - 8 - 1 - - - Container for Line-7 - - - - Container for Line-4 - - - - Container for Line-5 - - - - Container for Line-1 - - - - Container for Line-6 - - - - Container for Line-2 - - - - Container for Line-3 - - - - TwinBrch SM - - - - - PATLT - 4000 - - - - - Normal - - - 525 - - - Normal - - - 1155 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 481 - - - Normal - - - 5498 - - - Normal - - - 4123 - - - Normal - - - 753 - - - Normal - - - 962 - - - Normal - - - 1683 - - - Normal - - - 505 - - - Normal - - - 505 - - - Normal - - - 1683 - - - Normal - - - 962 - - - Normal - - - 1000 - - - Normal - - - 1000 - - \ No newline at end of file diff --git a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_missing_voltage_level/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml b/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_missing_voltage_level/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml deleted file mode 100644 index 9b7ef2f758a..00000000000 --- a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_missing_voltage_level/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml +++ /dev/null @@ -1,4480 +0,0 @@ - - - - 2030-01-02T09:00:00 - 2015-02-05T12:20:50.830 - CGMES Conformity Assessment: Mini Grid Base Case Test Configuration. The model is owned by ENTSO-E and is provided by ENTSO-E "as it is". To the fullest extent permitted by law, ENTSO-E shall not be liable for any damages of any kind arising out of the use of the model (including any of its subsequent modifications). ENTSO-E neither warrants, nor represents that the use of the model will not infringe the rights of third parties. Any use of the model shall include a reference to ENTSO-E. ENTSO-E web site is the only official source of information related to the model. - 4 - http://entsoe.eu/CIM/EquipmentCore/3/1 - http://entsoe.eu/CIM/EquipmentOperation/3/1 - http://entsoe.eu/CIM/EquipmentShortCircuit/3/1 - http://A1.de/Planning/ENTSOE/2 - - - - - L5_0 - 1 - - - - - - L5_1 - 2 - - - - - - L6_0 - 1 - - - - - - L6_1 - 2 - - - - - - L4_0 - 1 - - - - - - L4_1 - 2 - - - - - - L1_0 - 1 - - - - - - L1_1 - 2 - - - - - - L2_0 - 1 - - - - - - L2_1 - 2 - - - - - - L3_a_0 - 1 - - - - - - L3_a_1 - 2 - - - - - - L3_b_0 - 1 - - - - - - L3_b_1 - 2 - - - - - - T5_0 - 1 - - - - - - T5_1 - 2 - - - - - - T6_0 - 1 - - - - - - T6_1 - 2 - - - - - - T2_0 - 1 - - - - - - T2_1 - 2 - - - - - - T1_0 - 1 - - - - - - T1_1 - 2 - - - - - - T4_0 - 1 - - - - - - T4_1 - 2 - - - - - - T4_2 - 3 - - - - - - T3_0 - 1 - - - - - - T3_1 - 2 - - - - - - T3_2 - 3 - - - - - - G2_0 - 1 - - - - - - G1_0 - 1 - - - - - - G3_0 - 1 - - - - - - M1_0 - 1 - - - - - - M2_0 - 1 - - - - - - ASM-1229750300_0 - 1 - - - - - - Q1_0 - 1 - - - - - - Q2_0 - 1 - - - - - - 380kV - 380 - - - 21kV - 21 - - - 10kV - 10 - - - 110kV - 110 - - - 30kV - 30 - - - - S5 10kV - - - - - S4 10kV - - - - - S3 21kV - - - - - S2 110kV - - - - - S3 110kV - - - - - S1 380kV - - - - - S1 30kV - - - - - S4 110kV - - - - - S1 110kV - - - - - Sub1 - - - - Sub2 - - - - Sub3 - - - - Sub4 - - - - Sub5 - - - - AA - - - Z1 - - - - PATL - 45000 - - - - - TATL - 900 - - - - - TATL - 60 - - - - - Gen-1 - G2 - false - - 0 - 127.5 - 0 - - - G2 - - - 0.9 - 100 - 10.5 - - false - 43.6 - -43.6 - 100 - 0 - 0.004535 - 0.16 - 2 - 2 - - - 7.5 - 0.005 - 0.1 - 0.16 - - - Gen-2 - G1 - false - - 0 - 90 - 0 - - - G1 - - 0.85 - 150 - 21 - - false - 79 - -79 - 100 - 0 - 0.00068 - 0.14 - 1.8 - 1.8 - - - 0.002 - 0.1 - 0.14 - - - Gen-3 - G3 - false - - 0 - 8 - 0 - - - G3 - - 0.8 - 10 - 10.5 - - false - 6 - -6 - 100 - 0 - 0.00163 - 0.1 - 1.8 - 1.8 - - - 0.018 - 0.08 - 0.1 - - - M3 - false - - 0.88 - 5.828 - 10 - false - 97.5 - 5 - 1 - 5 - false - 0.1 - - - M2a - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - M2b - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - Q1 - - 0 - true - 38000 - 800 - 600 - 0.15 - 0.1 - 3.029 - 0 - -800 - -600 - 0.1 - 0.1 - 1 - 1.1 - - - Q2 - - 0 - true - 16000 - 88 - 66 - 0.2 - 0.1 - 3.34865 - 0 - -88 - -66 - 0 - 0 - 0 - 1.1 - - - Line-7 - L5 - false - - - 15 - 0 - 0 - 0 - 0 - 1.8 - 3.3 - 80 - 5.79 - 16.5 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-4 - L6 - false - - - 1 - 0 - 0 - 0 - 0 - 0.082 - 0.082 - 80 - 0.086 - 0.086 - - - Ratings - - - - Normal - - - 1155 - - - ShortTerm - - - 1328 - - - Emergency - - - 1617 - - - Line-5 - L4 - false - - - 10 - 0 - 0 - 0 - 0 - 0.96 - 2.2 - 80 - 3.88 - 11 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-1 - L1 - false - - - 20 - 0 - 0 - 0 - 0 - 2.4 - 6.4 - 80 - 7.8 - 25.2 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-6 - L2 - false - - - 10 - 0 - 0 - 0 - 0 - 1.2 - 3.2 - 80 - 3.9 - 12.6 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-2 - L3_a - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-3 - L3_b - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Trafo-1 - T5 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T5 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T5 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-2 - T6 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T6 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T6 - 0 - 2 - true - 100 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-3 - T2 - false - - 115 - true - false - - - T2 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 100 - 0 - 120 - 0 - 0.72 - 0.72 - 17.2649937 - 17.2649937 - - - - Ratings - - - - Normal - - - 481 - - - ShortTerm - - - 553 - - - Emergency - - - 673 - - - T2 - 2 - false - - - 0 - - 0 - 5 - 100 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 5498 - - - ShortTerm - - - 6323 - - - Emergency - - - 7698 - - - Trafo-4 - T1 - false - - 115 - true - false - - - T1 - 2 - false - - - 0 - - 0 - 5 - 150 - 0 - 21 - 0 - 0.0147 - 0.0147 - 0.47017 - 0.446662 - - - - Ratings - - - - Normal - - - 4123 - - - ShortTerm - - - 4742 - - - Emergency - - - 5773 - - - T1 - 25 - 1 - true - 13 - 21 - 13 - - 1 - - - - T1 - 0 - 1 - true - 22 - - - 0 - - 0 - 0 - 150 - 0 - 115 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 753 - - - ShortTerm - - - 866 - - - Emergency - - - 1054 - - - T4 - false - - false - - - T4 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.0254571438 - 0.0254571438 - 1.259741 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 0 - 2 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T4 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - Trafo-5 - T3 - false - - false - - - T3 - 0 - 1 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - T3 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - T3 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T3 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.02545714286 - 0.02545714286 - 1.259740894 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - 68-116_0 - 1 - - - - - - 68-116_1 - 2 - - - - - - Injection_0 - 1 - - - - - - 71-73_0 - 1 - - - - - - 71-73_1 - 2 - - - - - - Injection_0 - 1 - - - - - - XQ1-N1 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - XQ2-N5 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - Injection1 - - - 0.63185 - 2.85315 - 0.63185 - false - 6.3185 - 19.021 - 6.3185 - - - Injection2 - - - 0.43445 - 2.86738 - 0.43445 - false - 4.3445 - 14.3369 - 4.3445 - - - CONNECTIVITY_NODE1 - - - - BUSBAR1 - - - - - L5_0_BUSBAR - 1 - - - - - - BAY_L5_0 - - - - L5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR1 - - - false - false - - - L5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE2 - - - - L5_0_ADDB1 - 1 - - - - - - BREAKER1 - - - false - false - - - L5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE3 - - - - L5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR2 - - - false - false - - - L5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE4 - - - - CONNECTIVITY_NODE5 - - - - BUSBAR2 - - - - - L5_1_BUSBAR - 2 - - - - - - BAY_L5_1 - - - - L5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR3 - - - false - false - - - L5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE6 - - - - L5_1_ADDB1 - 1 - - - - - - BREAKER2 - - - false - false - - - L5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE7 - - - - L5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR4 - - - false - false - - - L5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE8 - - - - CONNECTIVITY_NODE9 - - - - BUSBAR3 - - - - - L6_0_BUSBAR - 1 - - - - - - BAY_L6_0 - - - - L6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR5 - - - false - false - - - L6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE10 - - - - L6_0_ADDB1 - 1 - - - - - - BREAKER3 - - - false - false - - - L6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE11 - - - - L6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR6 - - - false - false - - - L6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE12 - - - - CONNECTIVITY_NODE13 - - - - BUSBAR4 - - - - - L6_1_BUSBAR - 2 - - - - - - BAY_L6_1 - - - - L6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR7 - - - false - false - - - L6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE14 - - - - L6_1_ADDB1 - 1 - - - - - - BREAKER4 - - - false - false - - - L6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE15 - - - - L6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR8 - - - false - false - - - L6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE16 - - - - BAY_L4_0 - - - - L4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR9 - - - false - false - - - L4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE17 - - - - L4_0_ADDB1 - 1 - - - - - - BREAKER5 - - - false - false - - - L4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE18 - - - - L4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR10 - - - false - false - - - L4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE19 - - - - CONNECTIVITY_NODE20 - - - - BUSBAR5 - - - - - L4_1_BUSBAR - 2 - - - - - - BAY_L4_1 - - - - L4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR11 - - - false - false - - - L4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE21 - - - - L4_1_ADDB1 - 1 - - - - - - BREAKER6 - - - false - false - - - L4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE22 - - - - L4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR12 - - - false - false - - - L4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE23 - - - - CONNECTIVITY_NODE24 - - - - BUSBAR6 - - - - - L1_0_BUSBAR - 1 - - - - - - BAY_L1_0 - - - - L1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR13 - - - false - false - - - L1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE25 - - - - L1_0_ADDB1 - 1 - - - - - - BREAKER7 - - - false - false - - - L1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE26 - - - - L1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR14 - - - false - false - - - L1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE27 - - - - BAY_L1_1 - - - - L1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR15 - - - false - false - - - L1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE28 - - - - L1_1_ADDB1 - 1 - - - - - - BREAKER8 - - - false - false - - - L1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE29 - - - - L1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR16 - - - false - false - - - L1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE30 - - - - BAY_L2_0 - - - - L2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR17 - - - false - false - - - L2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE31 - - - - L2_0_ADDB1 - 1 - - - - - - BREAKER9 - - - false - false - - - L2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE32 - - - - L2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR18 - - - false - false - - - L2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE33 - - - - BAY_L2_1 - - - - L2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR19 - - - false - false - - - L2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE34 - - - - L2_1_ADDB1 - 1 - - - - - - BREAKER10 - - - false - false - - - L2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE35 - - - - L2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR20 - - - false - false - - - L2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE36 - - - - BAY_L3_a_0 - - - - L3_a_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR21 - - - false - false - - - L3_a_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE37 - - - - L3_a_0_ADDB1 - 1 - - - - - - BREAKER11 - - - false - false - - - L3_a_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE38 - - - - L3_a_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR22 - - - false - false - - - L3_a_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE39 - - - - BAY_L3_a_1 - - - - L3_a_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR23 - - - false - false - - - L3_a_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE40 - - - - L3_a_1_ADDB1 - 1 - - - - - - BREAKER12 - - - false - false - - - L3_a_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE41 - - - - L3_a_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR24 - - - false - false - - - L3_a_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE42 - - - - BAY_L3_b_0 - - - - L3_b_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR25 - - - false - false - - - L3_b_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE43 - - - - L3_b_0_ADDB1 - 1 - - - - - - BREAKER13 - - - false - false - - - L3_b_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE44 - - - - L3_b_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR26 - - - false - false - - - L3_b_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE45 - - - - BAY_L3_b_1 - - - - L3_b_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR27 - - - false - false - - - L3_b_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE46 - - - - L3_b_1_ADDB1 - 1 - - - - - - BREAKER14 - - - false - false - - - L3_b_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE47 - - - - L3_b_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR28 - - - false - false - - - L3_b_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE48 - - - - BAY_T5_0 - - - - T5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR29 - - - false - false - - - T5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE49 - - - - T5_0_ADDB1 - 1 - - - - - - BREAKER15 - - - false - false - - - T5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE50 - - - - T5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR30 - - - false - false - - - T5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE51 - - - - BAY_T5_1 - - - - T5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR31 - - - false - false - - - T5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE52 - - - - T5_1_ADDB1 - 1 - - - - - - BREAKER16 - - - false - false - - - T5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE53 - - - - T5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR32 - - - false - false - - - T5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE54 - - - - BAY_T6_0 - - - - T6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR33 - - - false - false - - - T6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE55 - - - - T6_0_ADDB1 - 1 - - - - - - BREAKER17 - - - false - false - - - T6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE56 - - - - T6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR34 - - - false - false - - - T6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE57 - - - - BAY_T6_1 - - - - T6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR35 - - - false - false - - - T6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE58 - - - - T6_1_ADDB1 - 1 - - - - - - BREAKER18 - - - false - false - - - T6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE59 - - - - T6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR36 - - - false - false - - - T6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE60 - - - - BAY_T2_0 - - - - T2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR37 - - - false - false - - - T2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE61 - - - - T2_0_ADDB1 - 1 - - - - - - BREAKER19 - - - false - false - - - T2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE62 - - - - T2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR38 - - - false - false - - - T2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE63 - - - - CONNECTIVITY_NODE64 - - - - BUSBAR7 - - - - - T2_1_BUSBAR - 2 - - - - - - BAY_T2_1 - - - - T2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR39 - - - false - false - - - T2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE65 - - - - T2_1_ADDB1 - 1 - - - - - - BREAKER20 - - - false - false - - - T2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE66 - - - - T2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR40 - - - false - false - - - T2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE67 - - - - CONNECTIVITY_NODE68 - - - - BUSBAR8 - - - - - T1_0_BUSBAR - 1 - - - - - - BAY_T1_0 - - - - T1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR41 - - - false - false - - - T1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE69 - - - - T1_0_ADDB1 - 1 - - - - - - BREAKER21 - - - false - false - - - T1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE70 - - - - T1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR42 - - - false - false - - - T1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE71 - - - - BAY_T1_1 - - - - T1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR43 - - - false - false - - - T1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE72 - - - - T1_1_ADDB1 - 1 - - - - - - BREAKER22 - - - false - false - - - T1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE73 - - - - T1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR44 - - - false - false - - - T1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE74 - - - - CONNECTIVITY_NODE75 - - - - BUSBAR9 - - - - - T4_0_BUSBAR - 1 - - - - - - BAY_T4_0 - - - - T4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR45 - - - false - false - - - T4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE76 - - - - T4_0_ADDB1 - 1 - - - - - - BREAKER23 - - - false - false - - - T4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE77 - - - - T4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR46 - - - false - false - - - T4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE78 - - - - BAY_T4_1 - - - - T4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR47 - - - false - false - - - T4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE79 - - - - T4_1_ADDB1 - 1 - - - - - - BREAKER24 - - - false - false - - - T4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE80 - - - - T4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR48 - - - false - false - - - T4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE81 - - - - CONNECTIVITY_NODE82 - - - - BUSBAR10 - - - - - T4_2_BUSBAR - 3 - - - - - - BAY_T4_2 - - - - T4_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR49 - - - false - false - - - T4_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE83 - - - - T4_2_ADDB1 - 1 - - - - - - BREAKER25 - - - false - false - - - T4_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE84 - - - - T4_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR50 - - - false - false - - - T4_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE85 - - - - BAY_T3_0 - - - - T3_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR51 - - - false - false - - - T3_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE86 - - - - T3_0_ADDB1 - 1 - - - - - - BREAKER26 - - - false - false - - - T3_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE87 - - - - T3_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR52 - - - false - false - - - T3_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE88 - - - - BAY_T3_1 - - - - T3_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR53 - - - false - false - - - T3_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE89 - - - - T3_1_ADDB1 - 1 - - - - - - BREAKER27 - - - false - false - - - T3_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE90 - - - - T3_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR54 - - - false - false - - - T3_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE91 - - - - CONNECTIVITY_NODE92 - - - - BUSBAR11 - - - - - T3_2_BUSBAR - 3 - - - - - - BAY_T3_2 - - - - T3_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR55 - - - false - false - - - T3_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE93 - - - - T3_2_ADDB1 - 1 - - - - - - BREAKER28 - - - false - false - - - T3_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE94 - - - - T3_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR56 - - - false - false - - - T3_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE95 - - - - BAY_68-116_0 - - - - 68-116_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR57 - - - false - false - - - 68-116_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE96 - - - - 68-116_0_ADDB1 - 1 - - - - - - BREAKER29 - - - false - false - - - 68-116_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE97 - - - - 68-116_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR58 - - - false - false - - - 68-116_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE98 - - - - BAY_71-73_0 - - - - 71-73_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR59 - - - false - false - - - 71-73_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE100 - - - - 71-73_0_ADDB1 - 1 - - - - - - BREAKER30 - - - false - false - - - 71-73_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE101 - - - - 71-73_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR60 - - - false - false - - - 71-73_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE102 - - - - GEN_A1 - - - - - _CA_A1 - - - - 5 - 1 - - - 4 - 1 - - - 6 - 1 - - - 7 - 1 - - - 3 - 1 - - - 2 - 1 - - - HG2 - 1 - - - HG1 - 1 - - - H - 1 - - - 1 - 1 - - - 8 - 1 - - - Container for Line-7 - - - - Container for Line-4 - - - - Container for Line-5 - - - - Container for Line-1 - - - - Container for Line-6 - - - - Container for Line-2 - - - - Container for Line-3 - - - - TwinBrch SM - - - - - PATLT - 4000 - - - - - Normal - - - 525 - - - Normal - - - 1155 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 481 - - - Normal - - - 5498 - - - Normal - - - 4123 - - - Normal - - - 753 - - - Normal - - - 962 - - - Normal - - - 1683 - - - Normal - - - 505 - - - Normal - - - 505 - - - Normal - - - 1683 - - - Normal - - - 962 - - - Normal - - - 1000 - - - Normal - - - 1000 - - diff --git a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_substation_node/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml b/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_substation_node/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml deleted file mode 100644 index e9091d3c372..00000000000 --- a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_substation_node/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml +++ /dev/null @@ -1,4517 +0,0 @@ - - - - 2030-01-02T09:00:00 - 2015-02-05T12:20:50.830 - CGMES Conformity Assessment: Mini Grid Base Case Test Configuration. The model is owned by ENTSO-E and is provided by ENTSO-E "as it is". To the fullest extent permitted by law, ENTSO-E shall not be liable for any damages of any kind arising out of the use of the model (including any of its subsequent modifications). ENTSO-E neither warrants, nor represents that the use of the model will not infringe the rights of third parties. Any use of the model shall include a reference to ENTSO-E. ENTSO-E web site is the only official source of information related to the model. - 4 - http://entsoe.eu/CIM/EquipmentCore/3/1 - http://entsoe.eu/CIM/EquipmentOperation/3/1 - http://entsoe.eu/CIM/EquipmentShortCircuit/3/1 - http://A1.de/Planning/ENTSOE/2 - - - - - L5_0 - 1 - - - - - - L5_1 - 2 - - - - - - L6_0 - 1 - - - - - - L6_1 - 2 - - - - - - L4_0 - 1 - - - - - - L4_1 - 2 - - - - - - L1_0 - 1 - - - - - - L1_1 - 2 - - - - - - L2_0 - 1 - - - - - - L2_1 - 2 - - - - - - L3_a_0 - 1 - - - - - - L3_a_1 - 2 - - - - - - L3_b_0 - 1 - - - - - - L3_b_1 - 2 - - - - - - T5_0 - 1 - - - - - - T5_1 - 2 - - - - - - T6_0 - 1 - - - - - - T6_1 - 2 - - - - - - T2_0 - 1 - - - - - - T2_1 - 2 - - - - - - T1_0 - 1 - - - - - - T1_1 - 2 - - - - - - T4_0 - 1 - - - - - - T4_1 - 2 - - - - - - T4_2 - 3 - - - - - - T3_0 - 1 - - - - - - T3_1 - 2 - - - - - - T3_2 - 3 - - - - - - G2_0 - 1 - - - - - - G1_0 - 1 - - - - - - G3_0 - 1 - - - - - - M1_0 - 1 - - - - - - M2_0 - 1 - - - - - - ASM-1229750300_0 - 1 - - - - - - Q1_0 - 1 - - - - - - Q2_0 - 1 - - - - - - 380kV - 380 - - - 21kV - 21 - - - 10kV - 10 - - - 110kV - 110 - - - 30kV - 30 - - - S2 10kV - - - - - S5 10kV - - - - - S4 10kV - - - - - S3 21kV - - - - - S2 110kV - - - - - S3 110kV - - - - - S1 380kV - - - - - S1 30kV - - - - - S4 110kV - - - - - S1 110kV - - - - - Sub1 - - - - - CONNECTIVITY_NODE_TEST - - - - TEST_TERMINAL_0 - 1 - - - - - - TEST_LOAD - false - - - - TEST_BREAKER - - - false - false - - - TEST_TERMINAL_1 - 1 - - - - - - TEST_TERMINAL_2 - 2 - - - - - - - Sub2 - - - - Sub3 - - - - Sub4 - - - - Sub5 - - - - AA - - - Z1 - - - - PATL - 45000 - - - - - TATL - 900 - - - - - TATL - 60 - - - - - Gen-1 - G2 - false - - 0 - 127.5 - 0 - - - G2 - - - 0.9 - 100 - 10.5 - - false - 43.6 - -43.6 - 100 - 0 - 0.004535 - 0.16 - 2 - 2 - - - 7.5 - 0.005 - 0.1 - 0.16 - - - Gen-2 - G1 - false - - 0 - 90 - 0 - - - G1 - - 0.85 - 150 - 21 - - false - 79 - -79 - 100 - 0 - 0.00068 - 0.14 - 1.8 - 1.8 - - - 0.002 - 0.1 - 0.14 - - - Gen-3 - G3 - false - - 0 - 8 - 0 - - - G3 - - 0.8 - 10 - 10.5 - - false - 6 - -6 - 100 - 0 - 0.00163 - 0.1 - 1.8 - 1.8 - - - 0.018 - 0.08 - 0.1 - - - M3 - false - - 0.88 - 5.828 - 10 - false - 97.5 - 5 - 1 - 5 - false - 0.1 - - - M2a - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - M2b - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - Q1 - - 0 - true - 38000 - 800 - 600 - 0.15 - 0.1 - 3.029 - 0 - -800 - -600 - 0.1 - 0.1 - 1 - 1.1 - - - Q2 - - 0 - true - 16000 - 88 - 66 - 0.2 - 0.1 - 3.34865 - 0 - -88 - -66 - 0 - 0 - 0 - 1.1 - - - Line-7 - L5 - false - - - 15 - 0 - 0 - 0 - 0 - 1.8 - 3.3 - 80 - 5.79 - 16.5 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-4 - L6 - false - - - 1 - 0 - 0 - 0 - 0 - 0.082 - 0.082 - 80 - 0.086 - 0.086 - - - Ratings - - - - Normal - - - 1155 - - - ShortTerm - - - 1328 - - - Emergency - - - 1617 - - - Line-5 - L4 - false - - - 10 - 0 - 0 - 0 - 0 - 0.96 - 2.2 - 80 - 3.88 - 11 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-1 - L1 - false - - - 20 - 0 - 0 - 0 - 0 - 2.4 - 6.4 - 80 - 7.8 - 25.2 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-6 - L2 - false - - - 10 - 0 - 0 - 0 - 0 - 1.2 - 3.2 - 80 - 3.9 - 12.6 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-2 - L3_a - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-3 - L3_b - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Trafo-1 - T5 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T5 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T5 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-2 - T6 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T6 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T6 - 0 - 2 - true - 100 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-3 - T2 - false - - 115 - true - false - - - T2 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 100 - 0 - 120 - 0 - 0.72 - 0.72 - 17.2649937 - 17.2649937 - - - - Ratings - - - - Normal - - - 481 - - - ShortTerm - - - 553 - - - Emergency - - - 673 - - - T2 - 2 - false - - - 0 - - 0 - 5 - 100 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 5498 - - - ShortTerm - - - 6323 - - - Emergency - - - 7698 - - - Trafo-4 - T1 - false - - 115 - true - false - - - T1 - 2 - false - - - 0 - - 0 - 5 - 150 - 0 - 21 - 0 - 0.0147 - 0.0147 - 0.47017 - 0.446662 - - - - Ratings - - - - Normal - - - 4123 - - - ShortTerm - - - 4742 - - - Emergency - - - 5773 - - - T1 - 25 - 1 - true - 13 - 21 - 13 - - 1 - - - - T1 - 0 - 1 - true - 22 - - - 0 - - 0 - 0 - 150 - 0 - 115 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 753 - - - ShortTerm - - - 866 - - - Emergency - - - 1054 - - - T4 - false - - false - - - T4 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.0254571438 - 0.0254571438 - 1.259741 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 0 - 2 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T4 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - Trafo-5 - T3 - false - - false - - - T3 - 0 - 1 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - T3 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - T3 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T3 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.02545714286 - 0.02545714286 - 1.259740894 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - 68-116_0 - 1 - - - - - - 68-116_1 - 2 - - - - - - Injection_0 - 1 - - - - - - 71-73_0 - 1 - - - - - - 71-73_1 - 2 - - - - - - Injection_0 - 1 - - - - - - XQ1-N1 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - XQ2-N5 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - Injection1 - - - 0.63185 - 2.85315 - 0.63185 - false - 6.3185 - 19.021 - 6.3185 - - - Injection2 - - - 0.43445 - 2.86738 - 0.43445 - false - 4.3445 - 14.3369 - 4.3445 - - - CONNECTIVITY_NODE1 - - - - BUSBAR1 - - - - - L5_0_BUSBAR - 1 - - - - - - BAY_L5_0 - - - - L5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR1 - - - false - false - - - L5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE2 - - - - L5_0_ADDB1 - 1 - - - - - - BREAKER1 - - - false - false - - - L5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE3 - - - - L5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR2 - - - false - false - - - L5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE4 - - - - CONNECTIVITY_NODE5 - - - - BUSBAR2 - - - - - L5_1_BUSBAR - 2 - - - - - - BAY_L5_1 - - - - L5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR3 - - - false - false - - - L5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE6 - - - - L5_1_ADDB1 - 1 - - - - - - BREAKER2 - - - false - false - - - L5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE7 - - - - L5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR4 - - - false - false - - - L5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE8 - - - - CONNECTIVITY_NODE9 - - - - BUSBAR3 - - - - - L6_0_BUSBAR - 1 - - - - - - BAY_L6_0 - - - - L6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR5 - - - false - false - - - L6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE10 - - - - L6_0_ADDB1 - 1 - - - - - - BREAKER3 - - - false - false - - - L6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE11 - - - - L6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR6 - - - false - false - - - L6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE12 - - - - CONNECTIVITY_NODE13 - - - - BUSBAR4 - - - - - L6_1_BUSBAR - 2 - - - - - - BAY_L6_1 - - - - L6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR7 - - - false - false - - - L6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE14 - - - - L6_1_ADDB1 - 1 - - - - - - BREAKER4 - - - false - false - - - L6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE15 - - - - L6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR8 - - - false - false - - - L6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE16 - - - - BAY_L4_0 - - - - L4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR9 - - - false - false - - - L4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE17 - - - - L4_0_ADDB1 - 1 - - - - - - BREAKER5 - - - false - false - - - L4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE18 - - - - L4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR10 - - - false - false - - - L4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE19 - - - - CONNECTIVITY_NODE20 - - - - BUSBAR5 - - - - - L4_1_BUSBAR - 2 - - - - - - BAY_L4_1 - - - - L4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR11 - - - false - false - - - L4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE21 - - - - L4_1_ADDB1 - 1 - - - - - - BREAKER6 - - - false - false - - - L4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE22 - - - - L4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR12 - - - false - false - - - L4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE23 - - - - CONNECTIVITY_NODE24 - - - - BUSBAR6 - - - - - L1_0_BUSBAR - 1 - - - - - - BAY_L1_0 - - - - L1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR13 - - - false - false - - - L1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE25 - - - - L1_0_ADDB1 - 1 - - - - - - BREAKER7 - - - false - false - - - L1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE26 - - - - L1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR14 - - - false - false - - - L1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE27 - - - - BAY_L1_1 - - - - L1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR15 - - - false - false - - - L1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE28 - - - - L1_1_ADDB1 - 1 - - - - - - BREAKER8 - - - false - false - - - L1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE29 - - - - L1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR16 - - - false - false - - - L1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE30 - - - - BAY_L2_0 - - - - L2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR17 - - - false - false - - - L2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE31 - - - - L2_0_ADDB1 - 1 - - - - - - BREAKER9 - - - false - false - - - L2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE32 - - - - L2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR18 - - - false - false - - - L2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE33 - - - - BAY_L2_1 - - - - L2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR19 - - - false - false - - - L2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE34 - - - - L2_1_ADDB1 - 1 - - - - - - BREAKER10 - - - false - false - - - L2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE35 - - - - L2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR20 - - - false - false - - - L2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE36 - - - - BAY_L3_a_0 - - - - L3_a_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR21 - - - false - false - - - L3_a_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE37 - - - - L3_a_0_ADDB1 - 1 - - - - - - BREAKER11 - - - false - false - - - L3_a_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE38 - - - - L3_a_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR22 - - - false - false - - - L3_a_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE39 - - - - BAY_L3_a_1 - - - - L3_a_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR23 - - - false - false - - - L3_a_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE40 - - - - L3_a_1_ADDB1 - 1 - - - - - - BREAKER12 - - - false - false - - - L3_a_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE41 - - - - L3_a_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR24 - - - false - false - - - L3_a_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE42 - - - - BAY_L3_b_0 - - - - L3_b_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR25 - - - false - false - - - L3_b_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE43 - - - - L3_b_0_ADDB1 - 1 - - - - - - BREAKER13 - - - false - false - - - L3_b_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE44 - - - - L3_b_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR26 - - - false - false - - - L3_b_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE45 - - - - BAY_L3_b_1 - - - - L3_b_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR27 - - - false - false - - - L3_b_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE46 - - - - L3_b_1_ADDB1 - 1 - - - - - - BREAKER14 - - - false - false - - - L3_b_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE47 - - - - L3_b_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR28 - - - false - false - - - L3_b_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE48 - - - - BAY_T5_0 - - - - T5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR29 - - - false - false - - - T5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE49 - - - - T5_0_ADDB1 - 1 - - - - - - BREAKER15 - - - false - false - - - T5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE50 - - - - T5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR30 - - - false - false - - - T5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE51 - - - - BAY_T5_1 - - - - T5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR31 - - - false - false - - - T5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE52 - - - - T5_1_ADDB1 - 1 - - - - - - BREAKER16 - - - false - false - - - T5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE53 - - - - T5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR32 - - - false - false - - - T5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE54 - - - - BAY_T6_0 - - - - T6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR33 - - - false - false - - - T6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE55 - - - - T6_0_ADDB1 - 1 - - - - - - BREAKER17 - - - false - false - - - T6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE56 - - - - T6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR34 - - - false - false - - - T6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE57 - - - - BAY_T6_1 - - - - T6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR35 - - - false - false - - - T6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE58 - - - - T6_1_ADDB1 - 1 - - - - - - BREAKER18 - - - false - false - - - T6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE59 - - - - T6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR36 - - - false - false - - - T6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE60 - - - - BAY_T2_0 - - - - T2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR37 - - - false - false - - - T2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE61 - - - - T2_0_ADDB1 - 1 - - - - - - BREAKER19 - - - false - false - - - T2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE62 - - - - T2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR38 - - - false - false - - - T2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE63 - - - - CONNECTIVITY_NODE64 - - - - BUSBAR7 - - - - - T2_1_BUSBAR - 2 - - - - - - BAY_T2_1 - - - - T2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR39 - - - false - false - - - T2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE65 - - - - T2_1_ADDB1 - 1 - - - - - - BREAKER20 - - - false - false - - - T2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE66 - - - - T2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR40 - - - false - false - - - T2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE67 - - - - CONNECTIVITY_NODE68 - - - - BUSBAR8 - - - - - T1_0_BUSBAR - 1 - - - - - - BAY_T1_0 - - - - T1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR41 - - - false - false - - - T1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE69 - - - - T1_0_ADDB1 - 1 - - - - - - BREAKER21 - - - false - false - - - T1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE70 - - - - T1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR42 - - - false - false - - - T1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE71 - - - - BAY_T1_1 - - - - T1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR43 - - - false - false - - - T1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE72 - - - - T1_1_ADDB1 - 1 - - - - - - BREAKER22 - - - false - false - - - T1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE73 - - - - T1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR44 - - - false - false - - - T1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE74 - - - - CONNECTIVITY_NODE75 - - - - BUSBAR9 - - - - - T4_0_BUSBAR - 1 - - - - - - BAY_T4_0 - - - - T4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR45 - - - false - false - - - T4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE76 - - - - T4_0_ADDB1 - 1 - - - - - - BREAKER23 - - - false - false - - - T4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE77 - - - - T4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR46 - - - false - false - - - T4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE78 - - - - BAY_T4_1 - - - - T4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR47 - - - false - false - - - T4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE79 - - - - T4_1_ADDB1 - 1 - - - - - - BREAKER24 - - - false - false - - - T4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE80 - - - - T4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR48 - - - false - false - - - T4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE81 - - - - CONNECTIVITY_NODE82 - - - - BUSBAR10 - - - - - T4_2_BUSBAR - 3 - - - - - - BAY_T4_2 - - - - T4_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR49 - - - false - false - - - T4_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE83 - - - - T4_2_ADDB1 - 1 - - - - - - BREAKER25 - - - false - false - - - T4_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE84 - - - - T4_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR50 - - - false - false - - - T4_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE85 - - - - BAY_T3_0 - - - - T3_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR51 - - - false - false - - - T3_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE86 - - - - T3_0_ADDB1 - 1 - - - - - - BREAKER26 - - - false - false - - - T3_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE87 - - - - T3_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR52 - - - false - false - - - T3_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE88 - - - - BAY_T3_1 - - - - T3_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR53 - - - false - false - - - T3_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE89 - - - - T3_1_ADDB1 - 1 - - - - - - BREAKER27 - - - false - false - - - T3_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE90 - - - - T3_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR54 - - - false - false - - - T3_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE91 - - - - CONNECTIVITY_NODE92 - - - - BUSBAR11 - - - - - T3_2_BUSBAR - 3 - - - - - - BAY_T3_2 - - - - T3_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR55 - - - false - false - - - T3_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE93 - - - - T3_2_ADDB1 - 1 - - - - - - BREAKER28 - - - false - false - - - T3_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE94 - - - - T3_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR56 - - - false - false - - - T3_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE95 - - - - BAY_68-116_0 - - - - 68-116_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR57 - - - false - false - - - 68-116_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE96 - - - - 68-116_0_ADDB1 - 1 - - - - - - BREAKER29 - - - false - false - - - 68-116_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE97 - - - - 68-116_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR58 - - - false - false - - - 68-116_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE98 - - - - BAY_71-73_0 - - - - 71-73_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR59 - - - false - false - - - 71-73_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE100 - - - - 71-73_0_ADDB1 - 1 - - - - - - BREAKER30 - - - false - false - - - 71-73_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE101 - - - - 71-73_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR60 - - - false - false - - - 71-73_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE102 - - - - GEN_A1 - - - - - _CA_A1 - - - - 5 - 1 - - - 4 - 1 - - - 6 - 1 - - - 7 - 1 - - - 3 - 1 - - - 2 - 1 - - - HG2 - 1 - - - HG1 - 1 - - - H - 1 - - - 1 - 1 - - - 8 - 1 - - - Container for Line-7 - - - - Container for Line-4 - - - - Container for Line-5 - - - - Container for Line-1 - - - - Container for Line-6 - - - - Container for Line-2 - - - - Container for Line-3 - - - - TwinBrch SM - - - - - PATLT - 4000 - - - - - Normal - - - 525 - - - Normal - - - 1155 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 481 - - - Normal - - - 5498 - - - Normal - - - 4123 - - - Normal - - - 753 - - - Normal - - - 962 - - - Normal - - - 1683 - - - Normal - - - 505 - - - Normal - - - 505 - - - Normal - - - 1683 - - - Normal - - - 962 - - - Normal - - - 1000 - - - Normal - - - 1000 - - \ No newline at end of file diff --git a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switchVLsOpen/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml b/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switchVLsOpen/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml deleted file mode 100644 index eeab428fcc8..00000000000 --- a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switchVLsOpen/MiniGridTestConfiguration_BC_EQ_v3.0.0.xml +++ /dev/null @@ -1,4487 +0,0 @@ - - - - 2030-01-02T09:00:00 - 2015-02-05T12:20:50.830 - CGMES Conformity Assessment: Mini Grid Base Case Test Configuration. The model is owned by ENTSO-E and is provided by ENTSO-E "as it is". To the fullest extent permitted by law, ENTSO-E shall not be liable for any damages of any kind arising out of the use of the model (including any of its subsequent modifications). ENTSO-E neither warrants, nor represents that the use of the model will not infringe the rights of third parties. Any use of the model shall include a reference to ENTSO-E. ENTSO-E web site is the only official source of information related to the model. - 4 - http://entsoe.eu/CIM/EquipmentCore/3/1 - http://entsoe.eu/CIM/EquipmentOperation/3/1 - http://entsoe.eu/CIM/EquipmentShortCircuit/3/1 - http://A1.de/Planning/ENTSOE/2 - - - - - L5_0 - 1 - - - - - - L5_1 - 2 - - - - - - L6_0 - 1 - - - - - - L6_1 - 2 - - - - - - L4_0 - 1 - - - - - - L4_1 - 2 - - - - - - L1_0 - 1 - - - - - - L1_1 - 2 - - - - - - L2_0 - 1 - - - - - - L2_1 - 2 - - - - - - L3_a_0 - 1 - - - - - - L3_a_1 - 2 - - - - - - L3_b_0 - 1 - - - - - - L3_b_1 - 2 - - - - - - T5_0 - 1 - - - - - - T5_1 - 2 - - - - - - T6_0 - 1 - - - - - - T6_1 - 2 - - - - - - T2_0 - 1 - - - - - - T2_1 - 2 - - - - - - T1_0 - 1 - - - - - - T1_1 - 2 - - - - - - T4_0 - 1 - - - - - - T4_1 - 2 - - - - - - T4_2 - 3 - - - - - - T3_0 - 1 - - - - - - T3_1 - 2 - - - - - - T3_2 - 3 - - - - - - G2_0 - 1 - - - - - - G1_0 - 1 - - - - - - G3_0 - 1 - - - - - - M1_0 - 1 - - - - - - M2_0 - 1 - - - - - - ASM-1229750300_0 - 1 - - - - - - Q1_0 - 1 - - - - - - Q2_0 - 1 - - - - - - 380kV - 380 - - - 21kV - 21 - - - 10kV - 10 - - - 110kV - 110 - - - 30kV - 30 - - - S2 10kV - - - - - S5 10kV - - - - - S4 10kV - - - - - S3 21kV - - - - - S2 110kV - - - - - S3 110kV - - - - - S1 380kV - - - - - S1 30kV - - - - - S4 110kV - - - - - S4B 110kV - - - - - S1 110kV - - - - - Sub1 - - - - Sub2 - - - - Sub3 - - - - Sub4 - - - - Sub5 - - - - AA - - - Z1 - - - - PATL - 45000 - - - - - TATL - 900 - - - - - TATL - 60 - - - - - Gen-1 - G2 - false - - 0 - 127.5 - 0 - - - G2 - - - 0.9 - 100 - 10.5 - - false - 43.6 - -43.6 - 100 - 0 - 0.004535 - 0.16 - 2 - 2 - - - 7.5 - 0.005 - 0.1 - 0.16 - - - Gen-2 - G1 - false - - 0 - 90 - 0 - - - G1 - - 0.85 - 150 - 21 - - false - 79 - -79 - 100 - 0 - 0.00068 - 0.14 - 1.8 - 1.8 - - - 0.002 - 0.1 - 0.14 - - - Gen-3 - G3 - false - - 0 - 8 - 0 - - - G3 - - 0.8 - 10 - 10.5 - - false - 6 - -6 - 100 - 0 - 0.00163 - 0.1 - 1.8 - 1.8 - - - 0.018 - 0.08 - 0.1 - - - M3 - false - - 0.88 - 5.828 - 10 - false - 97.5 - 5 - 1 - 5 - false - 0.1 - - - M2a - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - M2b - false - - 0.89 - 2.321 - 10 - false - 96.8 - 5.2 - 2 - 2 - false - 0.1 - - - Q1 - - 0 - true - 38000 - 800 - 600 - 0.15 - 0.1 - 3.029 - 0 - -800 - -600 - 0.1 - 0.1 - 1 - 1.1 - - - Q2 - - 0 - true - 16000 - 88 - 66 - 0.2 - 0.1 - 3.34865 - 0 - -88 - -66 - 0 - 0 - 0 - 1.1 - - - Line-7 - L5 - false - - - 15 - 0 - 0 - 0 - 0 - 1.8 - 3.3 - 80 - 5.79 - 16.5 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-4 - L6 - false - - - 1 - 0 - 0 - 0 - 0 - 0.082 - 0.082 - 80 - 0.086 - 0.086 - - - Ratings - - - - Normal - - - 1155 - - - ShortTerm - - - 1328 - - - Emergency - - - 1617 - - - Line-5 - L4 - false - - - 10 - 0 - 0 - 0 - 0 - 0.96 - 2.2 - 80 - 3.88 - 11 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-1 - L1 - false - - - 20 - 0 - 0 - 0 - 0 - 2.4 - 6.4 - 80 - 7.8 - 25.2 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-6 - L2 - false - - - 10 - 0 - 0 - 0 - 0 - 1.2 - 3.2 - 80 - 3.9 - 12.6 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-2 - L3_a - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Line-3 - L3_b - false - - - 5 - 0 - 0 - 0 - 0 - 0.6 - 2.6 - 80 - 1.95 - 9.3 - - - Ratings - - - - Normal - - - 525 - - - ShortTerm - - - 604 - - - Emergency - - - 735 - - - Trafo-1 - T5 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T5 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T5 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-2 - T6 - false - - 158.14 - 121.095 - 36.86 - false - false - - - T6 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 31.5 - 0 - 115 - 0 - 2.099206 - 2.099206 - 50.3372 - 50.3372 - - - - Ratings - - - - Normal - - - 158 - - - ShortTerm - - - 182 - - - Emergency - - - 222 - - - T6 - 0 - 2 - true - 100 - - - 0 - - 0 - 0 - 31.5 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 1732 - - - ShortTerm - - - 1992 - - - Emergency - - - 2425 - - - Trafo-3 - T2 - false - - 115 - true - false - - - T2 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 100 - 0 - 120 - 0 - 0.72 - 0.72 - 17.2649937 - 17.2649937 - - - - Ratings - - - - Normal - - - 481 - - - ShortTerm - - - 553 - - - Emergency - - - 673 - - - T2 - 2 - false - - - 0 - - 0 - 5 - 100 - 0 - 10.5 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 5498 - - - ShortTerm - - - 6323 - - - Emergency - - - 7698 - - - Trafo-4 - T1 - false - - 115 - true - false - - - T1 - 2 - false - - - 0 - - 0 - 5 - 150 - 0 - 21 - 0 - 0.0147 - 0.0147 - 0.47017 - 0.446662 - - - - Ratings - - - - Normal - - - 4123 - - - ShortTerm - - - 4742 - - - Emergency - - - 5773 - - - T1 - 25 - 1 - true - 13 - 21 - 13 - - 1 - - - - T1 - 0 - 1 - true - 22 - - - 0 - - 0 - 0 - 150 - 0 - 115 - 0 - 0 - 0 - 0 - 0 - - - - Ratings - - - - Normal - - - 753 - - - ShortTerm - - - 866 - - - Emergency - - - 1054 - - - T4 - false - - false - - - T4 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.0254571438 - 0.0254571438 - 1.259741 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 0 - 2 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T4 - 0 - 1 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - Trafo-5 - T3 - false - - false - - - T3 - 0 - 1 - true - 0 - - - 0 - - 0 - 0 - 350 - 0 - 400 - 0 - 0.5942857143 - 0.5942857143 - 96.0051006 - 95.05666 - - - - Ratings - - - - Normal - - - 505 - - - ShortTerm - - - 580 - - - Emergency - - - 707 - - - T3 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - T3 - 0 - 2 - false - 0 - - - 0 - - 0 - 0 - 350 - 0 - 120 - 0 - 0.05348571429 - 0.05348571429 - -0.001121283618 - -0.6881 - - - - Ratings - - - - Normal - - - 1683 - - - ShortTerm - - - 1936 - - - Emergency - - - 2357 - - - T3 - 3 - false - - - 0 - - 0 - 5 - 50 - 0 - 30 - 0 - 0.02545714286 - 0.02545714286 - 1.259740894 - 1.176919 - - - - Ratings - - - - Normal - - - 962 - - - ShortTerm - - - 1106 - - - Emergency - - - 1347 - - - T4 - 33 - 1 - true - 17 - 400 - 17 - - 1 - - - - 68-116_0 - 1 - - - - - - 68-116_1 - 2 - - - - - - Injection_0 - 1 - - - - - - 71-73_0 - 1 - - - - - - 71-73_1 - 2 - - - - - - Injection_0 - 1 - - - - - - XQ1-N1 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - XQ2-N5 - false - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 80 - 0.05 - 0 - - - Ratings - - - - Normal - - - 1000 - - - ShortTerm - - - 1150 - - - Emergency - - - 1400 - - - Injection1 - - - 0.63185 - 2.85315 - 0.63185 - false - 6.3185 - 19.021 - 6.3185 - - - Injection2 - - - 0.43445 - 2.86738 - 0.43445 - false - 4.3445 - 14.3369 - 4.3445 - - - CONNECTIVITY_NODE1 - - - - BUSBAR1 - - - - - L5_0_BUSBAR - 1 - - - - - - BAY_L5_0 - - - - BAY_L5B_0 - - - - L5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR1 - - - false - false - - - L5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE2 - - - - L5_0_ADDB1 - 1 - - - - - - BREAKER1 - - - false - false - - - L5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE3 - - - - L5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR2 - - - false - false - - - L5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE4 - - - - CONNECTIVITY_NODE5 - - - - BUSBAR2 - - - - - L5_1_BUSBAR - 2 - - - - - - BAY_L5_1 - - - - L5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR3 - - - false - false - - - L5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE6 - - - - L5_1_ADDB1 - 1 - - - - - - BREAKER2 - - - false - false - - - L5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE7 - - - - L5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR4 - - - false - false - - - L5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE8 - - - - CONNECTIVITY_NODE9 - - - - BUSBAR3 - - - - - L6_0_BUSBAR - 1 - - - - - - BAY_L6_0 - - - - L6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR5 - - - false - false - - - L6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE10 - - - - L6_0_ADDB1 - 1 - - - - - - BREAKER3 - - - false - false - - - L6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE11 - - - - L6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR6 - - - false - false - - - L6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE12 - - - - CONNECTIVITY_NODE13 - - - - BUSBAR4 - - - - - L6_1_BUSBAR - 2 - - - - - - BAY_L6_1 - - - - L6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR7 - - - false - false - - - L6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE14 - - - - L6_1_ADDB1 - 1 - - - - - - BREAKER4 - - - false - false - - - L6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE15 - - - - L6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR8 - - - false - false - - - L6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE16 - - - - BAY_L4_0 - - - - L4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR9 - - - false - false - - - L4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE17 - - - - L4_0_ADDB1 - 1 - - - - - - BREAKER5 - - - false - false - - - L4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE18 - - - - L4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR10 - - - false - false - - - L4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE19 - - - - CONNECTIVITY_NODE20 - - - - BUSBAR5 - - - - - L4_1_BUSBAR - 2 - - - - - - BAY_L4_1 - - - - L4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR11 - - - false - false - - - L4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE21 - - - - L4_1_ADDB1 - 1 - - - - - - BREAKER6 - - - false - false - - - L4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE22 - - - - L4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR12 - - - false - false - - - L4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE23 - - - - CONNECTIVITY_NODE24 - - - - BUSBAR6 - - - - - L1_0_BUSBAR - 1 - - - - - - BAY_L1_0 - - - - L1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR13 - - - false - false - - - L1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE25 - - - - L1_0_ADDB1 - 1 - - - - - - BREAKER7 - - - false - false - - - L1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE26 - - - - L1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR14 - - - false - false - - - L1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE27 - - - - BAY_L1_1 - - - - L1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR15 - - - false - false - - - L1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE28 - - - - L1_1_ADDB1 - 1 - - - - - - BREAKER8 - - - false - false - - - L1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE29 - - - - L1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR16 - - - false - false - - - L1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE30 - - - - BAY_L2_0 - - - - L2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR17 - - - false - false - - - L2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE31 - - - - L2_0_ADDB1 - 1 - - - - - - BREAKER9 - - - false - false - - - L2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE32 - - - - L2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR18 - - - false - false - - - L2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE33 - - - - BAY_L2_1 - - - - L2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR19 - - - false - false - - - L2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE34 - - - - L2_1_ADDB1 - 1 - - - - - - BREAKER10 - - - false - false - - - L2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE35 - - - - L2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR20 - - - false - false - - - L2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE36 - - - - BAY_L3_a_0 - - - - L3_a_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR21 - - - false - false - - - L3_a_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE37 - - - - L3_a_0_ADDB1 - 1 - - - - - - BREAKER11 - - - false - false - - - L3_a_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE38 - - - - L3_a_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR22 - - - false - false - - - L3_a_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE39 - - - - BAY_L3_a_1 - - - - L3_a_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR23 - - - false - false - - - L3_a_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE40 - - - - L3_a_1_ADDB1 - 1 - - - - - - BREAKER12 - - - false - false - - - L3_a_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE41 - - - - L3_a_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR24 - - - false - false - - - L3_a_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE42 - - - - BAY_L3_b_0 - - - - L3_b_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR25 - - - false - false - - - L3_b_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE43 - - - - L3_b_0_ADDB1 - 1 - - - - - - BREAKER13 - - - false - false - - - L3_b_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE44 - - - - L3_b_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR26 - - - false - false - - - L3_b_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE45 - - - - BAY_L3_b_1 - - - - L3_b_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR27 - - - false - false - - - L3_b_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE46 - - - - L3_b_1_ADDB1 - 1 - - - - - - BREAKER14 - - - false - false - - - L3_b_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE47 - - - - L3_b_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR28 - - - false - false - - - L3_b_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE48 - - - - BAY_T5_0 - - - - T5_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR29 - - - false - false - - - T5_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE49 - - - - T5_0_ADDB1 - 1 - - - - - - BREAKER15 - - - false - false - - - T5_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE50 - - - - T5_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR30 - - - false - false - - - T5_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE51 - - - - BAY_T5_1 - - - - T5_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR31 - - - false - false - - - T5_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE52 - - - - T5_1_ADDB1 - 1 - - - - - - BREAKER16 - - - false - false - - - T5_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE53 - - - - T5_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR32 - - - false - false - - - T5_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE54 - - - - BAY_T6_0 - - - - T6_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR33 - - - false - false - - - T6_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE55 - - - - T6_0_ADDB1 - 1 - - - - - - BREAKER17 - - - false - false - - - T6_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE56 - - - - T6_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR34 - - - false - false - - - T6_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE57 - - - - BAY_T6_1 - - - - T6_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR35 - - - false - false - - - T6_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE58 - - - - T6_1_ADDB1 - 1 - - - - - - BREAKER18 - - - false - false - - - T6_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE59 - - - - T6_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR36 - - - false - false - - - T6_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE60 - - - - BAY_T2_0 - - - - T2_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR37 - - - false - false - - - T2_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE61 - - - - T2_0_ADDB1 - 1 - - - - - - BREAKER19 - - - false - false - - - T2_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE62 - - - - T2_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR38 - - - false - false - - - T2_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE63 - - - - CONNECTIVITY_NODE64 - - - - BUSBAR7 - - - - - T2_1_BUSBAR - 2 - - - - - - BAY_T2_1 - - - - T2_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR39 - - - false - false - - - T2_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE65 - - - - T2_1_ADDB1 - 1 - - - - - - BREAKER20 - - - false - false - - - T2_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE66 - - - - T2_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR40 - - - false - false - - - T2_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE67 - - - - CONNECTIVITY_NODE68 - - - - BUSBAR8 - - - - - T1_0_BUSBAR - 1 - - - - - - BAY_T1_0 - - - - T1_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR41 - - - false - false - - - T1_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE69 - - - - T1_0_ADDB1 - 1 - - - - - - BREAKER21 - - - false - false - - - T1_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE70 - - - - T1_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR42 - - - false - false - - - T1_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE71 - - - - BAY_T1_1 - - - - T1_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR43 - - - false - false - - - T1_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE72 - - - - T1_1_ADDB1 - 1 - - - - - - BREAKER22 - - - false - false - - - T1_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE73 - - - - T1_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR44 - - - false - false - - - T1_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE74 - - - - CONNECTIVITY_NODE75 - - - - BUSBAR9 - - - - - T4_0_BUSBAR - 1 - - - - - - BAY_T4_0 - - - - T4_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR45 - - - false - false - - - T4_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE76 - - - - T4_0_ADDB1 - 1 - - - - - - BREAKER23 - - - false - false - - - T4_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE77 - - - - T4_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR46 - - - false - false - - - T4_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE78 - - - - BAY_T4_1 - - - - T4_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR47 - - - false - false - - - T4_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE79 - - - - T4_1_ADDB1 - 1 - - - - - - BREAKER24 - - - false - false - - - T4_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE80 - - - - T4_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR48 - - - false - false - - - T4_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE81 - - - - CONNECTIVITY_NODE82 - - - - BUSBAR10 - - - - - T4_2_BUSBAR - 3 - - - - - - BAY_T4_2 - - - - T4_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR49 - - - false - false - - - T4_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE83 - - - - T4_2_ADDB1 - 1 - - - - - - BREAKER25 - - - false - false - - - T4_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE84 - - - - T4_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR50 - - - false - false - - - T4_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE85 - - - - BAY_T3_0 - - - - T3_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR51 - - - false - false - - - T3_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE86 - - - - T3_0_ADDB1 - 1 - - - - - - BREAKER26 - - - false - false - - - T3_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE87 - - - - T3_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR52 - - - false - false - - - T3_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE88 - - - - BAY_T3_1 - - - - T3_1_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR53 - - - false - false - - - T3_1_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE89 - - - - T3_1_ADDB1 - 1 - - - - - - BREAKER27 - - - false - false - - - T3_1_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE90 - - - - T3_1_ADD_DSC21 - 1 - - - - - - DISCONNECTOR54 - - - false - false - - - T3_1_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE91 - - - - CONNECTIVITY_NODE92 - - - - BUSBAR11 - - - - - T3_2_BUSBAR - 3 - - - - - - BAY_T3_2 - - - - T3_2_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR55 - - - false - false - - - T3_2_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE93 - - - - T3_2_ADDB1 - 1 - - - - - - BREAKER28 - - - false - false - - - T3_2_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE94 - - - - T3_2_ADD_DSC21 - 1 - - - - - - DISCONNECTOR56 - - - false - false - - - T3_2_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE95 - - - - BAY_68-116_0 - - - - 68-116_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR57 - - - false - false - - - 68-116_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE96 - - - - 68-116_0_ADDB1 - 1 - - - - - - BREAKER29 - - - false - false - - - 68-116_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE97 - - - - 68-116_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR58 - - - false - false - - - 68-116_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE98 - - - - BAY_71-73_0 - - - - 71-73_0_ADD_DSC11 - 1 - - - - - - - DISCONNECTOR59 - - - false - false - - - 71-73_0_ADD_DSC12 - 2 - - - - - - CONNECTIVITY_NODE100 - - - - 71-73_0_ADDB1 - 1 - - - - - - BREAKER30 - - - false - false - - - 71-73_0_ADDB2 - 2 - - - - - - CONNECTIVITY_NODE101 - - - - 71-73_0_ADD_DSC21 - 1 - - - - - - DISCONNECTOR60 - - - false - false - - - 71-73_0_ADD_DSC22 - 2 - - - - - - CONNECTIVITY_NODE102 - - - - GEN_A1 - - - - - _CA_A1 - - - - 5 - 1 - - - 4 - 1 - - - 6 - 1 - - - 7 - 1 - - - 3 - 1 - - - 2 - 1 - - - HG2 - 1 - - - HG1 - 1 - - - H - 1 - - - 1 - 1 - - - 8 - 1 - - - Container for Line-7 - - - - Container for Line-4 - - - - Container for Line-5 - - - - Container for Line-1 - - - - Container for Line-6 - - - - Container for Line-2 - - - - Container for Line-3 - - - - TwinBrch SM - - - - - PATLT - 4000 - - - - - Normal - - - 525 - - - Normal - - - 1155 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 525 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 158 - - - Normal - - - 1732 - - - Normal - - - 481 - - - Normal - - - 5498 - - - Normal - - - 4123 - - - Normal - - - 753 - - - Normal - - - 962 - - - Normal - - - 1683 - - - Normal - - - 505 - - - Normal - - - 505 - - - Normal - - - 1683 - - - Normal - - - 962 - - - Normal - - - 1000 - - - Normal - - - 1000 - - \ No newline at end of file diff --git a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switchVLsOpen/MiniGridTestConfiguration_BC_SSH_v3.0.0.xml b/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switchVLsOpen/MiniGridTestConfiguration_BC_SSH_v3.0.0.xml deleted file mode 100644 index b1151cae5aa..00000000000 --- a/cgmes/cgmes-conformity/src/main/resources/conformity-modified/cas-1.1.3-data-4.0.3/MiniGrid/NodeBreaker/BaseCase_Complete_v3_switchVLsOpen/MiniGridTestConfiguration_BC_SSH_v3.0.0.xml +++ /dev/null @@ -1,1078 +0,0 @@ - - - - 2030-01-02T09:00:00 - 2014-10-22T09:01:25.830 - CGMES Conformity Assessment: Mini Grid Base Case Test Configuration. The model is owned by ENTSO-E and is provided by ENTSO-E "as it is". To the fullest extent permitted by law, ENTSO-E shall not be liable for any damages of any kind arising out of the use of the model (including any of its subsequent modifications). ENTSO-E neither warrants, nor represents that the use of the model will not infringe the rights of third parties. Any use of the model shall include a reference to ENTSO-E. ENTSO-E web site is the only official source of information related to the model. - 4 - http://entsoe.eu/CIM/SteadyStateHypothesis/1/1 - http://A1.de/Planning/ENTSOE/2 - - - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - true - - - 1 - - - false - -0 - -0 - 1 - - - - 0 - - - false - -5 - -2 - 0 - - - - 0 - - - false - -4 - -3 - 0 - - - - false - 5 - 3 - - - - false - 2 - 1 - - - - false - 2 - 1 - - - - false - 0 - 0 - 0 - - - false - 0 - 0 - 0 - - - false - 13 - - - false - 17 - - - false - 17 - - - false - - - true - - - true - - - false - - - false - - - true - - - false - 0 - 0 - 0 - - - false - 0 - 0 - 0 - - - true - - - true - - - false - - - true - - - - true - - - true - - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - true - - - false - - - true - - - 0 - - - false - true - 0 - 10.0 - - - diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/CgmesImport.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/CgmesImport.java index ca8dcb9b2a8..d4cfb94cf0e 100644 --- a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/CgmesImport.java +++ b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/CgmesImport.java @@ -512,6 +512,12 @@ private Conversion.Config config(Properties p) { getFormat(), p, MISSING_PERMANENT_LIMIT_PERCENTAGE_PARAMETER, + defaultValueConfig)) + .setCreateFictitiousVoltageLevelsForEveryNode( + Parameter.readBoolean( + getFormat(), + p, + CREATE_FICTITIOUS_VOLTAGE_LEVEL_FOR_EVERY_NODE_PARAMETER, defaultValueConfig)); String namingStrategy = Parameter.readString(getFormat(), p, NAMING_STRATEGY_PARAMETER, defaultValueConfig); @@ -587,6 +593,7 @@ private void copyStream(ReadOnlyDataSource from, DataSource to, String fromName, public static final String MISSING_PERMANENT_LIMIT_PERCENTAGE = "iidm.import.cgmes.missing-permanent-limit-percentage"; public static final String IMPORT_CGM_WITH_SUBNETWORKS = "iidm.import.cgmes.cgm-with-subnetworks"; public static final String IMPORT_CGM_WITH_SUBNETWORKS_DEFINED_BY = "iidm.import.cgmes.cgm-with-subnetworks-defined-by"; + public static final String CREATE_FICTITIOUS_VOLTAGE_LEVEL_FOR_EVERY_NODE = "iidm.import.cgmes.create-fictitious-voltage-level-for-every-node"; public static final String SOURCE_FOR_IIDM_ID_MRID = "mRID"; public static final String SOURCE_FOR_IIDM_ID_RDFID = "rdfID"; @@ -700,6 +707,13 @@ private void copyStream(ReadOnlyDataSource from, DataSource to, String fromName, "Percentage applied to lowest TATL limit to use as PATL when PATL is missing", 100.); + private static final Parameter CREATE_FICTITIOUS_VOLTAGE_LEVEL_FOR_EVERY_NODE_PARAMETER = new Parameter( + CREATE_FICTITIOUS_VOLTAGE_LEVEL_FOR_EVERY_NODE, + ParameterType.BOOLEAN, + "Create fictitious voltage level for every node", + Boolean.TRUE) + .addAdditionalNames("createFictitiousVoltageLevelForEveryNode"); + private static final List STATIC_PARAMETERS = List.of( CONVERT_BOUNDARY_PARAMETER, CONVERT_SV_INJECTIONS_PARAMETER, @@ -719,7 +733,8 @@ private void copyStream(ReadOnlyDataSource from, DataSource to, String fromName, DISCONNECT_DANGLING_LINE_IF_BOUNDARY_SIDE_IS_DISCONNECTED_PARAMETER, IMPORT_CGM_WITH_SUBNETWORKS_PARAMETER, IMPORT_CGM_WITH_SUBNETWORKS_DEFINED_BY_PARAMETER, - MISSING_PERMANENT_LIMIT_PERCENTAGE_PARAMETER); + MISSING_PERMANENT_LIMIT_PERCENTAGE_PARAMETER, + CREATE_FICTITIOUS_VOLTAGE_LEVEL_FOR_EVERY_NODE_PARAMETER); private final Parameter boundaryLocationParameter; private final Parameter preProcessorsParameter; diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Context.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Context.java index df7f1f4acdd..fec6eca4fd2 100644 --- a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Context.java +++ b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Context.java @@ -52,7 +52,7 @@ public Context(CgmesModel cgmes, Config config, Network network, ReportNode repo namingStrategy = config.getNamingStrategy(); cgmesBoundary = new CgmesBoundary(cgmes); - substationIdMapping = new SubstationIdMapping(this); + nodeContainerMapping = new NodeContainerMapping(this); terminalMapping = new TerminalMapping(); dcMapping = new DcMapping(this); loadingLimitsMapping = new LoadingLimitsMapping(this); @@ -108,8 +108,8 @@ public NodeMapping nodeMapping() { return nodeMapping; } - public SubstationIdMapping substationIdMapping() { - return substationIdMapping; + public NodeContainerMapping nodeContainerMapping() { + return nodeContainerMapping; } public CgmesBoundary boundary() { @@ -305,7 +305,7 @@ private static void logIssue(ConversionIssueCategory category, String what, Supp private final boolean nodeBreaker; private final NamingStrategy namingStrategy; - private final SubstationIdMapping substationIdMapping; + private final NodeContainerMapping nodeContainerMapping; private final CgmesBoundary cgmesBoundary; private final TerminalMapping terminalMapping; private final NodeMapping nodeMapping; diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java index 84b63d2bba4..f41b2311f89 100644 --- a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java +++ b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/Conversion.java @@ -165,7 +165,7 @@ public Network convert(ReportNode reportNode) { // Build mappings context.pushReportNode(CgmesReports.buildingMappingsReport(reportNode)); - context.substationIdMapping().build(); + context.nodeContainerMapping().build(); BaseVoltageMappingAdder bvAdder = network.newExtension(BaseVoltageMappingAdder.class); cgmes.baseVoltages().forEach(bv -> bvAdder.addBaseVoltage(bv.getId("BaseVoltage"), bv.asDouble("nominalVoltage"), isBoundaryBaseVoltage(bv.getLocal("graph")))); bvAdder.add(); @@ -589,22 +589,6 @@ private void addCimCharacteristics(Network network) { } } - private void putVoltageLevelRefByLineContainerIdIfPresent(String lineContainerId, Supplier terminalId1, - Supplier terminalId2, - Map nominalVoltageByLineContainerId, - Context context) { - String vlId = Optional.ofNullable(context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, - context.cgmes().voltageLevel(cgmes.terminal(terminalId1.get()), context.nodeBreaker()))) - .orElseGet(() -> context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, - context.cgmes().voltageLevel(cgmes.terminal(terminalId2.get()), context.nodeBreaker()))); - if (vlId != null) { - VoltageLevel vl = context.network().getVoltageLevel(vlId); - if (vl != null) { - nominalVoltageByLineContainerId.put(lineContainerId, vl); - } - } - } - private void convertACLineSegmentsToLines(Context context, Set delayedBoundaryNodes) { context.pushReportNode(CgmesReports.convertingElementTypeReport(context.getReportNode(), CgmesNames.AC_LINE_SEGMENT)); for (PropertyBag line : cgmes.acLineSegments()) { @@ -625,75 +609,26 @@ private void convertACLineSegmentsToLines(Context context, Set delayedBo context.popReportNode(); } + // Fictitious voltageLevels for Line and Substation(when it includes nodes) containers private void createFictitiousVoltageLevelsForLineContainers(Context context) { - Map voltageLevelRefByLineContainerId = new HashMap<>(); - PropertyBags acLineSegments = cgmes.acLineSegments(); - // First we have to iterate over all ACLSs inside Line Containers to find a voltage level reference for each Line Container - // There may be ACLSs that have the two nodes in the interior of Line Container and do not help in determining a voltage level reference - for (PropertyBag line : acLineSegments) { // Retrieve a voltage level reference for every line container of AC Line Segments outside boundaries - String lineContainerId = line.getId("Line"); - if (lineContainerId != null && !voltageLevelRefByLineContainerId.containsKey(lineContainerId)) { - putVoltageLevelRefByLineContainerIdIfPresent(lineContainerId, () -> line.getId("Terminal1"), () -> line.getId("Terminal2"), - voltageLevelRefByLineContainerId, context); - } - } - // Now, iterate again over all ACLSs inside Line Containers to determine specific voltage levels to be created from the reference - for (PropertyBag line : acLineSegments) { - String lineContainerId = line.getId("Line"); - if (lineContainerId != null) { // Create fictitious voltage levels for AC line segments inside line containers outside boundaries - VoltageLevel vlRef = voltageLevelRefByLineContainerId.get(lineContainerId); - if (vlRef != null) { - createLineContainerFictitiousVoltageLevels(context, lineContainerId, vlRef, line); - } else { - LOG.error("No fictitious Voltage Level created for Line container {}. No voltage level reference could be found", lineContainerId); - } - } - } - } - - public static String getFictitiousVoltageLevelForNodeInContainer(String containerId, String nodeId) { - // We should try to create only one voltage level for each container, - // instead of one voltage level for each node - LOG.trace("Fictitious voltage level id for container {} node {}", containerId, nodeId); - return nodeId + "_VL"; - } - static class LineContainerFictitiousVoltageLevelData { - String lineId; - String lineName; - String nodeId; - VoltageLevel vl; - } - - private LineContainerFictitiousVoltageLevelData voltageLevelDataForACLSinLineContainer(Context context, String lineId, PropertyBag lineSegment, String terminalRef) { - LineContainerFictitiousVoltageLevelData vldata = new LineContainerFictitiousVoltageLevelData(); - vldata.lineId = lineId; - vldata.lineName = lineSegment.get("lineName"); - CgmesTerminal t = cgmes.terminal(lineSegment.getId(terminalRef)); - vldata.nodeId = context.nodeBreaker() ? t.connectivityNode() : t.topologicalNode(); - String vlId = context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, context.cgmes().voltageLevel(t, context.nodeBreaker())); - vldata.vl = context.network().getVoltageLevel( - Objects.requireNonNullElseGet(vlId, () -> getFictitiousVoltageLevelForNodeInContainer(vldata.lineId, vldata.nodeId))); - return vldata; - } + context.nodeContainerMapping().getFictitiousVoltageLevelsForLineContainersToBeCreated().forEach(fictitiousVoltageLevelId -> { + String containerId = context.nodeContainerMapping().getContainerId(fictitiousVoltageLevelId).orElseThrow(); + String containerName = context.nodeContainerMapping().getContainerName(fictitiousVoltageLevelId).orElseThrow(); + String referenceVoltageLevelId = context.nodeContainerMapping().getReferenceVoltageLevelId(fictitiousVoltageLevelId).orElseThrow(); - private void createLineContainerFictitiousVoltageLevels(Context context, String lineId, VoltageLevel vlRef, PropertyBag lineSegment) { - // Try to obtain data for a potential fictitious voltage level from Terminal1 of AC Line Segment - LineContainerFictitiousVoltageLevelData vldata1 = voltageLevelDataForACLSinLineContainer(context, lineId, lineSegment, "Terminal1"); - // The same, from Terminal2 of AC Line Segment - LineContainerFictitiousVoltageLevelData vldata2 = voltageLevelDataForACLSinLineContainer(context, lineId, lineSegment, "Terminal2"); - // Only create a fictitious voltage levels replacing cim:Line Container if we are NOT at boundaries - if (vldata1.vl == null && !context.boundary().containsNode(vldata1.nodeId)) { - createLineContainerFictitiousVoltageLevel(context, vldata1, vlRef); - } - if (vldata2.vl == null && !context.boundary().containsNode(vldata2.nodeId)) { - createLineContainerFictitiousVoltageLevel(context, vldata2, vlRef); - } + if (context.network().getVoltageLevel(fictitiousVoltageLevelId) == null) { + VoltageLevel referenceVoltageLevel = context.network().getVoltageLevel(referenceVoltageLevelId); + if (referenceVoltageLevel == null) { + throw new ConversionException("VoltageLevel not found for voltageLevelId: " + referenceVoltageLevelId); + } + createFictitiousVoltageLevelsForLineContainer(context, fictitiousVoltageLevelId, containerId, containerName, referenceVoltageLevel); + } + }); } - private void createLineContainerFictitiousVoltageLevel(Context context, LineContainerFictitiousVoltageLevelData vldata, VoltageLevel vlref) { - String id = Conversion.getFictitiousVoltageLevelForNodeInContainer(vldata.lineId, vldata.nodeId); - LOG.warn("Fictitious Voltage Level {} created for Line container {} name {} node {}", id, vldata.lineId, vldata.lineName, vldata.nodeId); + private void createFictitiousVoltageLevelsForLineContainer(Context context, String fictitiousVoltageLevelId, String containerId, String containerName, VoltageLevel vlref) { + LOG.warn("Fictitious Voltage Level {} created for Line container {} name {}", fictitiousVoltageLevelId, containerId, containerName); // Nominal voltage and low/high limits are copied from the reference voltage level, if it is given VoltageLevel vl = context.network().newVoltageLevel() .setNominalV(vlref.getNominalV()) @@ -703,11 +638,11 @@ private void createLineContainerFictitiousVoltageLevel(Context context, LineCont : TopologyKind.BUS_BREAKER) .setLowVoltageLimit(vlref.getLowVoltageLimit()) .setHighVoltageLimit(vlref.getHighVoltageLimit()) - .setId(id) - .setName(vldata.lineName) + .setId(fictitiousVoltageLevelId) + .setName(containerName) .setEnsureIdUnicity(context.config().isEnsureIdAliasUnicity()) .add(); - vl.setProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + "LineContainerId", vldata.lineId); + vl.setProperty(Conversion.CGMES_PREFIX_ALIAS_PROPERTIES + "LineContainerId", containerId); } private void convertSwitches(Context context, Set delayedBoundaryNodes) { @@ -1107,6 +1042,15 @@ public boolean disconnectNetworkSideOfDanglingLinesIfBoundaryIsDisconnected() { return disconnectNetworkSideOfDanglingLinesIfBoundaryIsDisconnected; } + public boolean getCreateFictitiousVoltageLevelsForEveryNode() { + return createFictitiousVoltageLevelsForEveryNode; + } + + public Config setCreateFictitiousVoltageLevelsForEveryNode(boolean b) { + createFictitiousVoltageLevelsForEveryNode = b; + return this; + } + private boolean convertBoundary = false; private boolean createBusbarSectionForEveryConnectivityNode = false; @@ -1135,6 +1079,7 @@ public boolean disconnectNetworkSideOfDanglingLinesIfBoundaryIsDisconnected() { private Xfmr3StructuralRatioInterpretationAlternative xfmr3StructuralRatio = Xfmr3StructuralRatioInterpretationAlternative.STAR_BUS_SIDE; private double missingPermanentLimitPercentage = 100; + private boolean createFictitiousVoltageLevelsForEveryNode = true; } private final CgmesModel cgmes; diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/NodeContainerMapping.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/NodeContainerMapping.java new file mode 100644 index 00000000000..4ddeaf4200f --- /dev/null +++ b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/NodeContainerMapping.java @@ -0,0 +1,472 @@ +/** + * Copyright (c) 2017-2018, 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.cgmes.conversion; + +import com.powsybl.cgmes.model.CgmesContainer; +import com.powsybl.cgmes.model.CgmesNames; +import com.powsybl.cgmes.model.CgmesTerminal; +import com.powsybl.triplestore.api.PropertyBag; +import com.powsybl.triplestore.api.PropertyBags; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * CGMES standard:
+ * A PowerTransformer is contained in one Substation, but it can connect a Terminal to another different Substation
+ * A Switch can connect to different voltageLevels + *

+ * IIDM Model:
+ * Ends of transformers need to be in the same substation
+ * Ends of switches need to be in the same voltageLevel + *

+ * Solution:
+ * CGMES substations that are connected by transformers will be mapped to a single IIDM substation
+ * CGMES voltageLevels that are connected by switches will be mapped to a single IIDM voltageLevel + *

+ * Example:
+ * We suppose that VL1, VL2, VL3, VL4, VL5, VL6 and VL7 are CGMES voltageLevels,
+ * Sw23 is a switch connecting voltageLevels VL2 and VL3,
+ * Sw34 is a switch connecting voltageLevels VL3 and VL4 and
+ * Sw67 is a switch connecting voltageLevels VL6 and VL7 + *

+ * Steps:
+ * Fill voltageLevelAdjacency Map
+ * Two voltageLevels are adjacent if they are connected by a switch
+ * The voltageLevelAdjacency Map will include the following records
+ * (VL1, [])
+ * (VL2, [VL2, VL3])
+ * (VL3, [VL2, VL3, VL4])
+ * (VL4, [VL3, VL4])
+ * (VL5, [])
+ * (VL6, [VL6, VL7])
+ * (VL7, [VL6, VL7])
+ *

+ * For each non-visited VoltageLevel-key of the voltageLevelAdjacency Map all connected voltageLevels will be calculated
+ * Two voltageLevels are connected if they are adjacent
+ * (allConnected method)
+ * All connected VoltageLevels to VL1 will be [VL1]
+ * All connected VoltageLevels to VL2 will be [VL2, VL3, VL4]
+ * All connected VoltageLevels to VL5 will be [VL5]
+ * All connected VoltageLevels to VL6 will be [VL6, VL7] + *

+ * So the following voltageLevels should be merged
+ * [VL2, VL3, VL4] and the representative (IIDM voltageLevel) will be VL2
+ * [VL6, VL7] and the representative (IIDM voltageLevel) will be VL6 + *

+ * And finally previous data is recorded in the voltageLevelMapping Map as
+ * (For each merged voltageLevel a record (merged voltageLevel, representative voltageLevel) is added)
+ * (VL3, VL2)
+ * (VL4, VL2)
+ * (VL7, VL6)
+ *

+ * The voltageLevelMapping Map will be used to assign the IIDM voltageLevel during the conversion process + *

+ * The same algorithm is used to identify the substations that should be merged but:
+ * Two substations are adjacent if there is a transformer between them.
+ * The two substations associated with two adjacent voltageLevels, are adjacent if they are different substations. + *

+ * @author Luma Zamarreño {@literal } + * @author José Antonio Marqués {@literal } + */ + +public class NodeContainerMapping { + + public NodeContainerMapping(Context context) { + this.context = context; + this.substationMapping = new HashMap<>(); + this.voltageLevelMapping = new HashMap<>(); + this.fictitiousVoltageLevels = new HashMap<>(); + this.referenceVoltageLevels = new HashMap<>(); + } + + public boolean substationIsMapped(String cgmesIdentifier) { + String sid = context.namingStrategy().getIidmId(CgmesNames.SUBSTATION, cgmesIdentifier); + return substationMapping.containsKey(sid); + } + + public String substationIidm(String cgmesIdentifier) { + String sid = context.namingStrategy().getIidmId(CgmesNames.SUBSTATION, cgmesIdentifier); + if (substationMapping.containsKey(sid)) { + return substationMapping.get(sid); + } + return sid; + } + + // All the keys for a given value, all the merged substations that have cgmesIdentifier as representative + public Set mergedSubstations(String cgmesIdentifier) { + String sid = context.namingStrategy().getIidmId(CgmesNames.SUBSTATION, cgmesIdentifier); + return substationMapping.entrySet().stream().filter(r -> r.getValue().equals(sid)) + .map(Map.Entry::getKey).collect(Collectors.toSet()); + } + + public boolean voltageLevelIsMapped(String cgmesIdentifier) { + String vlid = context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, cgmesIdentifier); + return voltageLevelMapping.containsKey(vlid); + } + + public String voltageLevelIidm(String cgmesIdentifier) { + String vlid = context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, cgmesIdentifier); + if (voltageLevelMapping.containsKey(vlid)) { + return voltageLevelMapping.get(vlid); + } + return vlid; + } + + // All the keys for a given value, all the merged voltageLevels that have cgmesIdentifier as representative + public Set mergedVoltageLevels(String cgmesIdentifier) { + String vlid = context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, cgmesIdentifier); + return voltageLevelMapping.entrySet().stream().filter(r -> r.getValue().equals(vlid)) + .map(Map.Entry::getKey).collect(Collectors.toSet()); + } + + public void build() { + Map> voltageLevelAdjacency = new HashMap<>(); + Map> substationAdjacency = new HashMap<>(); + Map> fictitiousVoltageLevelAdjacency = new HashMap<>(); + + buildAdjacency(voltageLevelAdjacency, substationAdjacency, fictitiousVoltageLevelAdjacency); + buildVoltageLevelMapping(voltageLevelAdjacency); + buildSubstationMapping(substationAdjacency); + buildReferenceVoltageLevels(fictitiousVoltageLevelAdjacency); + + // substation containers including connectivityNodes must be connected using switches to other containers (voltageLevel, Line) + // then there is no need for a new container + fictitiousVoltageLevels.keySet().stream() + .filter(this::isSubstationContainer) + .map(this::voltageLevelIidm) // map the representative voltageLevel + .filter(voltageLevelRepresentative -> fictitiousVoltageLevels.containsKey(voltageLevelRepresentative) && isSubstationContainer(voltageLevelRepresentative)) // representative must be fictitious + .findFirst().ifPresent(fictitiousVoltageLevelForSubstationContainer -> { + String containerId = getContainerId(fictitiousVoltageLevelForSubstationContainer).orElseThrow(); + throw new ConversionException("Substation container directly associated with connectivity or topological nodes. It is not expected to create a fictitious voltage level: " + containerId); + }); + } + + private void buildAdjacency(Map> voltageLevelAdjacency, Map> substationAdjacency, + Map> fictitiousVoltageLevelAdjacency) { + boolean fictitiousVoltageLevelForEveryNode = context.config().getCreateFictitiousVoltageLevelsForEveryNode(); + + context.cgmes().switches().forEach(sw -> addAdjacencyThroughSwitch(voltageLevelAdjacency, substationAdjacency, sw, fictitiousVoltageLevelForEveryNode)); + context.cgmes().groupedTransformerEnds().forEach((t, tends) -> addAdjacencyThroughTransformerEnds(substationAdjacency, tends)); + + context.cgmes().acLineSegments().forEach(ac -> addAdjacencyThroughBranch(fictitiousVoltageLevelAdjacency, ac, fictitiousVoltageLevelForEveryNode)); + context.cgmes().seriesCompensators().forEach(sc -> addAdjacencyThroughBranch(fictitiousVoltageLevelAdjacency, sc, fictitiousVoltageLevelForEveryNode)); + } + + // Two different voltageLevels are adjacent if they are connected by a switch + // If the corresponding substations are different they are also adjacent + private void addAdjacencyThroughSwitch(Map> voltageLevelAdjacency, + Map> substationAdjacency, + PropertyBag sw, boolean fictitiousVoltageLevelForEveryNode) { + + CgmesTerminal t1 = context.cgmes().terminal(sw.getId(CgmesNames.TERMINAL + 1)); + CgmesTerminal t2 = context.cgmes().terminal(sw.getId(CgmesNames.TERMINAL + 2)); + + Optional nodeId1 = context.cgmes().node(t1, context.nodeBreaker()); + Optional nodeId2 = context.cgmes().node(t2, context.nodeBreaker()); + if (nodeId1.isPresent() && !context.boundary().containsNode(nodeId1.get()) && nodeId2.isPresent() && !context.boundary().containsNode(nodeId2.get())) { + Optional cgmesContainer1 = context.cgmes().nodeContainer(nodeId1.get()); + Optional cgmesContainer2 = context.cgmes().nodeContainer(nodeId2.get()); + + if (cgmesContainer1.isPresent() && cgmesContainer2.isPresent()) { + String voltageLevelId1 = findVoltageLevelAndRecordItIfItIsFictitious(cgmesContainer1.get(), nodeId1.get(), fictitiousVoltageLevelForEveryNode); + String voltageLevelId2 = findVoltageLevelAndRecordItIfItIsFictitious(cgmesContainer2.get(), nodeId2.get(), fictitiousVoltageLevelForEveryNode); + + addAdjacency(voltageLevelAdjacency, voltageLevelId1, voltageLevelId2); + addAdjacency(substationAdjacency, cgmesContainer1.get().substation(), cgmesContainer2.get().substation()); + } + } + } + + private String findVoltageLevelAndRecordItIfItIsFictitious(CgmesContainer cgmesContainer, String nodeId, boolean fictitiousVoltageLevelForEveryNode) { + if (cgmesContainer.isVoltageLevel()) { + return cgmesContainer.voltageLevel(); + } else { + String fictitiousVoltageLevelId = getFictitiousVoltageLevelForContainer(cgmesContainer.id(), nodeId, fictitiousVoltageLevelForEveryNode); + recordFictitiousVoltageLevel(fictitiousVoltageLevels, fictitiousVoltageLevelId, cgmesContainer.id(), nodeId); + return fictitiousVoltageLevelId; + } + } + + private static void recordFictitiousVoltageLevel(Map fictitiousVoltageLevels, String fictitiousVoltageLevelId, String cgmesContainerId, String nodeId) { + if (fictitiousVoltageLevels.containsKey(fictitiousVoltageLevelId)) { + if (fictitiousVoltageLevels.get(fictitiousVoltageLevelId).containerId().equals(cgmesContainerId)) { + fictitiousVoltageLevels.get(fictitiousVoltageLevelId).nodeIdSet().add(nodeId); + } else { + throw new ConversionException("Unexpected cgmesContainerId: " + cgmesContainerId); + } + } else { + Set nodeIdSet = new HashSet<>(); + nodeIdSet.add(nodeId); + fictitiousVoltageLevels.put(fictitiousVoltageLevelId, new ContainerR(cgmesContainerId, nodeIdSet)); + } + } + + // Two different substations are adjacent if they are connected by a transformer + private void addAdjacencyThroughTransformerEnds(Map> substationAdjacency, PropertyBags tends) { + List substationsIds = substationsIds(tends); + if (substationsIds.size() <= 1) { + return; + } + String sub0 = substationsIds.get(0); + for (int i = 1; i < substationsIds.size(); i++) { + addAdjacency(substationAdjacency, sub0, substationsIds.get(i)); + } + } + + private void addAdjacencyThroughBranch(Map> fictitiousVoltageLevelAdjacency, + PropertyBag equipment, boolean fictitiousVoltageLevelByNode) { + + CgmesTerminal t1 = context.cgmes().terminal(equipment.getId(CgmesNames.TERMINAL + 1)); + CgmesTerminal t2 = context.cgmes().terminal(equipment.getId(CgmesNames.TERMINAL + 2)); + + Optional nodeId1 = context.cgmes().node(t1, context.nodeBreaker()); + Optional nodeId2 = context.cgmes().node(t2, context.nodeBreaker()); + if (nodeId1.isPresent() && !context.boundary().containsNode(nodeId1.get()) && nodeId2.isPresent() && !context.boundary().containsNode(nodeId2.get())) { + Optional cgmesContainer1 = context.cgmes().nodeContainer(nodeId1.get()); + Optional cgmesContainer2 = context.cgmes().nodeContainer(nodeId2.get()); + + if (cgmesContainer1.isPresent() && cgmesContainer2.isPresent() && isValidReference(cgmesContainer1.get(), cgmesContainer2.get())) { + String voltageLevelId1 = findVoltageLevelAndRecordItIfItIsFictitious(cgmesContainer1.get(), nodeId1.get(), fictitiousVoltageLevelByNode); + String voltageLevelId2 = findVoltageLevelAndRecordItIfItIsFictitious(cgmesContainer2.get(), nodeId2.get(), fictitiousVoltageLevelByNode); + addAdjacency(fictitiousVoltageLevelAdjacency, voltageLevelId1, voltageLevelId2); + } + } + } + + // one or both of them must be LineContainers + private static boolean isValidReference(CgmesContainer cgmesContainer1, CgmesContainer cgmesContainer2) { + return !(cgmesContainer1.isVoltageLevel() && cgmesContainer2.isVoltageLevel()); + } + + private static void addAdjacency(Map> adjacency, String id1, String id2) { + if (isValidAdjacency(id1, id2)) { + adjacency.computeIfAbsent(id1, k -> new HashSet<>()).add(id2); + adjacency.computeIfAbsent(id2, k -> new HashSet<>()).add(id1); + } + } + + private static boolean isValidAdjacency(String ad1, String ad2) { + return ad1 != null && ad2 != null && !ad1.equals(ad2); + } + + private void buildVoltageLevelMapping(Map> voltageLevelAdjacency) { + Set visitedVoltageLevels = new HashSet<>(); + for (String vl : voltageLevelAdjacency.keySet()) { + if (!visitedVoltageLevels.contains(vl)) { + Set vlAds = allConnected(voltageLevelAdjacency, visitedVoltageLevels, vl); + String selectedVoltageLevelId = representativeVoltageLevelId(vlAds); + recordMergedIds(voltageLevelMapping, vlAds, selectedVoltageLevelId); + } + } + if (!voltageLevelMapping.isEmpty()) { + CgmesReports.voltageLevelMappingReport(context.getReportNode(), voltageLevelMapping.size(), voltageLevelMapping.toString()); + LOG.warn("Original {} VoltageLevel container(s) connected by switches have been merged in IIDM. Map of original VoltageLevel to IIDM: {}", + voltageLevelMapping.size(), voltageLevelMapping); + } + } + + private void buildSubstationMapping(Map> substationAdjacency) { + Set visitedSubstations = new HashSet<>(); + for (String sub : substationAdjacency.keySet()) { + if (!visitedSubstations.contains(sub)) { + Set subAds = allConnected(substationAdjacency, visitedSubstations, sub); + String selectedSubstationId = representativeSubstationId(subAds); + recordMergedIds(substationMapping, subAds, selectedSubstationId); + } + } + if (!substationMapping.isEmpty()) { + CgmesReports.substationMappingReport(context.getReportNode(), substationMapping.size(), substationMapping.toString()); + LOG.warn("Original {} Substation container(s) connected by transformers have been merged in IIDM. Map of original Substation to IIDM: {}", + substationMapping.size(), substationMapping); + } + } + + private void buildReferenceVoltageLevels(Map> fictitiousVoltageLevelAdjacency) { + // Find a representative for fictitious voltage levels of substation containers + voltageLevelMapping.forEach((key, value) -> { + if (fictitiousVoltageLevels.containsKey(key) && !fictitiousVoltageLevels.containsKey(value)) { + referenceVoltageLevels.put(key, value); + } + }); + + // Find a representative for fictitious voltage levels of line containers + Set visited = new HashSet<>(); + for (String fictitiousVoltageLevelId : fictitiousVoltageLevelAdjacency.keySet()) { + if (!visited.contains(fictitiousVoltageLevelId)) { + SetvlAds = allConnected(fictitiousVoltageLevelAdjacency, visited, fictitiousVoltageLevelId); + referenceVoltageLevel(vlAds).ifPresent(referenceId -> recordReferenceVoltageLevel(vlAds, referenceId)); + } + } + + // All fictitious voltage levels need a reference voltage level + fictitiousVoltageLevels.keySet().stream() + .filter(fictitiousVoltageLevel -> !referenceVoltageLevels.containsKey(fictitiousVoltageLevel)) + .findFirst() + .ifPresent(fictitiousVoltageLevelIdWithoutReference -> { + throw new ConversionException("Fictitious voltage level without reference: " + fictitiousVoltageLevelIdWithoutReference); + }); + } + + private Optional referenceVoltageLevel(Set voltageLevelIds) { + return voltageLevelIds.stream() + .filter(vl -> !fictitiousVoltageLevels.containsKey(vl)) + .min(Comparator.naturalOrder()); + } + + private void recordReferenceVoltageLevel(Set voltageLevelIds, String referenceId) { + voltageLevelIds.stream() + .filter(fictitiousVoltageLevels::containsKey) // only for the fictitious voltage levels + .forEach(vl -> referenceVoltageLevels.put(vl, referenceId)); + } + + // Given an id (substation / voltageLevel) returns all connected ids (substations / voltageLevels) + // Two ids are connected if they are adjacent in the adjacency Map + private static Set allConnected(Map> adjacency, Set visited, String id) { + ArrayList allConnected = new ArrayList<>(); + + // Insert id in the allConnected list and record it as visited + allConnected.add(id); + visited.add(id); + + // Expand, adding in each step all non-visited adjacent ids + int k = 0; + while (k < allConnected.size()) { + String vl0 = allConnected.get(k); + if (adjacency.containsKey(vl0)) { + adjacency.get(vl0).forEach(ad -> { + if (visited.contains(ad)) { + return; + } + allConnected.add(ad); + visited.add(ad); + }); + } + k++; + } + return new HashSet<>(allConnected); + } + + private String representativeVoltageLevelId(Collection voltageLevelIds) { + Optional existingVoltageLevelId = voltageLevelIds.stream() + .filter(voltageLevelId -> !fictitiousVoltageLevels.containsKey(voltageLevelId)) + .min(Comparator.naturalOrder()); + if (existingVoltageLevelId.isPresent()) { + return existingVoltageLevelId.get(); + } + Optional fictitiousVoltageLevelIdForLineContainer = voltageLevelIds.stream() + .filter(voltageLevelId -> !isSubstationContainer(voltageLevelId)) // Fictitious for LineContainer + .min(Comparator.naturalOrder()); + return fictitiousVoltageLevelIdForLineContainer.orElseGet(() -> voltageLevelIds.stream().min(Comparator.naturalOrder()) + .orElseThrow(() -> new IllegalStateException("Unexpected: voltageLevelIds list is empty"))); + } + + private String representativeSubstationId(Collection substationIds) { + return substationIds.stream() + .filter(substationId -> context.config().substationIdsExcludedFromMapping() + .stream() + .noneMatch(substationId::matches)) + .min(Comparator.naturalOrder()) + .orElse(substationIds.iterator().next()); + } + + // For each merged substation a record (merged substation, representative substation) is added + // For each merged voltageLevel a record (merged voltageLevel, representative voltageLevel) is added + private static void recordMergedIds(Map mapping, Collection mergedIds, String representativeId) { + for (String id : mergedIds) { + if (!id.equals(representativeId)) { + mapping.put(id, representativeId); + } + } + } + + private List substationsIds(PropertyBags tends) { + List substationsIds = new ArrayList<>(); + for (PropertyBag end : tends) { + CgmesTerminal t = context.cgmes().terminal(end.getId(CgmesNames.TERMINAL)); + + Optional nodeId = context.cgmes().node(t, context.nodeBreaker()); + if (nodeId.isPresent() && !context.boundary().containsNode(nodeId.get())) { + Optional cgmesContainer = context.cgmes().nodeContainer(nodeId.get()); + + if (cgmesContainer.isPresent()) { + String sid = cgmesContainer.get().substation(); + if (sid != null) { + substationsIds.add(context.namingStrategy().getIidmId(CgmesNames.SUBSTATION, sid)); + } + } + } + } + return substationsIds; + } + + // Only iidm voltage levels that are fictitious + Set getFictitiousVoltageLevelsForLineContainersToBeCreated() { + return fictitiousVoltageLevels.keySet().stream() + .filter(fictitiousVoltageLevelId -> !isSubstationContainer(fictitiousVoltageLevelId)) + .map(this::voltageLevelIidm) // map the representative voltageLevel + .filter(fictitiousVoltageLevels::containsKey) // representative must be fictitious + .collect(Collectors.toSet()); + } + + Optional getContainerId(String fictitiousVoltageLevelId) { + return fictitiousVoltageLevels.containsKey(fictitiousVoltageLevelId) ? Optional.of(fictitiousVoltageLevels.get(fictitiousVoltageLevelId).containerId()) : Optional.empty(); + } + + Optional getContainerName(String fictitiousVoltageLevelId) { + Optional containerId = getContainerId(fictitiousVoltageLevelId); + if (containerId.isPresent()) { + CgmesContainer cgmesContainer = context.cgmes().container(containerId.get()); + return cgmesContainer != null ? Optional.of(cgmesContainer.name()) : Optional.empty(); + } else { + return Optional.empty(); + } + } + + private boolean isSubstationContainer(String fictitiousVoltageLevelId) { + Optional containerId = getContainerId(fictitiousVoltageLevelId); + if (containerId.isPresent()) { + CgmesContainer cgmesContainer = context.cgmes().container(containerId.get()); + return cgmesContainer != null && cgmesContainer.isSubstation(); + } else { + return false; + } + } + + Optional getReferenceVoltageLevelId(String fictitiousVoltageLevelId) { + if (referenceVoltageLevels.containsKey(fictitiousVoltageLevelId)) { + String referenceVoltageLevelId = referenceVoltageLevels.get(fictitiousVoltageLevelId); + return Optional.ofNullable(voltageLevelIidm(referenceVoltageLevelId)); + } else { + return Optional.empty(); + } + } + + public String getFictitiousVoltageLevelForContainer(String containerId, String nodeId) { + return getFictitiousVoltageLevelForContainer(containerId, nodeId, context.config().getCreateFictitiousVoltageLevelsForEveryNode()); + } + + private static String getFictitiousVoltageLevelForContainer(String containerId, String nodeId, boolean fictitiousVoltageLevelForEveryNode) { + // ? one voltage level for each node : one voltage level for each container + return fictitiousVoltageLevelForEveryNode ? nodeId + "_VL" : containerId + "_VL"; + } + + private final Context context; + private final Map substationMapping; + private final Map voltageLevelMapping; + private final Map fictitiousVoltageLevels; + private final Map referenceVoltageLevels; + + private static final Logger LOG = LoggerFactory.getLogger(NodeContainerMapping.class); + + private record ContainerR(String containerId, Set nodeIdSet) { + } +} diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/SubstationIdMapping.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/SubstationIdMapping.java deleted file mode 100644 index e1b46bcc55c..00000000000 --- a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/SubstationIdMapping.java +++ /dev/null @@ -1,325 +0,0 @@ -/** - * Copyright (c) 2017-2018, 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.cgmes.conversion; - -import com.powsybl.cgmes.model.CgmesNames; -import com.powsybl.cgmes.model.CgmesTerminal; -import com.powsybl.commons.PowsyblException; -import com.powsybl.triplestore.api.PropertyBag; -import com.powsybl.triplestore.api.PropertyBags; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.*; -import java.util.stream.Collectors; - -/** - * CGMES standard:
- * A PowerTransformer is contained in one Substation, but it can connect a Terminal to another different Substation
- * A Switch can connect to different voltageLevels - *

- * IIDM Model:
- * Ends of transformers need to be in the same substation
- * Ends of switches need to be in the same voltageLevel - *

- * Solution:
- * CGMES substations that are connected by transformers will be mapped to a single IIDM substation
- * CGMES voltageLevels that are connected by switches will be mapped to a single IIDM voltageLevel - *

- * Example:
- * We suppose that VL1, VL2, VL3, VL4, VL5, VL6 and VL7 are CGMES voltageLevels,
- * Sw23 is a switch connecting voltageLevels VL2 and VL3,
- * Sw34 is a switch connecting voltageLevels VL3 and VL4 and
- * Sw67 is a switch connecting voltageLevels VL6 and VL7 - *

- * Steps:
- * Fill voltageLevelAdjacency Map
- * Two voltageLevels are adjacent if they are connected by a switch
- * The voltageLevelAdjacency Map will include the following records
- * (VL1, [])
- * (VL2, [VL2, VL3])
- * (VL3, [VL2, VL3, VL4])
- * (VL4, [VL3, VL4])
- * (VL5, [])
- * (VL6, [VL6, VL7])
- * (VL7, [VL6, VL7])
- *

- * For each non-visited VoltageLevel-key of the voltageLevelAdjacency Map all connected voltageLevels will be calculated
- * Two voltageLevels are connected if they are adjacent
- * (allConnected method)
- * All connected VoltageLevels to VL1 will be [VL1]
- * All connected VoltageLevels to VL2 will be [VL2, VL3, VL4]
- * All connected VoltageLevels to VL5 will be [VL5]
- * All connected VoltageLevels to VL6 will be [VL6, VL7] - *

- * So the following voltageLevels should be merged
- * [VL2, VL3, VL4] and the representative (IIDM voltageLevel) will be VL2
- * [VL6, VL7] and the representative (IIDM voltageLevel) will be VL6 - *

- * And finally previous data is recorded in the voltageLevelMapping Map as
- * (For each merged voltageLevel a record (merged voltageLevel, representative voltageLevel) is added)
- * (VL3, VL2)
- * (VL4, VL2)
- * (VL7, VL6)
- *

- * The voltageLevelMapping Map will be used to assign the IIDM voltageLevel during the conversion process - *

- * The same algorithm is used to identify the substations that should be merged but:
- * Two substations are adjacent if there is a transformer between them.
- * The two substations associated with two adjacent voltageLevels, are adjacent if they are different substations. - *

- * @author Luma Zamarreño {@literal } - * @author José Antonio Marqués {@literal } - */ - -public class SubstationIdMapping { - - public SubstationIdMapping(Context context) { - this.context = context; - this.substationMapping = new HashMap<>(); - this.voltageLevelMapping = new HashMap<>(); - } - - public boolean substationIsMapped(String cgmesIdentifier) { - String sid = context.namingStrategy().getIidmId(CgmesNames.SUBSTATION, cgmesIdentifier); - return substationMapping.containsKey(sid); - } - - public String substationIidm(String cgmesIdentifier) { - String sid = context.namingStrategy().getIidmId(CgmesNames.SUBSTATION, cgmesIdentifier); - if (substationMapping.containsKey(sid)) { - return substationMapping.get(sid); - } - return sid; - } - - // All the keys for a given value, all the merged substations that have cgmesIdentifier as representative - public Set mergedSubstations(String cgmesIdentifier) { - String sid = context.namingStrategy().getIidmId(CgmesNames.SUBSTATION, cgmesIdentifier); - return substationMapping.entrySet().stream().filter(r -> r.getValue().equals(sid)) - .map(Map.Entry::getKey).collect(Collectors.toSet()); - } - - public boolean voltageLevelIsMapped(String cgmesIdentifier) { - String vlid = context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, cgmesIdentifier); - return voltageLevelMapping.containsKey(vlid); - } - - public String voltageLevelIidm(String cgmesIdentifier) { - String vlid = context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, cgmesIdentifier); - if (voltageLevelMapping.containsKey(vlid)) { - return voltageLevelMapping.get(vlid); - } - return vlid; - } - - // All the keys for a given value, all the merged voltageLevels that have cgmesIdentifier as representative - public Set mergedVoltageLevels(String cgmesIdentifier) { - String vlid = context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, cgmesIdentifier); - return voltageLevelMapping.entrySet().stream().filter(r -> r.getValue().equals(vlid)) - .map(Map.Entry::getKey).collect(Collectors.toSet()); - } - - public void build() { - Map> voltageLevelAdjacency = new HashMap<>(); - Map> substationAdjacency = new HashMap<>(); - - buildAdjacency(voltageLevelAdjacency, substationAdjacency); - buildVoltageLevel(voltageLevelAdjacency); - buildSubstation(substationAdjacency); - } - - private void buildAdjacency(Map> voltageLevelAdjacency, - Map> substationAdjacency) { - context.cgmes().voltageLevels().forEach(vl -> addVoltageLevel(voltageLevelAdjacency, vl)); - context.cgmes().substations().forEach(st -> addSubstation(substationAdjacency, st)); - - context.cgmes().switches().forEach(sw -> addSwitch(voltageLevelAdjacency, substationAdjacency, sw)); - context.cgmes().groupedTransformerEnds().forEach((t, tends) -> addEnds(substationAdjacency, tends)); - } - - private void addVoltageLevel(Map> voltageLevelAdjacency, PropertyBag vl) { - String voltageLevelId = vl.getId(CgmesNames.VOLTAGE_LEVEL); - String vId = context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, voltageLevelId); - voltageLevelAdjacency.put(vId, new HashSet<>()); - } - - private void addSubstation(Map> substationAdjacency, PropertyBag sub) { - String substationlId = sub.getId(CgmesNames.SUBSTATION); - String subId = context.namingStrategy().getIidmId(CgmesNames.SUBSTATION, substationlId); - substationAdjacency.put(subId, new HashSet<>()); - } - - // Two different voltageLevels are adjacent if they are connected by a switch - // If the corresponding substations are different they are also adjacent - private void addSwitch(Map> voltageLevelAdjacency, - Map> substationAdjacency, PropertyBag sw) { - - CgmesTerminal t1 = context.cgmes().terminal(sw.getId(CgmesNames.TERMINAL + 1)); - CgmesTerminal t2 = context.cgmes().terminal(sw.getId(CgmesNames.TERMINAL + 2)); - - String voltageLevelId1 = context.cgmes().voltageLevel(t1, context.nodeBreaker()); - String voltageLevelId2 = context.cgmes().voltageLevel(t2, context.nodeBreaker()); - // Null could be received as voltageLevel at the boundary - if (voltageLevelId1 == null || voltageLevelId2 == null || voltageLevelId1.equals(voltageLevelId2)) { - return; - } - addAdjacency(voltageLevelAdjacency, voltageLevelId1, voltageLevelId2); - - String substationId1 = context.cgmes().substation(t1, context.nodeBreaker()); - String substationId2 = context.cgmes().substation(t2, context.nodeBreaker()); - // Null could be received as substation at the boundary - if (substationId1 == null || substationId2 == null || substationId1.equals(substationId2)) { - return; - } - addAdjacency(substationAdjacency, substationId1, substationId2); - } - - // Two different substations are adjacent if they are connected by a transformer - private void addEnds(Map> substationAdjacency, PropertyBags tends) { - List substationsIds = substationsIds(tends); - if (substationsIds.size() <= 1) { - return; - } - String sub0 = substationsIds.get(0); - for (int i = 1; i < substationsIds.size(); i++) { - String subi = substationsIds.get(i); - - if (sub0.contentEquals(subi)) { - continue; - } - addAdjacency(substationAdjacency, sub0, subi); - } - } - - // Record in the adjacency Map that "id1 is adjacent to id2" and "id2 is adjacent to id1" - private static void addAdjacency(Map> adjacency, String id1, String id2) { - Set ad1 = adjacency.get(id1); - if (ad1 == null) { - throw new PowsyblException("Unexpected reference to Substation or voltageLevel " + id1 - + ". It has not been defined in CGMES substations / voltageLevels."); - } - Set ad2 = adjacency.get(id2); - if (ad2 == null) { - throw new PowsyblException("Unexpected reference to Substation or voltageLevel " + id2 - + ". It has not been defined in CGMES substations / voltageLevels."); - } - - ad1.add(id2); - ad2.add(id1); - } - - private void buildVoltageLevel(Map> voltageLevelAdjacency) { - Set visitedVoltageLevels = new HashSet<>(); - for (String vl : voltageLevelAdjacency.keySet()) { - if (!visitedVoltageLevels.contains(vl)) { - Set vlAds = allConnected(voltageLevelAdjacency, visitedVoltageLevels, vl); - String selectedVoltageLevelId = representativeVoltageLevelId(vlAds); - recordMergedIds(voltageLevelMapping, vlAds, selectedVoltageLevelId); - } - } - if (!voltageLevelMapping.isEmpty()) { - CgmesReports.voltageLevelMappingReport(context.getReportNode(), voltageLevelMapping.size(), voltageLevelMapping.toString()); - LOG.warn("Original {} VoltageLevel container(s) connected by switches have been merged in IIDM. Map of original VoltageLevel to IIDM: {}", - voltageLevelMapping.size(), voltageLevelMapping); - } - } - - private void buildSubstation(Map> substationAdjacency) { - Set visitedSubstations = new HashSet<>(); - for (String sub : substationAdjacency.keySet()) { - if (!visitedSubstations.contains(sub)) { - Set subAds = allConnected(substationAdjacency, visitedSubstations, sub); - String selectedSubstationId = representativeSubstationId(subAds); - recordMergedIds(substationMapping, subAds, selectedSubstationId); - } - } - if (!substationMapping.isEmpty()) { - CgmesReports.substationMappingReport(context.getReportNode(), substationMapping.size(), substationMapping.toString()); - LOG.warn("Original {} Substation container(s) connected by transformers have been merged in IIDM. Map of original Substation to IIDM: {}", - substationMapping.size(), substationMapping); - } - } - - // Given an id (substation / voltageLevel) returns all connected ids (substations / voltageLevels) - // Two ids are connected if they are adjacent in the adjacency Map - private static Set allConnected(Map> adjacency, Set visited, String id) { - ArrayList allConnected = new ArrayList<>(); - - // Insert id in the allConnected list and record it as visited - allConnected.add(id); - visited.add(id); - - // Expand, adding in each step all non-visited adjacent ids" - int k = 0; - while (k < allConnected.size()) { - String vl0 = allConnected.get(k); - if (adjacency.containsKey(vl0)) { - adjacency.get(vl0).forEach(ad -> { - if (visited.contains(ad)) { - return; - } - allConnected.add(ad); - visited.add(ad); - }); - } - k++; - } - return new HashSet<>(allConnected); - } - - private static String representativeVoltageLevelId(Collection voltageLevelIds) { - return voltageLevelIds.stream() - .sorted() - .findFirst() - .orElseThrow(() -> new IllegalStateException("Unexpected: voltageLevelIds list is empty")); - } - - private String representativeSubstationId(Collection substationIds) { - return substationIds.stream() - .filter(substationId -> context.config().substationIdsExcludedFromMapping() - .stream() - .noneMatch(substationId::matches)) - .sorted() - .findFirst() - .orElse(substationIds.iterator().next()); - } - - // For each merged substation a record (merged substation, representative substation) is added - // For each merged voltageLevel a record (merged voltageLevel, representative voltageLevel) is added - private static void recordMergedIds(Map mapping, Collection mergedIds, - String representativeId) { - for (String id : mergedIds) { - if (!id.equals(representativeId)) { - mapping.put(id, representativeId); - } - } - } - - private List substationsIds(PropertyBags tends) { - List substationsIds = new ArrayList<>(); - for (PropertyBag end : tends) { - CgmesTerminal t = context.cgmes().terminal(end.getId(CgmesNames.TERMINAL)); - String node = context.nodeBreaker() ? t.connectivityNode() : t.topologicalNode(); - if (node != null && !context.boundary().containsNode(node)) { - String sid = context.cgmes().substation(t, context.nodeBreaker()); - if (sid != null) { - substationsIds.add(context.namingStrategy().getIidmId(CgmesNames.SUBSTATION, sid)); - } - } - } - return substationsIds; - } - - private final Context context; - private final Map substationMapping; - private final Map voltageLevelMapping; - - private static final Logger LOG = LoggerFactory.getLogger(SubstationIdMapping.class); -} diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/AbstractConductingEquipmentConversion.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/AbstractConductingEquipmentConversion.java index 85ad9983d1d..a2dc767cfe9 100644 --- a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/AbstractConductingEquipmentConversion.java +++ b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/AbstractConductingEquipmentConversion.java @@ -12,10 +12,7 @@ import com.powsybl.cgmes.conversion.Conversion; import com.powsybl.cgmes.conversion.ConversionException; import com.powsybl.cgmes.extensions.CgmesDanglingLineBoundaryNodeAdder; -import com.powsybl.cgmes.model.CgmesModelException; -import com.powsybl.cgmes.model.CgmesNames; -import com.powsybl.cgmes.model.CgmesTerminal; -import com.powsybl.cgmes.model.PowerFlow; +import com.powsybl.cgmes.model.*; import com.powsybl.commons.PowsyblException; import com.powsybl.iidm.network.*; import com.powsybl.iidm.network.ThreeWindingsTransformerAdder.LegAdder; @@ -31,7 +28,7 @@ * @author Luma Zamarreño {@literal } *

* A ConductingEquipment has at least one Terminal. From the Terminal we - * get either its ConnectivityNode or its TopologicalNode, depending of + * get either its ConnectivityNode or its TopologicalNode, depending on * the conversion context */ public abstract class AbstractConductingEquipmentConversion extends AbstractIdentifiedObjectConversion { @@ -517,24 +514,30 @@ static class TerminalData { && context.boundary().containsNode(nodeId)) { cgmesVoltageLevelId = Context.boundaryVoltageLevelId(nodeId); } else { - // cgmesVoltageLevelId may be null if terminal is contained in a Line - // (happens in boundaries) - cgmesVoltageLevelId = context.cgmes().voltageLevel(t, context.nodeBreaker()); + // If the terminal's node is contained in a Line (happens in boundaries) or in a Substation, a fictitious VoltageLevel is created + cgmesVoltageLevelId = findCgmesVoltageLevelIdForContainer(nodeId, context); } if (cgmesVoltageLevelId != null) { String iidmVl = context.namingStrategy().getIidmId("VoltageLevel", cgmesVoltageLevelId); - iidmVoltageLevelId = context.substationIdMapping().voltageLevelIidm(iidmVl); + iidmVoltageLevelId = context.nodeContainerMapping().voltageLevelIidm(iidmVl); voltageLevel = context.network().getVoltageLevel(iidmVoltageLevelId); } else { - // if terminal is contained in a Line Container, a fictitious voltage level is created, - // its ID is composed by its connectivity node ID + '_VL' sufix - voltageLevel = context.network().getVoltageLevel(nodeId + "_VL"); - if (voltageLevel != null) { - iidmVoltageLevelId = nodeId + "_VL"; - } else { - iidmVoltageLevelId = null; + iidmVoltageLevelId = null; + voltageLevel = null; + } + } + + // if nodeId is included in a Line Container, the fictitious voltage level must be considered + private static String findCgmesVoltageLevelIdForContainer(String nodeId, Context context) { + String cgmesVoltageLevelId = null; + Optional cgmesContainer = context.cgmes().nodeContainer(nodeId); + if (cgmesContainer.isPresent()) { + cgmesVoltageLevelId = cgmesContainer.get().voltageLevel(); + if (cgmesVoltageLevelId == null) { + cgmesVoltageLevelId = context.nodeContainerMapping().getFictitiousVoltageLevelForContainer(cgmesContainer.get().id(), nodeId); } } + return cgmesVoltageLevelId; } } diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/NodeConversion.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/NodeConversion.java index 4824d744357..846d04f2628 100644 --- a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/NodeConversion.java +++ b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/NodeConversion.java @@ -9,7 +9,6 @@ package com.powsybl.cgmes.conversion.elements; import com.powsybl.cgmes.conversion.Context; -import com.powsybl.cgmes.conversion.Conversion; import com.powsybl.cgmes.conversion.CountryConversion; import com.powsybl.cgmes.model.CgmesNames; import com.powsybl.iidm.network.*; @@ -140,7 +139,7 @@ public void setVoltageAngleNodeBreaker() { return; } // To obtain a bus for which we want to set voltage: - // If there no Terminal at this IIDM node, + // If there is no Terminal at this IIDM node, // then find from it the first connected node with a Terminal Terminal t = topo.getOptionalTerminal(iidmNode) .orElseGet(() -> Networks.getEquivalentTerminal(vl, iidmNode)); @@ -166,16 +165,16 @@ private VoltageLevel voltageLevel() { if (insideBoundary() && context.config().convertBoundary()) { return context.network().getVoltageLevel(Context.boundaryVoltageLevelId(this.id)); } else if (!insideBoundary()) { - String containerId = p.getId("ConnectivityNodeContainer"); + String containerId = p.getId(CgmesNames.CONNECTIVITY_NODE_CONTAINER); String cgmesId = context.cgmes().container(containerId).voltageLevel(); if (cgmesId == null) { // A CGMES Voltage Level can not be obtained from the connectivity node container // The connectivity node container is a cim:Line, and // the conversion has created a fictitious voltage level in IIDM - cgmesId = Conversion.getFictitiousVoltageLevelForNodeInContainer(containerId, this.id); + cgmesId = context.nodeContainerMapping().getFictitiousVoltageLevelForContainer(containerId, this.id); } String iidm = context.namingStrategy().getIidmId(CgmesNames.VOLTAGE_LEVEL, cgmesId); - String iidmId = context.substationIdMapping().voltageLevelIidm(iidm); + String iidmId = context.nodeContainerMapping().voltageLevelIidm(iidm); return iidmId != null ? context.network().getVoltageLevel(iidmId) : null; } return null; @@ -183,8 +182,8 @@ private VoltageLevel voltageLevel() { private void newNode(VoltageLevel vl) { VoltageLevel.NodeBreakerView nbv = vl.getNodeBreakerView(); - String connectivityNode = id; - int iidmNode = context.nodeMapping().iidmNodeForConnectivityNode(connectivityNode, vl); + // id is the connectivityNode + int iidmNode = context.nodeMapping().iidmNodeForConnectivityNode(id, vl); // Busbar sections are created for every connectivity node to be // able to easily check the topology calculated by IIDM @@ -218,14 +217,7 @@ private boolean checkValidVoltageAngle(Bus bus) { } boolean valid = valid(v, angle); if (!valid) { - Supplier reason = () -> String.format("v = %f, angle = %f. Node %s", v, angle, id); - Supplier location = () -> bus == null - ? "No bus" - : String.format("Bus %s, %sVoltage level %s", - bus.getId(), - bus.getVoltageLevel().getSubstation().map(s -> "Substation " + s.getNameOrId() + ", ").orElse(""), - bus.getVoltageLevel().getNameOrId()); - Supplier message = () -> reason.get() + ". " + location.get(); + Supplier message = getStringSupplier(bus, v, angle); context.invalid("SvVoltage", message); if (bus != null) { @@ -237,6 +229,17 @@ private boolean checkValidVoltageAngle(Bus bus) { return valid; } + private Supplier getStringSupplier(Bus bus, double v, double angle) { + Supplier reason = () -> String.format("v = %f, angle = %f. Node %s", v, angle, id); + Supplier location = () -> bus == null + ? "No bus" + : String.format("Bus %s, %sVoltage level %s", + bus.getId(), + bus.getVoltageLevel().getSubstation().map(s -> "Substation " + s.getNameOrId() + ", ").orElse(""), + bus.getVoltageLevel().getNameOrId()); + return () -> reason.get() + ". " + location.get(); + } + private void setVoltageAngle(Bus bus) { Objects.requireNonNull(bus); double v = p.asDouble(CgmesNames.VOLTAGE); @@ -259,7 +262,7 @@ private boolean valid(double v, double angle) { // and the right values returned. // Another option could be to keep storing SV values (v=0, angle=0), // but perform a when a switch is converted, - // and ensure its both ends have the same values (v,angle). + // and ensure that both ends have the same values (v,angle). // This is what HELM integration layer does when mapping from IIDM to HELM. boolean valid = v > 0; diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/SubstationConversion.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/SubstationConversion.java index 2d1a0d00760..c552543df37 100644 --- a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/SubstationConversion.java +++ b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/SubstationConversion.java @@ -29,7 +29,7 @@ public SubstationConversion(PropertyBag s, Context context) { @Override public boolean valid() { // Only create IIDM Substations for CGMES substations that are not mapped to others - return !context.substationIdMapping().substationIsMapped(id); + return !context.nodeContainerMapping().substationIsMapped(id); } @Override @@ -44,7 +44,7 @@ public void convert() { // After applying naming strategy it is possible that two CGMES substations are mapped // to the same Network substation, so we should check if corresponding substation has // already been created - String iidmSubstationId = context.substationIdMapping().substationIidm(id); + String iidmSubstationId = context.nodeContainerMapping().substationIidm(id); Substation substation = context.network().getSubstation(iidmSubstationId); if (substation != null) { throw new IllegalStateException("Substation should be null"); @@ -63,7 +63,7 @@ public void convert() { private void addAliasesAndProperties(Substation s, String subRegionId, String regionId, String regionName) { int index = 0; - for (String mergedSub : context.substationIdMapping().mergedSubstations(s.getId())) { + for (String mergedSub : context.nodeContainerMapping().mergedSubstations(s.getId())) { index++; s.addAlias(mergedSub, "MergedSubstation" + index, context.config().isEnsureIdAliasUnicity()); } diff --git a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/VoltageLevelConversion.java b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/VoltageLevelConversion.java index 167f707eff6..3f9467aa213 100644 --- a/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/VoltageLevelConversion.java +++ b/cgmes/cgmes-conversion/src/main/java/com/powsybl/cgmes/conversion/elements/VoltageLevelConversion.java @@ -26,7 +26,7 @@ public class VoltageLevelConversion extends AbstractIdentifiedObjectConversion { public VoltageLevelConversion(PropertyBag vl, Context context) { super(CgmesNames.VOLTAGE_LEVEL, vl, context); cgmesSubstationId = p.getId("Substation"); - iidmSubstationId = context.substationIdMapping().substationIidm(cgmesSubstationId); + iidmSubstationId = context.nodeContainerMapping().substationIidm(cgmesSubstationId); substation = context.network().getSubstation(iidmSubstationId); } @@ -45,7 +45,7 @@ public boolean valid() { iidmSubstationId)); return false; } - return !context.substationIdMapping().voltageLevelIsMapped(id); + return !context.nodeContainerMapping().voltageLevelIsMapped(id); } @Override @@ -62,7 +62,7 @@ public void convert() { throw new CgmesModelException(String.format("nominalVoltage not found for %s", bv)); } - String iidmVoltageLevelId = context.substationIdMapping().voltageLevelIidm(id); + String iidmVoltageLevelId = context.nodeContainerMapping().voltageLevelIidm(id); VoltageLevel voltageLevel = context.network().getVoltageLevel(iidmVoltageLevelId); if (voltageLevel == null) { VoltageLevelAdder adder = substation.newVoltageLevel() @@ -81,7 +81,7 @@ public void convert() { private void addAliases(VoltageLevel vl) { int index = 0; - for (String mergedVl : context.substationIdMapping().mergedVoltageLevels(vl.getId())) { + for (String mergedVl : context.nodeContainerMapping().mergedVoltageLevels(vl.getId())) { index++; vl.addAlias(mergedVl, "MergedVoltageLevel" + index, context.config().isEnsureIdAliasUnicity()); } diff --git a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/ConversionUtil.java b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/ConversionUtil.java index f326c005bb2..449e7f76f20 100644 --- a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/ConversionUtil.java +++ b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/ConversionUtil.java @@ -7,12 +7,15 @@ */ package com.powsybl.cgmes.conversion.test; +import com.powsybl.cgmes.conversion.CgmesExport; import com.powsybl.cgmes.conversion.CgmesImportPostProcessor; import com.powsybl.cgmes.conversion.Conversion; import com.powsybl.cgmes.model.CgmesModel; import com.powsybl.cgmes.model.CgmesModelFactory; import com.powsybl.cgmes.model.GridModelReference; import com.powsybl.commons.datasource.ReadOnlyDataSource; +import com.powsybl.commons.datasource.ResourceDataSource; +import com.powsybl.commons.datasource.ResourceSet; import com.powsybl.iidm.network.Network; import com.powsybl.triplestore.api.TripleStoreFactory; @@ -25,8 +28,9 @@ import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Collections; -import java.util.List; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * @author Geoffroy Jamgotchian {@literal } @@ -84,4 +88,40 @@ public static boolean xmlContains(InputStream is, String clazz, String ns, Strin } return false; } + + public static Network readCgmesResources(String dir, String... files) { + return readCgmesResources(new Properties(), dir, files); + } + + public static Network readCgmesResources(Properties properties, String dir, String... files) { + ReadOnlyDataSource ds = new ResourceDataSource("CGMES input file(s)", new ResourceSet(dir, files)); + return Network.read(ds, properties); + } + + public static String writeCgmesProfile(Network network, String profile, Path outDir) throws IOException { + return writeCgmesProfile(network, profile, outDir, new Properties()); + } + + public static String writeCgmesProfile(Network network, String profile, Path outDir, Properties properties) throws IOException { + properties.put(CgmesExport.PROFILES, List.of(profile)); + network.write("CGMES", properties, outDir.resolve("CgmesExport")); + return Files.readString(outDir.resolve("CgmesExport_" + profile + ".xml")); + } + + public static String getFirstMatch(String text, Pattern pattern) { + Matcher matcher = pattern.matcher(text); + if (matcher.find()) { + return matcher.group(1); + } + return null; + } + + public static Set getUniqueMatches(String text, Pattern pattern) { + Set matches = new HashSet<>(); + Matcher matcher = pattern.matcher(text); + while (matcher.find()) { + matches.add(matcher.group(1)); + } + return matches; + } } diff --git a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/JoinVoltageLevelTest.java b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/JoinVoltageLevelTest.java deleted file mode 100644 index 12401530e8d..00000000000 --- a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/JoinVoltageLevelTest.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Copyright (c) 2020, 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.cgmes.conversion.test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import java.io.IOException; - -import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.powsybl.cgmes.conformity.CgmesConformity1ModifiedCatalog; -import com.powsybl.cgmes.conversion.Conversion; -import com.powsybl.cgmes.model.GridModelReference; -import com.powsybl.iidm.network.TwoSides; -import com.powsybl.iidm.network.*; - -/** - * @author Luma Zamarreño {@literal } - * @author José Antonio Marqués {@literal } - */ -class JoinVoltageLevelTest { - - @Test - void smallNodeBreakerJoinVoltageLevelSwitch() throws IOException { - Conversion.Config config = new Conversion.Config(); - Network n = networkModel(CgmesConformity1ModifiedCatalog.miniNodeBreakerJoinVoltageLevelSwitch(), config); - - Switch sw = n.getSwitch("5e9f0079-647e-46da-b0ee-f5f24e127602"); - VoltageLevel voltageLevel = sw.getVoltageLevel(); - Substation substation = voltageLevel.getSubstation().orElse(null); - - boolean ok = compareVoltageLevelSubstation("d6056127-34f1-43a9-b029-23fddb913bd5", "a43d15db-44a6-4fda-a525-2402ff43226f", substation.getId(), voltageLevel.getId()); - assertTrue(ok); - - VoltageLevel voltageLevelIidm = n.getVoltageLevel("a43d15db-44a6-4fda-a525-2402ff43226f"); - assertEquals("a43d15eb-44a6-4fda-a525-2402ff43226f", voltageLevelIidm.getAliasFromType("MergedVoltageLevel1").get()); - } - - @Test - void miniNodeBreakerSwitchBetweenVoltageLevelsOpen() throws IOException { - Conversion.Config config = new Conversion.Config(); - Network n = networkModel(CgmesConformity1ModifiedCatalog.miniNodeBreakerSwitchBetweenVoltageLevelsOpen(), config); - - Switch sw = n.getSwitch("5e9f0079-647e-46da-b0ee-f5f24e127602"); - assertNotNull(sw); - - boolean isOpen = sw.isOpen(); - assertTrue(isOpen); - - VoltageLevel voltageLevel = sw.getVoltageLevel(); - Substation substation = voltageLevel.getSubstation().orElse(null); - - boolean ok = compareVoltageLevelSubstation("d6056127-34f1-43a9-b029-23fddb913bd5", "a43d15db-44a6-4fda-a525-2402ff43226f", substation.getId(), voltageLevel.getId()); - assertTrue(ok); - } - - @Test - void smallNodeBreakerJoinVoltageLevelTx() throws IOException { - Conversion.Config config = new Conversion.Config(); - Network n = networkModel(CgmesConformity1ModifiedCatalog.miniNodeBreakerJoinVoltageLevelTx(), config); - - TwoWindingsTransformer t2x = n.getTwoWindingsTransformer("ceb5d06a-a7ff-4102-a620-7f3ea5fb4a51"); - Terminal t1 = t2x.getTerminal(TwoSides.ONE); - VoltageLevel voltageLevel1 = t1.getVoltageLevel(); - Terminal t2 = t2x.getTerminal(TwoSides.TWO); - VoltageLevel voltageLevel2 = t2.getVoltageLevel(); - - Substation substation = t2x.getSubstation().orElse(null); - - boolean ok = compareVoltageLevelSubstation("d6056127-34f1-43a9-b029-23fddb913bd5", - "a43d15db-44a6-4fda-a525-2402ff43226f", "0d68ac81-124d-4d21-afa8-6c503feef5b8", substation.getId(), - voltageLevel1.getId(), voltageLevel2.getId()); - assertTrue(ok); - - Substation substationIidm = n.getSubstation("d6056127-34f1-43a9-b029-23fddb913bd5"); - assertEquals("d6056137-34f1-43a9-b029-23fddb913bd5", substationIidm.getAliasFromType("MergedSubstation1").get()); - } - - private static Network networkModel(GridModelReference testGridModel, Conversion.Config config) throws IOException { - config.setConvertSvInjections(true); - return ConversionUtil.networkModel(testGridModel, config); - } - - private static boolean compareVoltageLevelSubstation(String expectedSubstationId, String expectedVoltageLevelId, - String actualSubstationId, String actualVoltageLevelId) { - boolean ok = true; - if (!expectedSubstationId.equals(actualSubstationId)) { - ok = false; - } - if (!expectedVoltageLevelId.equals(actualVoltageLevelId)) { - ok = false; - } - if (!ok) { - LOG.info("Substation expected: {} actual {}", expectedSubstationId, actualSubstationId); - LOG.info("VoltageLevel expected: {} actual {}", expectedVoltageLevelId, actualVoltageLevelId); - } - return ok; - } - - private static boolean compareVoltageLevelSubstation(String expectedSubstationId, String expectedVoltageLevelId1, - String expectedVoltageLevelId2, String actualSubstationId, String actualVoltageLevelId1, - String actualVoltageLevelId2) { - boolean ok = true; - if (!expectedSubstationId.equals(actualSubstationId)) { - ok = false; - } - if (!expectedVoltageLevelId1.equals(actualVoltageLevelId1)) { - ok = false; - } - if (!expectedVoltageLevelId2.equals(actualVoltageLevelId2)) { - ok = false; - } - if (!ok) { - LOG.info("Substation expected: {} actual {}", expectedSubstationId, actualSubstationId); - LOG.info("VoltageLevel1 expected: {} actual {}", expectedVoltageLevelId1, actualVoltageLevelId1); - LOG.info("VoltageLevel2 expected: {} actual {}", expectedVoltageLevelId2, actualVoltageLevelId2); - } - return ok; - } - - private static final Logger LOG = LoggerFactory.getLogger(JoinVoltageLevelTest.class); -} diff --git a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/LineContainersTest.java b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/LineContainersTest.java deleted file mode 100644 index a9effa5c612..00000000000 --- a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/LineContainersTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2024, 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.cgmes.conversion.test; - -import com.powsybl.iidm.network.*; -import org.junit.jupiter.api.Test; - -import java.util.List; - -import static org.junit.jupiter.api.Assertions.*; - -/** - * @author Luma Zamarreño {@literal } - */ - -class LineContainersTest { - - @Test - void testLineContainerWithOneACLSnotAssociated() { - // This unit test reproduces a configuration observed in public data from a European TSO (NG) - // where three ACLSs lie on a common connectivity node inside a cim:Line container - // Two of the ACLSs have an association with the cim:Line container - // The other does not any equipment container - - // A fictitious voltage level is created to hold the connectivity node inside the cim:Line container, - // All three ACLSs must be imported - // And they have to share a bus - - Network network = Network.read("line_container_3acls_EQ.xml", getClass().getResourceAsStream("/issues/line_container_3acls_EQ.xml")); - assertNotNull(network); - - // Check all three ACLSs have been imported - Line l1 = network.getLine("ACLS1-without-Line-Container"); - Line l2 = network.getLine("ACLS2"); - Line l3 = network.getLine("ACLS3"); - assertNotNull(l1); - assertNotNull(l2); - assertNotNull(l3); - - VoltageLevel vlNodeInsideLineContainer = l1.getTerminal2().getVoltageLevel(); - // Check that the fictitious voltage level created has a reference to the original Line container - assertEquals("LineContainer", vlNodeInsideLineContainer.getProperty("CGMES.LineContainerId")); - assertEquals("Line Container", vlNodeInsideLineContainer.getNameOrId()); - // Check that the only bus in the fictitious voltage level has a terminal for each line - assertEquals(1, vlNodeInsideLineContainer.getBusBreakerView().getBusCount()); - Bus tbus = vlNodeInsideLineContainer.getBusBreakerView().getBuses().iterator().next(); - assertEquals(3, tbus.getConnectedTerminalCount()); - assertEquals(List.of("ACLS1-without-Line-Container", "ACLS2", "ACLS3"), - tbus.getConnectedTerminalStream().map(Terminal::getConnectable).map(Connectable::getId).sorted().toList()); - } -} diff --git a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/NodeContainerMappingTest.java b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/NodeContainerMappingTest.java new file mode 100644 index 00000000000..4563ba35e85 --- /dev/null +++ b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/NodeContainerMappingTest.java @@ -0,0 +1,146 @@ +/** + * Copyright (c) 2024, 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.cgmes.conversion.test; + +import com.powsybl.cgmes.conversion.CgmesImport; +import com.powsybl.commons.test.AbstractSerDeTest; +import com.powsybl.iidm.network.*; +import org.junit.jupiter.api.Test; + +import java.util.Properties; +import java.util.Set; +import java.util.stream.Collectors; + +import static com.powsybl.cgmes.conversion.test.ConversionUtil.readCgmesResources; +import static org.junit.jupiter.api.Assertions.*; + +/** + * @author Romain Courtier {@literal } + */ + +class NodeContainerMappingTest extends AbstractSerDeTest { + + private static final String DIR = "/issues/node-containers/"; + + @Test + void nodeContainersConnectedBySwitchesTest() { + // CGMES network: + // Switch SW_AB connects nodes in VoltageLevels VL_1A, VL_1B of the same Substation ST_1. + // Switch SW_12 connects nodes in VoltageLevels VL_1B, VL_2 of Substations ST_1, ST_2. + // Switch SW_23 connects node in VoltageLevel VL_2 of Substation ST_2 with node in Substation ST_3. + // Switch SW_3L connects node in Substation ST_3 with node in Line LN_L. + // There is a BusbarSection attached to the node in VL_2 and a Load attached to the node in ST_3 + // IIDM network: + // Ends of switches must be in the same VoltageLevel. So none of the situation above is allowed. + // In such cases, a representative Substation and VoltageLevel are determined and gather all the elements. + Network network = readCgmesResources(DIR, "containers_connected_by_switches.xml"); + assertNotNull(network); + + // All Substations and VoltageLevels are adjacent. Only 1 of each is kept. + assertEquals(1, network.getSubstationCount()); + assertEquals(1, network.getVoltageLevelCount()); + + // Representatives are ST_1 and VL_1A (min in alphabetical order). + assertNotNull(network.getSubstation("ST_1")); + assertNotNull(network.getVoltageLevel("VL_1A")); + + // Merged Substations and VoltageLevels are saved in aliases. + assertEquals(Set.of("ST_2", "ST_3"), network.getSubstation("ST_1").getAliases()); + assertEquals(Set.of("VL_1B", "VL_2", "CN_3_VL", "CN_L_VL"), network.getVoltageLevel("VL_1A").getAliases()); + + // Verify that the Load has been imported and has a Bus + assertNotNull(network.getLoad("LD")); + assertNotNull(network.getLoad("LD").getTerminal().getBusView().getBus()); + } + + @Test + void nodeOfTJunctionInLineContainerTest() { + // CGMES network: + // 3 VoltageLevels VL_1, VL_2, VL_3 are connected together through line segments in a T-junction. + // ACLineSegments ACL_1A, ACL_2A are in Line LN_A, but ACL_3A has no EquipmentContainer. + // Node CN_A of T-junction is directly in Line Container LN_A. + // IIDM network: + // Nodes must be within a VoltageLevel. + // If that is not the case and no real representative can be found, a fictitious one is created. + Network network = readCgmesResources(DIR, "line_with_t-junction.xml"); + assertNotNull(network); + + // There is no real representative VoltageLevel for node CN_A, so a fictitious one has been created. + VoltageLevel innerVL = network.getVoltageLevel("CN_A_VL"); + assertNotNull(innerVL); + assertNull(innerVL.getNullableSubstation()); + assertEquals("LN_A", innerVL.getProperty("CGMES.LineContainerId")); + + // All line segments have been imported (even if not associated to an EquipmentContainer) and connected together + assertEquals(3, network.getLineCount()); + assertEquals(3, innerVL.getBusBreakerView().getBuses().iterator().next().getConnectedTerminalCount()); + } + + @Test + void chainedLineSegmentsTest() { + // CGMES network: + // 2 Substations ST_1, ST_2 connected by 3 ACLineSegments in a row: ACL_1A, ACL_AB, ACL_B2. + // The 3 ACLineSegments are in the Line container LN_12. + // Extremity nodes CN_A and CN_B of ACL_AB are in LN_12, nodes CN_1, CN_2 are in VL_1, VL_2 of ST_1, ST_2. + // IIDM network: + // Nodes must be within a VoltageLevel. In case of multiple nodes in the same non-VoltageLevel container, + // a parameter allows to create a fictitious VoltageLevel for every node or for that container + Properties importParams = new Properties(); + importParams.put(CgmesImport.CREATE_FICTITIOUS_VOLTAGE_LEVEL_FOR_EVERY_NODE, "false"); + Network network = readCgmesResources(importParams, DIR, "chained_line_segments.xml"); + assertNotNull(network); + assertEquals(Set.of("VL_1", "VL_2", "LN_12_VL"), + network.getVoltageLevelStream().map(Identifiable::getId).collect(Collectors.toSet())); + + importParams.put(CgmesImport.CREATE_FICTITIOUS_VOLTAGE_LEVEL_FOR_EVERY_NODE, "true"); + network = readCgmesResources(importParams, DIR, "chained_line_segments.xml"); + assertNotNull(network); + assertEquals(Set.of("VL_1", "VL_2", "CN_A_VL", "CN_B_VL"), + network.getVoltageLevelStream().map(Identifiable::getId).collect(Collectors.toSet())); + } + + @Test + void substationsConnectedByTransformerTest() { + // CGMES network: + // 3-winding transformer connects nodes in VoltageLevels VL_1, VL_2, VL_3 of Substations ST_1, ST_2, ST_3. + // IIDM network: + // Ends of transformers need to be in the same Substation. So the situation above is not allowed. + // In such a case, a representative Substation is determined and gathers all the elements. + Network network = readCgmesResources(DIR, "substations_connected_by_transformer.xml"); + assertNotNull(network); + + // All Substations are adjacent, only 1 is kept. + assertEquals(1, network.getSubstationCount()); + + // Representative is ST_1 (min in alphabetical order). + assertNotNull(network.getSubstation("ST_1")); + + // Merged Substations are saved in aliases. + assertEquals(Set.of("ST_2", "ST_3"), network.getSubstation("ST_1").getAliases()); + } + + @Test + void voltageLevelsConnectedByOpenSwitchTest() { + // CGMES network: + // VoltageLevel VL_1 and VL_2 in Substation ST are connected by Switch SW_12 which is open in SSH. + // IIDM network: + // Ends of switches must be in the same VoltageLevel regardless the switch status in SSH. + + Network network = readCgmesResources(DIR, + "voltage_levels_connected_by_open_switch_EQ.xml", "voltage_levels_connected_by_open_switch_SSH.xml"); + assertNotNull(network); + + // The Switch is indeed open. + assertTrue(network.getSwitch("SW_12").isOpen()); + + // Still there is only one VoltageLevel. + assertEquals(1, network.getVoltageLevelCount()); + assertNotNull(network.getVoltageLevel("VL_1")); + } +} diff --git a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/OperationalLimitsGroupTest.java b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/OperationalLimitsGroupTest.java index 21b6a67f6e9..e778289b383 100644 --- a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/OperationalLimitsGroupTest.java +++ b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/OperationalLimitsGroupTest.java @@ -16,9 +16,9 @@ import java.io.IOException; import java.nio.file.Files; import java.util.*; -import java.util.regex.Matcher; import java.util.regex.Pattern; +import static com.powsybl.cgmes.conversion.test.ConversionUtil.getUniqueMatches; import static org.junit.jupiter.api.Assertions.*; /** @@ -65,10 +65,10 @@ void exportSelectedLimitsGroupTest() throws IOException { String exportSelectedLimitsGroupXml = Files.readString(tmpDir.resolve("ExportSelectedLimitsGroup_EQ.xml")); // There is 1 set on side 1 which is selected, and there are 2 sets on side 2 but none of them is selected - assertEquals(1, getOccurrences(exportSelectedLimitsGroupXml, OPERATIONAL_LIMIT_SET).size()); - assertEquals(3, getOccurrences(exportSelectedLimitsGroupXml, OPERATIONAL_LIMIT_TYPE).size()); - assertEquals(0, getOccurrences(exportSelectedLimitsGroupXml, ACTIVE_POWER_LIMIT).size()); - assertEquals(3, getOccurrences(exportSelectedLimitsGroupXml, CURRENT_LIMIT).size()); + assertEquals(1, getUniqueMatches(exportSelectedLimitsGroupXml, OPERATIONAL_LIMIT_SET).size()); + assertEquals(3, getUniqueMatches(exportSelectedLimitsGroupXml, OPERATIONAL_LIMIT_TYPE).size()); + assertEquals(0, getUniqueMatches(exportSelectedLimitsGroupXml, ACTIVE_POWER_LIMIT).size()); + assertEquals(3, getUniqueMatches(exportSelectedLimitsGroupXml, CURRENT_LIMIT).size()); // Manually select one of the limits group on side 2 and export again Line line = network.getLine("Line"); @@ -77,10 +77,10 @@ void exportSelectedLimitsGroupTest() throws IOException { exportSelectedLimitsGroupXml = Files.readString(tmpDir.resolve("ExportSelectedLimitsGroup_EQ.xml")); // That makes 1 set selected on each side = 2 in total - assertEquals(2, getOccurrences(exportSelectedLimitsGroupXml, OPERATIONAL_LIMIT_SET).size()); - assertEquals(3, getOccurrences(exportSelectedLimitsGroupXml, OPERATIONAL_LIMIT_TYPE).size()); - assertEquals(0, getOccurrences(exportSelectedLimitsGroupXml, ACTIVE_POWER_LIMIT).size()); - assertEquals(6, getOccurrences(exportSelectedLimitsGroupXml, CURRENT_LIMIT).size()); + assertEquals(2, getUniqueMatches(exportSelectedLimitsGroupXml, OPERATIONAL_LIMIT_SET).size()); + assertEquals(3, getUniqueMatches(exportSelectedLimitsGroupXml, OPERATIONAL_LIMIT_TYPE).size()); + assertEquals(0, getUniqueMatches(exportSelectedLimitsGroupXml, ACTIVE_POWER_LIMIT).size()); + assertEquals(6, getUniqueMatches(exportSelectedLimitsGroupXml, CURRENT_LIMIT).size()); } @Test @@ -95,19 +95,10 @@ void exportAllLimitsGroupTest() throws IOException { String exportAllLimitsGroupXml = Files.readString(tmpDir.resolve("ExportAllLimitsGroup_EQ.xml")); // All 3 OperationalLimitsGroup are exported, even though only 2 are selected - assertEquals(3, getOccurrences(exportAllLimitsGroupXml, OPERATIONAL_LIMIT_SET).size()); - assertEquals(3, getOccurrences(exportAllLimitsGroupXml, OPERATIONAL_LIMIT_TYPE).size()); - assertEquals(3, getOccurrences(exportAllLimitsGroupXml, ACTIVE_POWER_LIMIT).size()); - assertEquals(9, getOccurrences(exportAllLimitsGroupXml, CURRENT_LIMIT).size()); - } - - private Set getOccurrences(String xml, Pattern pattern) { - Set matches = new HashSet<>(); - Matcher matcher = pattern.matcher(xml); - while (matcher.find()) { - matches.add(matcher.group(1)); - } - return matches; + assertEquals(3, getUniqueMatches(exportAllLimitsGroupXml, OPERATIONAL_LIMIT_SET).size()); + assertEquals(3, getUniqueMatches(exportAllLimitsGroupXml, OPERATIONAL_LIMIT_TYPE).size()); + assertEquals(3, getUniqueMatches(exportAllLimitsGroupXml, ACTIVE_POWER_LIMIT).size()); + assertEquals(9, getUniqueMatches(exportAllLimitsGroupXml, CURRENT_LIMIT).size()); } } diff --git a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/conformity/modified/CgmesConformity1ModifiedConversionTest.java b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/conformity/modified/CgmesConformity1ModifiedConversionTest.java index ce19719bc92..b9001de9f75 100644 --- a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/conformity/modified/CgmesConformity1ModifiedConversionTest.java +++ b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/conformity/modified/CgmesConformity1ModifiedConversionTest.java @@ -836,21 +836,6 @@ void miniNodeBreakerLoadBreakSwitch() { assertEquals(SwitchKind.LOAD_BREAK_SWITCH, sw.getKind()); } - @Test - void miniNodeBreakerCimLine() { - Network network = new CgmesImport() - .importData(CgmesConformity1ModifiedCatalog.miniNodeBreakerCimLine().dataSource(), - NetworkFactory.findDefault(), importParams); - - VoltageLevel vl = network.getVoltageLevel("d3de846d-5271-465e-8558-3e736fa120c4_2_VL"); - assertNotNull(vl); - assertNull(vl.getNullableSubstation()); - - vl = network.getVoltageLevel("e2f8de8c-3191-4676-9ee7-f920e46f9085_2_VL"); - assertNotNull(vl); - assertNull(vl.getNullableSubstation()); - } - @Test void miniNodeBreakerProtectedSwitch() { Network network = new CgmesImport() @@ -863,19 +848,6 @@ void miniNodeBreakerProtectedSwitch() { assertEquals(SwitchKind.BREAKER, sw.getKind()); } - @Test - void miniNodeBreakerSubstationNode() { - Network network = new CgmesImport() - .importData(CgmesConformity1ModifiedCatalog.miniNodeBreakerSubstationNode().dataSource(), - NetworkFactory.findDefault(), importParams); - assertNotNull(network); // Check it doesn't fail when a connectivity node is in substation - // Check that the test load is connected to a proper bus in the bus view - Load testLoad = network.getLoad("TEST_LOAD"); - assertNotNull(testLoad); - Bus testBus = testLoad.getTerminal().getBusView().getBus(); - assertNotNull(testBus); - } - @Test void miniNodeBreakerMissingSubstationRegion() { // Check that we fail with a powsybl exception instead of a NPE diff --git a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/CgmesExportTest.java b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/CgmesExportTest.java index f5e9f4c5977..18b05913d20 100644 --- a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/CgmesExportTest.java +++ b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/CgmesExportTest.java @@ -446,15 +446,17 @@ void testFromIidmDanglingLineNodeBreakerNoBoundaries() throws IOException { @Test void testLineContainersNotInBoundaries() throws IOException { - ReadOnlyDataSource ds = CgmesConformity1ModifiedCatalog.miniNodeBreakerCimLine().dataSource(); - Network network = Network.read(CgmesConformity1ModifiedCatalog.miniNodeBreakerCimLine().dataSource(), importParams); + ReadOnlyDataSource ds = new ResourceDataSource("Node of T-junction in line container", + new ResourceSet("/issues/node-containers/", "line_with_t-junction.xml")); + Network network = Network.read(ds, importParams); String exportFolder = "/test-line-containers-not-in-boundaries"; try (FileSystem fs = Jimfs.newFileSystem(Configuration.unix())) { // Export to CGMES and add boundary EQ for reimport Path tmpDir = Files.createDirectory(fs.getPath(exportFolder)); String baseName = "testLineContainersNotInBoundaries"; - ReadOnlyDataSource exportedCgmes = exportAndAddBoundaries(network, tmpDir, baseName, ds); + network.write("CGMES", null, tmpDir.resolve(baseName)); + ReadOnlyDataSource exportedCgmes = new GenericReadOnlyDataSource(tmpDir, baseName); // Check that the exported CGMES model contains a fictitious substation CgmesModel cgmes = CgmesModelFactory.create(exportedCgmes, TripleStoreFactory.defaultImplementation()); diff --git a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/CommonGridModelExportTest.java b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/CommonGridModelExportTest.java index 26f2917527d..e3d30b1021b 100644 --- a/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/CommonGridModelExportTest.java +++ b/cgmes/cgmes-conversion/src/test/java/com/powsybl/cgmes/conversion/test/export/CommonGridModelExportTest.java @@ -15,7 +15,6 @@ import com.powsybl.cgmes.model.CgmesMetadataModel; import com.powsybl.cgmes.model.CgmesNamespace; import com.powsybl.cgmes.model.CgmesSubset; -import com.powsybl.commons.PowsyblException; import com.powsybl.commons.datasource.DataSource; import com.powsybl.commons.datasource.DirectoryDataSource; import com.powsybl.commons.datasource.MemDataSource; @@ -35,9 +34,9 @@ import java.nio.file.Path; import java.time.ZonedDateTime; import java.util.*; -import java.util.regex.Matcher; import java.util.regex.Pattern; +import static com.powsybl.cgmes.conversion.test.ConversionUtil.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -80,8 +79,8 @@ void testIgmExportNoModelsNoPropertiesVersion() throws IOException { String exportedBeSvXml = Files.readString(tmpDir.resolve(basename + "_SV.xml")); // There is no version number for original models, so if exported as IGM they would have version equals to 1 - assertEquals("1", getFirstOccurrence(exportedBeSshXml, REGEX_VERSION)); - assertEquals("1", getFirstOccurrence(exportedBeSvXml, REGEX_VERSION)); + assertEquals("1", getFirstMatch(exportedBeSshXml, REGEX_VERSION)); + assertEquals("1", getFirstMatch(exportedBeSvXml, REGEX_VERSION)); } @Test @@ -99,9 +98,9 @@ void testCgmExportWithModelsVersion() throws IOException { String updatedCgmSvXml = Files.readString(tmpDir.resolve(basename + "_SV.xml")); // Version number should be increased from original models and be the same for all instance files - assertEquals("1", getFirstOccurrence(updatedBeSshXml, REGEX_VERSION)); - assertEquals("1", getFirstOccurrence(updatedNlSshXml, REGEX_VERSION)); - assertEquals("1", getFirstOccurrence(updatedCgmSvXml, REGEX_VERSION)); + assertEquals("1", getFirstMatch(updatedBeSshXml, REGEX_VERSION)); + assertEquals("1", getFirstMatch(updatedNlSshXml, REGEX_VERSION)); + assertEquals("1", getFirstMatch(updatedCgmSvXml, REGEX_VERSION)); } @Test @@ -119,20 +118,20 @@ void testCgmExportNoModelsNoProperties() throws IOException { String updatedCgmSvXml = Files.readString(tmpDir.resolve(basename + "_SV.xml")); // Scenario time should be the same for all models - assertEquals("2021-02-03T04:30:00Z", getFirstOccurrence(updatedBeSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2021-02-03T04:30:00Z", getFirstOccurrence(updatedNlSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2021-02-03T04:30:00Z", getFirstOccurrence(updatedCgmSvXml, REGEX_SCENARIO_TIME)); + assertEquals("2021-02-03T04:30:00Z", getFirstMatch(updatedBeSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2021-02-03T04:30:00Z", getFirstMatch(updatedNlSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2021-02-03T04:30:00Z", getFirstMatch(updatedCgmSvXml, REGEX_SCENARIO_TIME)); // Description should be the default one - assertEquals("SSH Model", getFirstOccurrence(updatedBeSshXml, REGEX_DESCRIPTION)); - assertEquals("SSH Model", getFirstOccurrence(updatedNlSshXml, REGEX_DESCRIPTION)); - assertEquals("SV Model", getFirstOccurrence(updatedCgmSvXml, REGEX_DESCRIPTION)); + assertEquals("SSH Model", getFirstMatch(updatedBeSshXml, REGEX_DESCRIPTION)); + assertEquals("SSH Model", getFirstMatch(updatedNlSshXml, REGEX_DESCRIPTION)); + assertEquals("SV Model", getFirstMatch(updatedCgmSvXml, REGEX_DESCRIPTION)); // There is no version number for original models, so if exported as IGM they would have version equals to 1 // Version number for updated models is increased by 1, so it equals to 2 in the end - assertEquals("2", getFirstOccurrence(updatedBeSshXml, REGEX_VERSION)); - assertEquals("2", getFirstOccurrence(updatedNlSshXml, REGEX_VERSION)); - assertEquals("2", getFirstOccurrence(updatedCgmSvXml, REGEX_VERSION)); + assertEquals("2", getFirstMatch(updatedBeSshXml, REGEX_VERSION)); + assertEquals("2", getFirstMatch(updatedNlSshXml, REGEX_VERSION)); + assertEquals("2", getFirstMatch(updatedCgmSvXml, REGEX_VERSION)); // The updated CGM SV should depend on the updated IGMs SSH and on the original IGMs TP // Here the version number part of the id 1 for original models and 2 for updated ones @@ -143,27 +142,27 @@ void testCgmExportNoModelsNoProperties() throws IOException { String originalBeTpBdId = "urn:uuid:Network_BE_N_TOPOLOGY_BOUNDARY_2021-02-03T04:30:00Z_1_1D__FM"; String originalNlTpBdId = "urn:uuid:Network_NL_N_TOPOLOGY_BOUNDARY_2021-02-03T04:30:00Z_1_1D__FM"; Set expectedDependencies = Set.of(updatedBeSshId, updatedNlSshId, originalBeTpId, originalNlTpId, originalBeTpBdId, originalNlTpBdId); - assertEquals(expectedDependencies, getOccurrences(updatedCgmSvXml, REGEX_DEPENDENT_ON)); + assertEquals(expectedDependencies, getUniqueMatches(updatedCgmSvXml, REGEX_DEPENDENT_ON)); // Each updated IGM SSH should supersede the original one and depend on the original EQ String originalBeSshId = "urn:uuid:Network_BE_N_STEADY_STATE_HYPOTHESIS_2021-02-03T04:30:00Z_1_1D__FM"; String originalBeEqId = "urn:uuid:Network_BE_N_EQUIPMENT_2021-02-03T04:30:00Z_1_1D__FM"; String originalNlSshId = "urn:uuid:Network_NL_N_STEADY_STATE_HYPOTHESIS_2021-02-03T04:30:00Z_1_1D__FM"; String originalNlEqId = "urn:uuid:Network_NL_N_EQUIPMENT_2021-02-03T04:30:00Z_1_1D__FM"; - assertEquals(originalBeSshId, getFirstOccurrence(updatedBeSshXml, REGEX_SUPERSEDES)); - assertEquals(originalBeEqId, getFirstOccurrence(updatedBeSshXml, REGEX_DEPENDENT_ON)); - assertEquals(originalNlSshId, getFirstOccurrence(updatedNlSshXml, REGEX_SUPERSEDES)); - assertEquals(originalNlEqId, getFirstOccurrence(updatedNlSshXml, REGEX_DEPENDENT_ON)); + assertEquals(originalBeSshId, getFirstMatch(updatedBeSshXml, REGEX_SUPERSEDES)); + assertEquals(originalBeEqId, getFirstMatch(updatedBeSshXml, REGEX_DEPENDENT_ON)); + assertEquals(originalNlSshId, getFirstMatch(updatedNlSshXml, REGEX_SUPERSEDES)); + assertEquals(originalNlEqId, getFirstMatch(updatedNlSshXml, REGEX_DEPENDENT_ON)); // Profiles should be consistent with the instance files - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedBeSshXml, REGEX_PROFILE)); - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedNlSshXml, REGEX_PROFILE)); - assertEquals("http://entsoe.eu/CIM/StateVariables/4/1", getFirstOccurrence(updatedCgmSvXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedBeSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedNlSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/StateVariables/4/1", getFirstMatch(updatedCgmSvXml, REGEX_PROFILE)); // All MAS should be equal to the default one since none has been provided - assertEquals("powsybl.org", getFirstOccurrence(updatedBeSshXml, REGEX_MAS)); - assertEquals("powsybl.org", getFirstOccurrence(updatedNlSshXml, REGEX_MAS)); - assertEquals("powsybl.org", getFirstOccurrence(updatedCgmSvXml, REGEX_MAS)); + assertEquals("powsybl.org", getFirstMatch(updatedBeSshXml, REGEX_MAS)); + assertEquals("powsybl.org", getFirstMatch(updatedNlSshXml, REGEX_MAS)); + assertEquals("powsybl.org", getFirstMatch(updatedCgmSvXml, REGEX_MAS)); } @Test @@ -182,19 +181,19 @@ void testCgmExportWithModelsForSubnetworks() throws IOException { String updatedCgmSvXml = Files.readString(tmpDir.resolve(basename + "_SV.xml")); // Scenario time should be the same for all models - assertEquals("2021-02-03T04:30:00Z", getFirstOccurrence(updatedBeSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2021-02-03T04:30:00Z", getFirstOccurrence(updatedNlSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2021-02-03T04:30:00Z", getFirstOccurrence(updatedCgmSvXml, REGEX_SCENARIO_TIME)); + assertEquals("2021-02-03T04:30:00Z", getFirstMatch(updatedBeSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2021-02-03T04:30:00Z", getFirstMatch(updatedNlSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2021-02-03T04:30:00Z", getFirstMatch(updatedCgmSvXml, REGEX_SCENARIO_TIME)); // IGM descriptions should be the ones provided in subnetwork models, CGM description should be the default one - assertEquals("BE network description", getFirstOccurrence(updatedBeSshXml, REGEX_DESCRIPTION)); - assertEquals("NL network description", getFirstOccurrence(updatedNlSshXml, REGEX_DESCRIPTION)); - assertEquals("SV Model", getFirstOccurrence(updatedCgmSvXml, REGEX_DESCRIPTION)); + assertEquals("BE network description", getFirstMatch(updatedBeSshXml, REGEX_DESCRIPTION)); + assertEquals("NL network description", getFirstMatch(updatedNlSshXml, REGEX_DESCRIPTION)); + assertEquals("SV Model", getFirstMatch(updatedCgmSvXml, REGEX_DESCRIPTION)); // Version number should be increased from original models and be the same for all instance files - assertEquals("2", getFirstOccurrence(updatedBeSshXml, REGEX_VERSION)); - assertEquals("2", getFirstOccurrence(updatedNlSshXml, REGEX_VERSION)); - assertEquals("2", getFirstOccurrence(updatedCgmSvXml, REGEX_VERSION)); + assertEquals("2", getFirstMatch(updatedBeSshXml, REGEX_VERSION)); + assertEquals("2", getFirstMatch(updatedNlSshXml, REGEX_VERSION)); + assertEquals("2", getFirstMatch(updatedCgmSvXml, REGEX_VERSION)); // The updated CGM SV should depend on the updated IGMs SSH and on the original IGMs TP String updatedBeSshId = "urn:uuid:Network_BE_N_STEADY_STATE_HYPOTHESIS_2021-02-03T04:30:00Z_2_1D__FM"; @@ -203,25 +202,25 @@ void testCgmExportWithModelsForSubnetworks() throws IOException { String originalNlTpId = "urn:uuid:Network_NL_N_TOPOLOGY_2021-02-03T04:30:00Z_1_1D__FM"; String originalTpBdId = "Common TP_BD model ID"; Set expectedDependencies = Set.of(updatedBeSshId, updatedNlSshId, originalBeTpId, originalNlTpId, originalTpBdId); - assertEquals(expectedDependencies, getOccurrences(updatedCgmSvXml, REGEX_DEPENDENT_ON)); + assertEquals(expectedDependencies, getUniqueMatches(updatedCgmSvXml, REGEX_DEPENDENT_ON)); // Each updated IGM SSH should supersede the original one and depend on the original EQ String originalBeSshId = "urn:uuid:Network_BE_N_STEADY_STATE_HYPOTHESIS_2021-02-03T04:30:00Z_1_1D__FM"; String originalNlSshId = "urn:uuid:Network_NL_N_STEADY_STATE_HYPOTHESIS_2021-02-03T04:30:00Z_1_1D__FM"; - assertEquals(originalBeSshId, getFirstOccurrence(updatedBeSshXml, REGEX_SUPERSEDES)); - assertEquals(originalNlSshId, getFirstOccurrence(updatedNlSshXml, REGEX_SUPERSEDES)); - assertEquals(Set.of("BE EQ model ID"), getOccurrences(updatedBeSshXml, REGEX_DEPENDENT_ON)); - assertEquals(Set.of("NL EQ model ID"), getOccurrences(updatedNlSshXml, REGEX_DEPENDENT_ON)); + assertEquals(originalBeSshId, getFirstMatch(updatedBeSshXml, REGEX_SUPERSEDES)); + assertEquals(originalNlSshId, getFirstMatch(updatedNlSshXml, REGEX_SUPERSEDES)); + assertEquals(Set.of("BE EQ model ID"), getUniqueMatches(updatedBeSshXml, REGEX_DEPENDENT_ON)); + assertEquals(Set.of("NL EQ model ID"), getUniqueMatches(updatedNlSshXml, REGEX_DEPENDENT_ON)); // Profiles should be consistent with the instance files - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedBeSshXml, REGEX_PROFILE)); - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedNlSshXml, REGEX_PROFILE)); - assertEquals("http://entsoe.eu/CIM/StateVariables/4/1", getFirstOccurrence(updatedCgmSvXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedBeSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedNlSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/StateVariables/4/1", getFirstMatch(updatedCgmSvXml, REGEX_PROFILE)); // IGM MAS should be the ones provided in subnetwork models, CGM MAS should be the default one - assertEquals("http://elia.be/CGMES/2.4.15", getFirstOccurrence(updatedBeSshXml, REGEX_MAS)); - assertEquals("http://tennet.nl/CGMES/2.4.15", getFirstOccurrence(updatedNlSshXml, REGEX_MAS)); - assertEquals("powsybl.org", getFirstOccurrence(updatedCgmSvXml, REGEX_MAS)); + assertEquals("http://elia.be/CGMES/2.4.15", getFirstMatch(updatedBeSshXml, REGEX_MAS)); + assertEquals("http://tennet.nl/CGMES/2.4.15", getFirstMatch(updatedNlSshXml, REGEX_MAS)); + assertEquals("powsybl.org", getFirstMatch(updatedCgmSvXml, REGEX_MAS)); } @Test @@ -242,20 +241,20 @@ void testCgmExportWithModelsForAllNetworks() throws IOException { // The main network has a different scenario time than the subnetworks // All updated models should get that scenario time - assertEquals("2022-03-04T05:30:00Z", getFirstOccurrence(updatedBeSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2022-03-04T05:30:00Z", getFirstOccurrence(updatedNlSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2022-03-04T05:30:00Z", getFirstOccurrence(updatedCgmSvXml, REGEX_SCENARIO_TIME)); + assertEquals("2022-03-04T05:30:00Z", getFirstMatch(updatedBeSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2022-03-04T05:30:00Z", getFirstMatch(updatedNlSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2022-03-04T05:30:00Z", getFirstMatch(updatedCgmSvXml, REGEX_SCENARIO_TIME)); // IGM descriptions should be the ones provided in subnetwork models, CGM description should be the one provided in main network model - assertEquals("BE network description", getFirstOccurrence(updatedBeSshXml, REGEX_DESCRIPTION)); - assertEquals("NL network description", getFirstOccurrence(updatedNlSshXml, REGEX_DESCRIPTION)); - assertEquals("Merged network description", getFirstOccurrence(updatedCgmSvXml, REGEX_DESCRIPTION)); + assertEquals("BE network description", getFirstMatch(updatedBeSshXml, REGEX_DESCRIPTION)); + assertEquals("NL network description", getFirstMatch(updatedNlSshXml, REGEX_DESCRIPTION)); + assertEquals("Merged network description", getFirstMatch(updatedCgmSvXml, REGEX_DESCRIPTION)); // The main network has a different version number (3) than the subnetworks (1) // Updated models should use next version taking into account the max version number of inputs (next version is 4) - assertEquals("4", getFirstOccurrence(updatedBeSshXml, REGEX_VERSION)); - assertEquals("4", getFirstOccurrence(updatedNlSshXml, REGEX_VERSION)); - assertEquals("4", getFirstOccurrence(updatedCgmSvXml, REGEX_VERSION)); + assertEquals("4", getFirstMatch(updatedBeSshXml, REGEX_VERSION)); + assertEquals("4", getFirstMatch(updatedNlSshXml, REGEX_VERSION)); + assertEquals("4", getFirstMatch(updatedCgmSvXml, REGEX_VERSION)); // The updated CGM SV should depend on the updated IGMs SSH and on the original IGMs TP // The model of the main network brings an additional dependency @@ -267,27 +266,27 @@ void testCgmExportWithModelsForAllNetworks() throws IOException { String additionalDependency = "Additional dependency"; Set expectedDependencies = Set.of(updatedBeSshId, updatedNlSshId, originalBeTpId, originalNlTpId, originalTpBdId, additionalDependency); - assertEquals(expectedDependencies, getOccurrences(updatedCgmSvXml, REGEX_DEPENDENT_ON)); + assertEquals(expectedDependencies, getUniqueMatches(updatedCgmSvXml, REGEX_DEPENDENT_ON)); // Each updated IGM SSH should supersede the original one and depend on the original EQ String originalBeSshId = "urn:uuid:Network_BE_N_STEADY_STATE_HYPOTHESIS_2022-03-04T05:30:00Z_1_1D__FM"; String originalNlSshId = "urn:uuid:Network_NL_N_STEADY_STATE_HYPOTHESIS_2022-03-04T05:30:00Z_1_1D__FM"; - assertEquals(originalBeSshId, getFirstOccurrence(updatedBeSshXml, REGEX_SUPERSEDES)); - assertEquals(originalNlSshId, getFirstOccurrence(updatedNlSshXml, REGEX_SUPERSEDES)); - assertEquals(Set.of("BE EQ model ID"), getOccurrences(updatedBeSshXml, REGEX_DEPENDENT_ON)); - assertEquals(Set.of("NL EQ model ID"), getOccurrences(updatedNlSshXml, REGEX_DEPENDENT_ON)); + assertEquals(originalBeSshId, getFirstMatch(updatedBeSshXml, REGEX_SUPERSEDES)); + assertEquals(originalNlSshId, getFirstMatch(updatedNlSshXml, REGEX_SUPERSEDES)); + assertEquals(Set.of("BE EQ model ID"), getUniqueMatches(updatedBeSshXml, REGEX_DEPENDENT_ON)); + assertEquals(Set.of("NL EQ model ID"), getUniqueMatches(updatedNlSshXml, REGEX_DEPENDENT_ON)); // Profiles should be consistent with the instance files // The model of the main network brings an additional profile - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedBeSshXml, REGEX_PROFILE)); - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedNlSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedBeSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedNlSshXml, REGEX_PROFILE)); Set expectedProfiles = Set.of("Additional profile", "http://entsoe.eu/CIM/StateVariables/4/1"); - assertEquals(expectedProfiles, getOccurrences(updatedCgmSvXml, REGEX_PROFILE)); + assertEquals(expectedProfiles, getUniqueMatches(updatedCgmSvXml, REGEX_PROFILE)); // IGM MAS should be the ones provided in subnetwork models, CGM MAS should be the one provided in main network model - assertEquals("http://elia.be/CGMES/2.4.15", getFirstOccurrence(updatedBeSshXml, REGEX_MAS)); - assertEquals("http://tennet.nl/CGMES/2.4.15", getFirstOccurrence(updatedNlSshXml, REGEX_MAS)); - assertEquals("Modeling Authority", getFirstOccurrence(updatedCgmSvXml, REGEX_MAS)); + assertEquals("http://elia.be/CGMES/2.4.15", getFirstMatch(updatedBeSshXml, REGEX_MAS)); + assertEquals("http://tennet.nl/CGMES/2.4.15", getFirstMatch(updatedNlSshXml, REGEX_MAS)); + assertEquals("Modeling Authority", getFirstMatch(updatedCgmSvXml, REGEX_MAS)); } @Test @@ -309,19 +308,19 @@ void testCgmExportWithProperties() throws IOException { String updatedCgmSvXml = Files.readString(tmpDir.resolve(basename + "_SV.xml")); // Scenario time should be the same for all models - assertEquals("2021-02-03T04:30:00Z", getFirstOccurrence(updatedBeSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2021-02-03T04:30:00Z", getFirstOccurrence(updatedNlSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2021-02-03T04:30:00Z", getFirstOccurrence(updatedCgmSvXml, REGEX_SCENARIO_TIME)); + assertEquals("2021-02-03T04:30:00Z", getFirstMatch(updatedBeSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2021-02-03T04:30:00Z", getFirstMatch(updatedNlSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2021-02-03T04:30:00Z", getFirstMatch(updatedCgmSvXml, REGEX_SCENARIO_TIME)); // Description should be the one provided as parameter and be the same for all instance files - assertEquals("Common Grid Model export", getFirstOccurrence(updatedBeSshXml, REGEX_DESCRIPTION)); - assertEquals("Common Grid Model export", getFirstOccurrence(updatedNlSshXml, REGEX_DESCRIPTION)); - assertEquals("Common Grid Model export", getFirstOccurrence(updatedCgmSvXml, REGEX_DESCRIPTION)); + assertEquals("Common Grid Model export", getFirstMatch(updatedBeSshXml, REGEX_DESCRIPTION)); + assertEquals("Common Grid Model export", getFirstMatch(updatedNlSshXml, REGEX_DESCRIPTION)); + assertEquals("Common Grid Model export", getFirstMatch(updatedCgmSvXml, REGEX_DESCRIPTION)); // Version number should be the one provided as parameter and be the same for all instance files - assertEquals("4", getFirstOccurrence(updatedBeSshXml, REGEX_VERSION)); - assertEquals("4", getFirstOccurrence(updatedNlSshXml, REGEX_VERSION)); - assertEquals("4", getFirstOccurrence(updatedCgmSvXml, REGEX_VERSION)); + assertEquals("4", getFirstMatch(updatedBeSshXml, REGEX_VERSION)); + assertEquals("4", getFirstMatch(updatedNlSshXml, REGEX_VERSION)); + assertEquals("4", getFirstMatch(updatedCgmSvXml, REGEX_VERSION)); // The updated CGM SV should depend on the updated IGMs SSH and on the original IGMs TP String updatedBeSshId = "urn:uuid:Network_BE_N_STEADY_STATE_HYPOTHESIS_2021-02-03T04:30:00Z_4_1D__FM"; @@ -330,27 +329,27 @@ void testCgmExportWithProperties() throws IOException { String originalNlTpId = "urn:uuid:Network_NL_N_TOPOLOGY_2021-02-03T04:30:00Z_1_1D__FM"; String originalTpBdId = "ENTSOE TP_BD model ID"; Set expectedDependencies = Set.of(updatedBeSshId, updatedNlSshId, originalBeTpId, originalNlTpId, originalTpBdId); - assertEquals(expectedDependencies, getOccurrences(updatedCgmSvXml, REGEX_DEPENDENT_ON)); + assertEquals(expectedDependencies, getUniqueMatches(updatedCgmSvXml, REGEX_DEPENDENT_ON)); // Each updated IGM SSH should supersede the original one and depend on the original EQ String originalBeSshId = "urn:uuid:Network_BE_N_STEADY_STATE_HYPOTHESIS_2021-02-03T04:30:00Z_1_1D__FM"; String originalBeEqId = "urn:uuid:Network_BE_N_EQUIPMENT_2021-02-03T04:30:00Z_1_1D__FM"; String originalNlSshId = "urn:uuid:Network_NL_N_STEADY_STATE_HYPOTHESIS_2021-02-03T04:30:00Z_1_1D__FM"; String originalNlEqId = "urn:uuid:Network_NL_N_EQUIPMENT_2021-02-03T04:30:00Z_1_1D__FM"; - assertEquals(originalBeSshId, getFirstOccurrence(updatedBeSshXml, REGEX_SUPERSEDES)); - assertEquals(originalBeEqId, getFirstOccurrence(updatedBeSshXml, REGEX_DEPENDENT_ON)); - assertEquals(originalNlSshId, getFirstOccurrence(updatedNlSshXml, REGEX_SUPERSEDES)); - assertEquals(originalNlEqId, getFirstOccurrence(updatedNlSshXml, REGEX_DEPENDENT_ON)); + assertEquals(originalBeSshId, getFirstMatch(updatedBeSshXml, REGEX_SUPERSEDES)); + assertEquals(originalBeEqId, getFirstMatch(updatedBeSshXml, REGEX_DEPENDENT_ON)); + assertEquals(originalNlSshId, getFirstMatch(updatedNlSshXml, REGEX_SUPERSEDES)); + assertEquals(originalNlEqId, getFirstMatch(updatedNlSshXml, REGEX_DEPENDENT_ON)); // Profiles should be consistent with the instance files - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedBeSshXml, REGEX_PROFILE)); - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedNlSshXml, REGEX_PROFILE)); - assertEquals("http://entsoe.eu/CIM/StateVariables/4/1", getFirstOccurrence(updatedCgmSvXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedBeSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedNlSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/StateVariables/4/1", getFirstMatch(updatedCgmSvXml, REGEX_PROFILE)); // IGM MAS should be the default ones, CGM MAS should be the one provided as parameter - assertEquals("powsybl.org", getFirstOccurrence(updatedBeSshXml, REGEX_MAS)); - assertEquals("powsybl.org", getFirstOccurrence(updatedNlSshXml, REGEX_MAS)); - assertEquals("Regional Coordination Center", getFirstOccurrence(updatedCgmSvXml, REGEX_MAS)); + assertEquals("powsybl.org", getFirstMatch(updatedBeSshXml, REGEX_MAS)); + assertEquals("powsybl.org", getFirstMatch(updatedNlSshXml, REGEX_MAS)); + assertEquals("Regional Coordination Center", getFirstMatch(updatedCgmSvXml, REGEX_MAS)); } @Test @@ -375,19 +374,19 @@ void testCgmExportWithModelsAndProperties() throws IOException { // The main network has a different scenario time than the subnetworks // All updated models should get that scenario time - assertEquals("2022-03-04T05:30:00Z", getFirstOccurrence(updatedBeSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2022-03-04T05:30:00Z", getFirstOccurrence(updatedNlSshXml, REGEX_SCENARIO_TIME)); - assertEquals("2022-03-04T05:30:00Z", getFirstOccurrence(updatedCgmSvXml, REGEX_SCENARIO_TIME)); + assertEquals("2022-03-04T05:30:00Z", getFirstMatch(updatedBeSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2022-03-04T05:30:00Z", getFirstMatch(updatedNlSshXml, REGEX_SCENARIO_TIME)); + assertEquals("2022-03-04T05:30:00Z", getFirstMatch(updatedCgmSvXml, REGEX_SCENARIO_TIME)); // Both the models and a property define the description. The property should prevail. - assertEquals("Common Grid Model export", getFirstOccurrence(updatedBeSshXml, REGEX_DESCRIPTION)); - assertEquals("Common Grid Model export", getFirstOccurrence(updatedNlSshXml, REGEX_DESCRIPTION)); - assertEquals("Common Grid Model export", getFirstOccurrence(updatedCgmSvXml, REGEX_DESCRIPTION)); + assertEquals("Common Grid Model export", getFirstMatch(updatedBeSshXml, REGEX_DESCRIPTION)); + assertEquals("Common Grid Model export", getFirstMatch(updatedNlSshXml, REGEX_DESCRIPTION)); + assertEquals("Common Grid Model export", getFirstMatch(updatedCgmSvXml, REGEX_DESCRIPTION)); // Both the models and a property define the version number. The property should prevail. - assertEquals("4", getFirstOccurrence(updatedBeSshXml, REGEX_VERSION)); - assertEquals("4", getFirstOccurrence(updatedNlSshXml, REGEX_VERSION)); - assertEquals("4", getFirstOccurrence(updatedCgmSvXml, REGEX_VERSION)); + assertEquals("4", getFirstMatch(updatedBeSshXml, REGEX_VERSION)); + assertEquals("4", getFirstMatch(updatedNlSshXml, REGEX_VERSION)); + assertEquals("4", getFirstMatch(updatedCgmSvXml, REGEX_VERSION)); // The updated CGM SV should depend on the updated IGMs SSH and on the original IGMs TP // The model of the main network brings an additional dependency @@ -399,26 +398,26 @@ void testCgmExportWithModelsAndProperties() throws IOException { String additionalDependency = "Additional dependency"; Set expectedDependencies = Set.of(updatedBeSshId, updatedNlSshId, originalBeTpId, originalNlTpId, originalTpBdId, additionalDependency); - assertEquals(expectedDependencies, getOccurrences(updatedCgmSvXml, REGEX_DEPENDENT_ON)); + assertEquals(expectedDependencies, getUniqueMatches(updatedCgmSvXml, REGEX_DEPENDENT_ON)); // Each updated IGM SSH should supersede the original one and depend on the original EQ String originalBeSshId = "urn:uuid:Network_BE_N_STEADY_STATE_HYPOTHESIS_2022-03-04T05:30:00Z_1_1D__FM"; String originalNlSshId = "urn:uuid:Network_NL_N_STEADY_STATE_HYPOTHESIS_2022-03-04T05:30:00Z_1_1D__FM"; - assertEquals(originalBeSshId, getFirstOccurrence(updatedBeSshXml, REGEX_SUPERSEDES)); - assertEquals(originalNlSshId, getFirstOccurrence(updatedNlSshXml, REGEX_SUPERSEDES)); - assertEquals(Set.of("BE EQ model ID"), getOccurrences(updatedBeSshXml, REGEX_DEPENDENT_ON)); - assertEquals(Set.of("NL EQ model ID"), getOccurrences(updatedNlSshXml, REGEX_DEPENDENT_ON)); + assertEquals(originalBeSshId, getFirstMatch(updatedBeSshXml, REGEX_SUPERSEDES)); + assertEquals(originalNlSshId, getFirstMatch(updatedNlSshXml, REGEX_SUPERSEDES)); + assertEquals(Set.of("BE EQ model ID"), getUniqueMatches(updatedBeSshXml, REGEX_DEPENDENT_ON)); + assertEquals(Set.of("NL EQ model ID"), getUniqueMatches(updatedNlSshXml, REGEX_DEPENDENT_ON)); // Profiles should be consistent with the instance files, CGM SV has an additional profile - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedBeSshXml, REGEX_PROFILE)); - assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstOccurrence(updatedNlSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedBeSshXml, REGEX_PROFILE)); + assertEquals("http://entsoe.eu/CIM/SteadyStateHypothesis/1/1", getFirstMatch(updatedNlSshXml, REGEX_PROFILE)); Set expectedProfiles = Set.of("Additional profile", "http://entsoe.eu/CIM/StateVariables/4/1"); - assertEquals(expectedProfiles, getOccurrences(updatedCgmSvXml, REGEX_PROFILE)); + assertEquals(expectedProfiles, getUniqueMatches(updatedCgmSvXml, REGEX_PROFILE)); // Both the model and a property define the main network MAS. The property should prevail. - assertEquals("http://elia.be/CGMES/2.4.15", getFirstOccurrence(updatedBeSshXml, REGEX_MAS)); - assertEquals("http://tennet.nl/CGMES/2.4.15", getFirstOccurrence(updatedNlSshXml, REGEX_MAS)); - assertEquals("Regional Coordination Center", getFirstOccurrence(updatedCgmSvXml, REGEX_MAS)); + assertEquals("http://elia.be/CGMES/2.4.15", getFirstMatch(updatedBeSshXml, REGEX_MAS)); + assertEquals("http://tennet.nl/CGMES/2.4.15", getFirstMatch(updatedNlSshXml, REGEX_MAS)); + assertEquals("Regional Coordination Center", getFirstMatch(updatedCgmSvXml, REGEX_MAS)); } @Test @@ -569,8 +568,8 @@ void testFaraoUseCaseManualExport() throws IOException { assertEquals(expectedOutputVersion, sshVersionInOutput); String outputSshXml = Files.readString(tmpFolder.resolve(filenameFromCgmesExport)); - assertEquals(Set.of("myDependency"), getOccurrences(outputSshXml, REGEX_DEPENDENT_ON)); - assertEquals(Set.of("mySupersede"), getOccurrences(outputSshXml, REGEX_SUPERSEDES)); + assertEquals(Set.of("myDependency"), getUniqueMatches(outputSshXml, REGEX_DEPENDENT_ON)); + assertEquals(Set.of("mySupersede"), getUniqueMatches(outputSshXml, REGEX_SUPERSEDES)); } String filenameFromCgmesExport = basename + "_SV.xml"; // We read it from inside the SV file ... @@ -578,7 +577,7 @@ void testFaraoUseCaseManualExport() throws IOException { assertEquals(expectedOutputVersion, svVersionInOutput); // Check the dependencies String outputSvXml = Files.readString(tmpFolder.resolve(filenameFromCgmesExport)); - assertEquals(Set.of("mySvDependency1", "mySvDependency2"), getOccurrences(outputSvXml, REGEX_DEPENDENT_ON)); + assertEquals(Set.of("mySvDependency1", "mySvDependency2"), getUniqueMatches(outputSvXml, REGEX_DEPENDENT_ON)); } private static final Map TSO_BY_COUNTRY = Map.of( @@ -729,21 +728,4 @@ private void addModelForNetwork(Network network, int version) { .add(); } - private String getFirstOccurrence(String xml, Pattern pattern) { - Matcher matcher = pattern.matcher(xml); - if (matcher.find()) { - return matcher.group(1); - } - throw new PowsyblException("Pattern not found " + pattern); - } - - private Set getOccurrences(String xml, Pattern pattern) { - Set matches = new HashSet<>(); - Matcher matcher = pattern.matcher(xml); - while (matcher.find()) { - matches.add(matcher.group(1)); - } - return matches; - } - } diff --git a/cgmes/cgmes-conversion/src/test/resources/issues/line_container_3acls_EQ.xml b/cgmes/cgmes-conversion/src/test/resources/issues/line_container_3acls_EQ.xml deleted file mode 100644 index 47e2f35b247..00000000000 --- a/cgmes/cgmes-conversion/src/test/resources/issues/line_container_3acls_EQ.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - 2024-03-28T11:00:00Z - 2024-03-28T11:00:00Z - 1 - Line containers and fictitious voltage levels - https://www.powsybl.org/ - http://entsoe.eu/CIM/EquipmentCore/3/1 - http://entsoe.eu/CIM/EquipmentOperation/3/1 - - - - GeographicalRegionTest - - - SubGeographicalRegionTest - - - - Substation1 - - - - 11 kV - 11.0 - - - - Line Container - - - Node inside line container - - - - 11.0 - 10.45 - 11.55 - - - - - - - ACLS without Line Container - 0.12 - 0 - 0.3 - 0.34 - - - - T1 - - 1 - - - - - T2 - - 2 - - - - CN1 - - - - - - ACLS2 - - 0.28 - ACLS2 - 0 - 0.72 - 0.78 - - - - ACLS2 T1 - - 1 - - - - - ACLS2 T2 - - 2 - - - - ACLS2 CN1 - - - - - - ACLS3 - - 0.28 - ACLS3 - 0 - 0.72 - 0.78 - - - - ACLS3 T1 - - 1 - - - - - ACLS3 T2 - - 2 - - - - ACLS3 CN1 - - - \ No newline at end of file diff --git a/cgmes/cgmes-conversion/src/test/resources/issues/line_container_switch_EQ.xml b/cgmes/cgmes-conversion/src/test/resources/issues/line_container_switch_EQ.xml new file mode 100644 index 00000000000..6b6fbf5d62a --- /dev/null +++ b/cgmes/cgmes-conversion/src/test/resources/issues/line_container_switch_EQ.xml @@ -0,0 +1,83 @@ + + + 2024-03-28T11:00:00Z + 2024-03-28T11:00:00Z + 1 + Line containers and fictitious voltage levels + https://www.powsybl.org/ + http://entsoe.eu/CIM/EquipmentCore/3/1 + http://entsoe.eu/CIM/EquipmentOperation/3/1 + + + + GeographicalRegionTest + + + SubGeographicalRegionTest + + + + Substation1 + + + + Substation2 + + + + 11 kV + 11.0 + + + + Line Container + + + Node inside line container + + + + 11.0 + 10.45 + 11.55 + + + + + Node inside voltage level 1 + + + + 11.0 + 10.45 + 11.55 + + + + + Node inside voltage level 2 + + + + + Disconnector 1 + + false + false + + + + Disconnector 1 T1 + + 1 + + + + + Disconnector 1 T2 + + 2 + + + + \ No newline at end of file diff --git a/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/chained_line_segments.xml b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/chained_line_segments.xml new file mode 100644 index 00000000000..1034919c296 --- /dev/null +++ b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/chained_line_segments.xml @@ -0,0 +1,137 @@ + + + 2021-03-01T23:00:00Z + 2021-03-02T10:22:58Z + Container mapping + 001 + http://entsoe.eu/CIM/EquipmentCore/3/1 + http://entsoe.eu/CIM/EquipmentOperation/3/1 + powsybl.org + + + Geographical region + + + Subgeographical region + + + + Substation 1 + + + + Voltage level 1 + + + + + Node 1 + + + + Substation 2 + + + + Voltage level 2 + + + + + Node 2 + + + + Line 12 + + + + Node A + + + + Node B + + + + 0 + 0 + 0 + 0 + Line 1A + 0.1 + 0.1 + 75 + 1 + 1 + + + + + Terminal 1A 1 + 1 + + + + + Terminal 1A 2 + 2 + + + + + 0 + 0 + 0 + 0 + Line AB + 0.1 + 0.1 + 75 + 1 + 1 + + + + + Terminal AB 1 + 1 + + + + + Terminal AB 2 + 2 + + + + + 0 + 0 + 0 + 0 + Line B2 + 0.1 + 0.1 + 75 + 1 + 1 + + + + Terminal B2 1 + 1 + + + + + Terminal B2 2 + 2 + + + + + 110 kV + 110 + + diff --git a/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/containers_connected_by_switches.xml b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/containers_connected_by_switches.xml new file mode 100644 index 00000000000..f60f68a3258 --- /dev/null +++ b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/containers_connected_by_switches.xml @@ -0,0 +1,164 @@ + + + 2021-03-01T23:00:00Z + 2021-03-02T10:22:58Z + Nodes containers mapping + 001 + http://entsoe.eu/CIM/EquipmentCore/3/1 + http://entsoe.eu/CIM/EquipmentOperation/3/1 + powsybl.org + + + Geographical region + + + Subgeographical region + + + + Substation 1 + + + + Voltage level 1A + + + + + Node 1A + + + + Voltage level 1B + + + + + Node 1B + + + + Substation 2 + + + + Voltage level 2 + + + + + Node 2 + + + + Substation 3 + + + + Node 3 + + + + Line L + + + + Node L + + + + Switch AB + + false + false + + + Terminal AB 1 + 1 + + + + + Terminal AB 2 + 2 + + + + + Switch 12 + + false + false + + + Terminal 12 1 + 1 + + + + + Terminal 12 2 + 2 + + + + + Switch 23 + + false + false + + + Terminal 23 1 + 1 + + + + + Terminal 23 2 + 2 + + + + + Switch 3L + + false + false + + + Terminal 3L 1 + 1 + + + + + Terminal 3L 2 + 2 + + + + + Busbar section + + + + + Terminal BBS + + + + + Load + + + + Terminal LD + + + + + 110 kV + 110 + + diff --git a/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/line_with_t-junction.xml b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/line_with_t-junction.xml new file mode 100644 index 00000000000..08c7662027a --- /dev/null +++ b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/line_with_t-junction.xml @@ -0,0 +1,146 @@ + + + 2021-03-01T23:00:00Z + 2021-03-02T10:22:58Z + Container mapping + 001 + http://entsoe.eu/CIM/EquipmentCore/3/1 + http://entsoe.eu/CIM/EquipmentOperation/3/1 + powsybl.org + + + Geographical region + + + Subgeographical region + + + + Substation 1 + + + + Voltage level 1 + + + + + Node 1 + + + + Substation 2 + + + + Voltage level 2 + + + + + Node 2 + + + + Substation 3 + + + + Voltage level 3 + + + + + Node 3 + + + + Line A + + + + Node A + + + + 0 + 0 + 0 + 0 + Line 1A + 0.1 + 0.1 + 75 + 1 + 1 + + + + + Terminal 1A 1 + 1 + + + + + Terminal 1A 2 + 2 + + + + + 0 + 0 + 0 + 0 + Line 2A + 0.1 + 0.1 + 75 + 1 + 1 + + + + + Terminal 2A 1 + 1 + + + + + Terminal 2A 2 + 2 + + + + + 0 + 0 + 0 + 0 + Line 3A + 0.1 + 0.1 + 75 + 1 + 1 + + + + Terminal 3A 1 + 1 + + + + + Terminal 3A 2 + 2 + + + + + 110 kV + 110 + + diff --git a/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/substations_connected_by_transformer.xml b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/substations_connected_by_transformer.xml new file mode 100644 index 00000000000..b3ae6cfc189 --- /dev/null +++ b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/substations_connected_by_transformer.xml @@ -0,0 +1,139 @@ + + + 2021-03-01T23:00:00Z + 2021-03-02T10:22:58Z + Container mapping + 001 + http://entsoe.eu/CIM/EquipmentCore/3/1 + http://entsoe.eu/CIM/EquipmentOperation/3/1 + http://entsoe.eu/CIM/EquipmentShortCircuit/3/1 + powsybl.org + + + Geographical region + + + Subgeographical region + + + + Substation 1 + + + + Voltage level 1 + + + + + Node 1 + + + + Substation 2 + + + + Voltage level 2 + + + + + Node 2 + + + + Substation 3 + + + + Voltage level 3 + + + + + Node 3 + + + + PowerTransformer 1 + + false + + + TransformerEnd 1 + 1 + false + 0 + 0 + 0 + 0 + 0.1 + 0.1 + 1 + 1 + 0 + 110 + + + + + + TransformerEnd 2 + 2 + false + 0 + 0 + 0 + 0 + 0.1 + 0.1 + 1 + 1 + 0 + 110 + + + + + + TransformerEnd 3 + 3 + false + 0 + 0 + 0 + 0 + 0.1 + 0.1 + 1 + 1 + 0 + 110 + + + + + + Terminal 1 + 1 + + + + + Terminal 2 + 2 + + + + + Terminal 3 + 3 + + + + + 110 kV + 110 + + diff --git a/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/voltage_levels_connected_by_open_switch_EQ.xml b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/voltage_levels_connected_by_open_switch_EQ.xml new file mode 100644 index 00000000000..1c480ce5bc9 --- /dev/null +++ b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/voltage_levels_connected_by_open_switch_EQ.xml @@ -0,0 +1,62 @@ + + + 2021-03-01T23:00:00Z + 2021-03-02T10:22:58Z + Nodes containers mapping + 001 + http://entsoe.eu/CIM/EquipmentCore/3/1 + http://entsoe.eu/CIM/EquipmentOperation/3/1 + powsybl.org + + + Geographical region + + + Subgeographical region + + + + Substation + + + + Voltage level 1 + + + + + Node 1 + + + + Voltage level 2 + + + + + Node 2 + + + + Switch 12 + + true + true + + + Terminal 12 1 + 1 + + + + + Terminal 12 2 + 2 + + + + + 110 kV + 110 + + diff --git a/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/voltage_levels_connected_by_open_switch_SSH.xml b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/voltage_levels_connected_by_open_switch_SSH.xml new file mode 100644 index 00000000000..db2540d2b21 --- /dev/null +++ b/cgmes/cgmes-conversion/src/test/resources/issues/node-containers/voltage_levels_connected_by_open_switch_SSH.xml @@ -0,0 +1,20 @@ + + + 2021-03-01T23:00:00Z + 2021-03-02T10:22:58Z + Nodes containers mapping + 001 + + http://entsoe.eu/CIM/SteadyStateHypothesis/1/1 + powsybl.org + + + false + + + false + + + true + + diff --git a/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/AbstractCgmesModel.java b/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/AbstractCgmesModel.java index 1ccbd7dc77b..82b1c963ac0 100644 --- a/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/AbstractCgmesModel.java +++ b/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/AbstractCgmesModel.java @@ -101,16 +101,8 @@ public CgmesContainer container(String containerId) { if (cachedContainers == null) { cachedContainers = computeContainers(); } - if (cachedContainers.get(containerId) == null) { // container ID is substation - String fixedContainerId = connectivityNodeContainers().stream() - .filter(p -> p.containsKey(SUBSTATION)) - .filter(p -> p.getId(SUBSTATION).equals(containerId)) - .findFirst() - .map(p -> p.getId("VoltageLevel")) - .orElseThrow(() -> new CgmesModelException(containerId + " should be a connectivity node container containing at least one voltage level")); - LOG.warn("{} is a substation, not a voltage level, a line or a bay but contains nodes. " + - "The first CGMES voltage level found in this substation ({}}) is used instead.", containerId, fixedContainerId); - cachedContainers.put(containerId, cachedContainers.get(fixedContainerId)); + if (cachedContainers.get(containerId) == null) { + throw new CgmesModelException("Unexpected CgmesContainer for containerId: " + containerId); } return cachedContainers.get(containerId); } @@ -125,6 +117,32 @@ public double nominalVoltage(String baseVoltageId) { return cachedBaseVoltages.getOrDefault(baseVoltageId, Double.NaN); } + @Override + public Optional node(CgmesTerminal t, boolean nodeBreaker) { + cacheNodes(); + String nodeId = nodeBreaker && t.connectivityNode() != null ? t.connectivityNode() : t.topologicalNode(); + return nodeId != null ? Optional.of(nodeId) : Optional.empty(); + } + + @Override + public Optional nodeContainer(String nodeId) { + cacheNodes(); + + String containerId = null; + + if (nodeId != null) { + PropertyBag node = cachedNodesById.get(nodeId); + if (node != null) { + containerId = node.getId(CgmesNames.CONNECTIVITY_NODE_CONTAINER); + } else { + if (LOG.isWarnEnabled()) { + LOG.warn("Missing node {}", nodeId); + } + } + } + return containerId == null ? Optional.empty() : Optional.of(container(containerId)); + } + private CgmesContainer container(CgmesTerminal t, boolean nodeBreaker) { cacheNodes(); String containerId = null; @@ -132,7 +150,7 @@ private CgmesContainer container(CgmesTerminal t, boolean nodeBreaker) { if (nodeId != null) { PropertyBag node = cachedNodesById.get(nodeId); if (node != null) { - containerId = node.getId("ConnectivityNodeContainer"); + containerId = node.getId(CgmesNames.CONNECTIVITY_NODE_CONTAINER); } else { if (LOG.isWarnEnabled()) { LOG.warn("Missing node {} from terminal {}", nodeId, t.id()); @@ -218,10 +236,13 @@ private Map computeDcTerminals() { private Map computeContainers() { Map cs = new HashMap<>(); connectivityNodeContainers().forEach(c -> { - String id = c.getId("ConnectivityNodeContainer"); + String id = c.getId(CgmesNames.CONNECTIVITY_NODE_CONTAINER); String voltageLevel = c.getId("VoltageLevel"); String substation = c.getId(SUBSTATION); - cs.put(id, new CgmesContainer(voltageLevel, substation)); + String type = c.getId("connectivityNodeContainerType"); + String line = type != null && type.contains("Line") ? id : null; + String name = c.get("name"); + cs.put(id, new CgmesContainer(voltageLevel, substation, line, name)); }); return cs; } diff --git a/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/CgmesContainer.java b/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/CgmesContainer.java index 2d407757f14..6ef5e403b0f 100644 --- a/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/CgmesContainer.java +++ b/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/CgmesContainer.java @@ -13,9 +13,11 @@ */ public class CgmesContainer { - CgmesContainer(String voltageLevel, String substation) { + CgmesContainer(String voltageLevel, String substation, String line, String name) { this.voltageLevel = voltageLevel; this.substation = substation; + this.line = line; + this.name = name; } public String substation() { @@ -26,6 +28,32 @@ public String voltageLevel() { return voltageLevel; } + public String name() { + return name; + } + + public String id() { + if (line != null) { + return line; + } else if (voltageLevel != null) { + return voltageLevel; + } else if (substation != null) { + return substation; + } else { + throw new CgmesModelException("Unexpected null CgmesContainer"); + } + } + + public boolean isVoltageLevel() { + return voltageLevel != null; + } + + public boolean isSubstation() { + return substation != null; + } + private final String voltageLevel; private final String substation; + private final String line; + private final String name; } diff --git a/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/CgmesModel.java b/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/CgmesModel.java index 84057f5c4e1..1312f12762c 100644 --- a/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/CgmesModel.java +++ b/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/CgmesModel.java @@ -234,6 +234,10 @@ default void write(DataSource ds, CgmesSubset subset) { */ String voltageLevel(CgmesTerminal t, boolean nodeBreaker); + Optional node(CgmesTerminal t, boolean nodeBreaker); + + Optional nodeContainer(String nodeId); + CgmesContainer container(String containerId); double nominalVoltage(String baseVoltageId); diff --git a/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/InMemoryCgmesModel.java b/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/InMemoryCgmesModel.java index 76412620d91..69c279d00b4 100644 --- a/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/InMemoryCgmesModel.java +++ b/cgmes/cgmes-model/src/main/java/com/powsybl/cgmes/model/InMemoryCgmesModel.java @@ -613,6 +613,16 @@ public String voltageLevel(CgmesTerminal t, boolean nodeBreaker) { return null; } + @Override + public Optional node(CgmesTerminal t, boolean nodeBreaker) { + return Optional.empty(); + } + + @Override + public Optional nodeContainer(String nodeId) { + return Optional.empty(); + } + @Override public CgmesContainer container(String containerId) { return null; diff --git a/cgmes/cgmes-model/src/main/resources/CIM16.sparql b/cgmes/cgmes-model/src/main/resources/CIM16.sparql index 2ac8ae113eb..5ec42873e9e 100644 --- a/cgmes/cgmes-model/src/main/resources/CIM16.sparql +++ b/cgmes/cgmes-model/src/main/resources/CIM16.sparql @@ -342,8 +342,9 @@ WHERE { # A Bay may be in a different instance file of its containing Voltage Level, # and a Voltage Level in a different instance file of its containing Substation. # This is why we do not use a "restrictive" GRAPH clause here. - ?ConnectivityNodeContainer a ?connectivityNodeContainerType . - VALUES ?connectivityNodeContainerType { cim:VoltageLevel cim:Bay cim:Line } . + ?ConnectivityNodeContainer a ?connectivityNodeContainerType ; + VALUES ?connectivityNodeContainerType { cim:VoltageLevel cim:Bay cim:Line cim:Substation} . + ?ConnectivityNodeContainer cim:IdentifiedObject.name ?name . OPTIONAL { ?ConnectivityNodeContainer a cim:VoltageLevel ; @@ -355,6 +356,10 @@ WHERE { cim:Bay.VoltageLevel ?VoltageLevel . ?VoltageLevel cim:VoltageLevel.Substation ?Substation } + OPTIONAL { + ?ConnectivityNodeContainer a cim:Substation ; + BIND ( ?ConnectivityNodeContainer AS ?Substation ) + } } # query: voltages diff --git a/commons/src/main/java/com/powsybl/commons/binary/BinReader.java b/commons/src/main/java/com/powsybl/commons/binary/BinReader.java index ab0d90410c1..0b84a4b9ea8 100644 --- a/commons/src/main/java/com/powsybl/commons/binary/BinReader.java +++ b/commons/src/main/java/com/powsybl/commons/binary/BinReader.java @@ -76,6 +76,7 @@ private String readString() { } byte[] stringBytes = dis.readNBytes(stringNbBytes); if (stringBytes.length != stringNbBytes) { + // this may happen when the attribute wasn't written in the first place, causing string length to be an aberrant number throw new PowsyblException("Cannot read the full string, bytes missing: " + (stringNbBytes - stringBytes.length)); } return new String(stringBytes, StandardCharsets.UTF_8); diff --git a/distribution-core/pom.xml b/distribution-core/pom.xml index a69bf7eac5f..8900ca8011c 100644 --- a/distribution-core/pom.xml +++ b/distribution-core/pom.xml @@ -509,6 +509,14 @@ powsybl-ucte-util ${project.version} + + + + ${project.groupId} + powsybl-itools-packager-maven-plugin + ${project.version} + provided + diff --git a/docs/grid_exchange_formats/cgmes/import.md b/docs/grid_exchange_formats/cgmes/import.md index 54bb25e7c3f..786c0c4415b 100644 --- a/docs/grid_exchange_formats/cgmes/import.md +++ b/docs/grid_exchange_formats/cgmes/import.md @@ -580,3 +580,8 @@ Optional property to define if subnetworks must be added to the network when imp **iidm.import.cgmes.cgm-with-subnetworks-defined-by** If `iidm.import.cgmes.cgm-with-subnetworks` is set to `true`, use this property to specify how the set of input files should be split by IGM: based on their filenames (use the value `FILENAME`) or by its modeling authority, read from the header (use the value `MODELING_AUTHORITY`). Its default value is `MODELING_AUTHORITY`. + +**iidm.import.cgmes.create-fictitious-voltage-level-for-every-node** +Optional property that defines the fictitious voltage levels created by line container. If it is set to `true`, a fictitious voltage level is created for each connectivity node inside the line container. +If it is set to `false`, only one fictitious voltage level is created for each line container. +`true` by default. diff --git a/docs/user/configuration/import-export-parameters-default-value.md b/docs/user/configuration/import-export-parameters-default-value.md index d04d145642e..604d440b801 100644 --- a/docs/user/configuration/import-export-parameters-default-value.md +++ b/docs/user/configuration/import-export-parameters-default-value.md @@ -1,23 +1,26 @@ # import-export-parameters-default-value -The `import-export-parameters-default-value` module is an optional module used by the `com.powsybl.iidm.import_.Importers` class to initialize the parameters passed to configure the importer. This module supports 3 different types of properties: -- Boolean -- String -- List of Strings +The `import-export-parameters-default-value` module is an optional module used to configure the network importers and exporters. -As the parameters are different from an importer to another, it is impossible to give an exhaustive list of supported -properties. Please refer to the documentation of each [supported format](../../grid_exchange_formats/index.md) to know their specific configuration. +The parameters are different from a format importer/exporter to another, please refer to the documentation of +each [supported format](../../grid_exchange_formats/index.md) to learn more about their specific configuration. ## Examples +In this example we configure: +- the IIDM importer to throw an exception on trying to import an unknown or not deserializable extension +- the IIDM exporter to export to IIDM in its version 1.12 + **YAML configuration:** ```yaml import-export-parameters-default-value: iidm.import.xml.throw-exception-if-extension-not-found: true + iidm.export.xml.version: "1.12" ``` **XML configuration:** ```xml true + 1.12 ``` diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/DefaultNetworkListener.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/DefaultNetworkListener.java index 6f728ba70f9..e8d7bb2ad8a 100644 --- a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/DefaultNetworkListener.java +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/DefaultNetworkListener.java @@ -28,11 +28,6 @@ public void afterRemoval(String identifiable) { // empty default implementation } - @Override - public void onUpdate(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { - // empty default implementation - } - @Override public void onUpdate(Identifiable identifiable, String attribute, String variantId, Object oldValue, Object newValue) { // empty default implementation @@ -44,7 +39,7 @@ public void onExtensionCreation(Extension extension) { } @Override - public void onExtensionUpdate(Extension extension, String attribute, Object oldValue, Object newValue) { + public void onExtensionUpdate(Extension extension, String attribute, String variantId, Object oldValue, Object newValue) { // empty default implementation } @@ -57,4 +52,34 @@ public void onExtensionBeforeRemoval(Extension extension) { public void onExtensionAfterRemoval(Identifiable identifiable, String extensionName) { // empty default implementation } + + @Override + public void onPropertyAdded(Identifiable identifiable, String key, Object newValue) { + // empty default implementation + } + + @Override + public void onPropertyReplaced(Identifiable identifiable, String key, Object oldValue, Object newValue) { + // empty default implementation + } + + @Override + public void onPropertyRemoved(Identifiable identifiable, String key, Object oldValue) { + // empty default implementation + } + + @Override + public void onVariantCreated(String sourceVariantId, String targetVariantId) { + // empty default implementation + } + + @Override + public void onVariantOverwritten(String sourceVariantId, String targetVariantId) { + // empty default implementation + } + + @Override + public void onVariantRemoved(String variantId) { + // empty default implementation + } } diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/Importer.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/Importer.java index 0a5ef1fbaa9..bf18803ba0c 100644 --- a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/Importer.java +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/Importer.java @@ -24,7 +24,7 @@ * *

Importer lookup is based on the ServiceLoader * architecture so do not forget to create a - * META-INF/services/com.powsybl.iidm.importData.Importer file + * META-INF/services/com.powsybl.iidm.network.Importer file * with the fully qualified name of your Importer implementation. * * @see java.util.ServiceLoader diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/NetworkEventRecorder.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/NetworkEventRecorder.java new file mode 100644 index 00000000000..c04ed12215b --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/NetworkEventRecorder.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2024, 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.iidm.network; + +import com.powsybl.commons.extensions.Extension; +import com.powsybl.iidm.network.events.*; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public class NetworkEventRecorder implements NetworkListener { + + private final List events = new ArrayList<>(); + + public List getEvents() { + return events; + } + + public void reset() { + events.clear(); + } + + @Override + public void onCreation(Identifiable identifiable) { + events.add(new CreationNetworkEvent(identifiable.getId())); + } + + @Override + public void beforeRemoval(Identifiable identifiable) { + events.add(new RemovalNetworkEvent(identifiable.getId(), false)); + } + + @Override + public void afterRemoval(String id) { + events.add(new RemovalNetworkEvent(id, true)); + } + + @Override + public void onUpdate(Identifiable identifiable, String attribute, String variantId, Object oldValue, Object newValue) { + events.add(new UpdateNetworkEvent(identifiable.getId(), attribute, variantId, oldValue, newValue)); + } + + @Override + public void onExtensionCreation(Extension extension) { + events.add(new ExtensionCreationNetworkEvent(((Identifiable) extension.getExtendable()).getId(), extension.getName())); + } + + @Override + public void onExtensionAfterRemoval(Identifiable identifiable, String extensionName) { + events.add(new ExtensionRemovalNetworkEvent(identifiable.getId(), extensionName, true)); + } + + @Override + public void onExtensionBeforeRemoval(Extension extension) { + events.add(new ExtensionRemovalNetworkEvent(((Identifiable) extension.getExtendable()).getId(), extension.getName(), false)); + } + + @Override + public void onExtensionUpdate(Extension extension, String attribute, String variantId, Object oldValue, Object newValue) { + events.add(new ExtensionUpdateNetworkEvent(((Identifiable) extension.getExtendable()).getId(), extension.getName(), attribute, variantId, oldValue, newValue)); + } + + @Override + public void onPropertyAdded(Identifiable identifiable, String key, Object newValue) { + events.add(new PropertiesUpdateNetworkEvent(identifiable.getId(), key, PropertiesUpdateNetworkEvent.PropertyUpdateType.ADDED, null, newValue)); + } + + @Override + public void onPropertyReplaced(Identifiable identifiable, String key, Object oldValue, Object newValue) { + events.add(new PropertiesUpdateNetworkEvent(identifiable.getId(), key, PropertiesUpdateNetworkEvent.PropertyUpdateType.REPLACED, oldValue, newValue)); + } + + @Override + public void onPropertyRemoved(Identifiable identifiable, String key, Object oldValue) { + events.add(new PropertiesUpdateNetworkEvent(identifiable.getId(), key, PropertiesUpdateNetworkEvent.PropertyUpdateType.REMOVED, oldValue, null)); + } + + @Override + public void onVariantCreated(String sourceVariantId, String targetVariantId) { + events.add(new VariantNetworkEvent(sourceVariantId, targetVariantId, VariantNetworkEvent.VariantEventType.CREATED)); + } + + @Override + public void onVariantOverwritten(String sourceVariantId, String targetVariantId) { + events.add(new VariantNetworkEvent(sourceVariantId, targetVariantId, VariantNetworkEvent.VariantEventType.OVERWRITTEN)); + } + + @Override + public void onVariantRemoved(String variantId) { + events.add(new VariantNetworkEvent(variantId, null, VariantNetworkEvent.VariantEventType.REMOVED)); + } +} diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/NetworkListener.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/NetworkListener.java index 39a4ee2b159..71126530b45 100644 --- a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/NetworkListener.java +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/NetworkListener.java @@ -20,8 +20,6 @@ public interface NetworkListener { void afterRemoval(String id); - void onUpdate(Identifiable identifiable, String attribute, Object oldValue, Object newValue); - void onUpdate(Identifiable identifiable, String attribute, String variantId, Object oldValue, Object newValue); void onExtensionCreation(Extension extension); @@ -30,29 +28,17 @@ public interface NetworkListener { void onExtensionBeforeRemoval(Extension extension); - void onExtensionUpdate(Extension extendable, String attribute, Object oldValue, Object newValue); + void onExtensionUpdate(Extension extendable, String attribute, String variantId, Object oldValue, Object newValue); - default void onElementAdded(Identifiable identifiable, String attribute, Object newValue) { - // empty default implementation - } + void onPropertyAdded(Identifiable identifiable, String key, Object newValue); - default void onElementReplaced(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { - // empty default implementation - } + void onPropertyReplaced(Identifiable identifiable, String key, Object oldValue, Object newValue); - default void onElementRemoved(Identifiable identifiable, String attribute, Object oldValue) { - // empty default implementation - } + void onPropertyRemoved(Identifiable identifiable, String key, Object oldValue); - default void onVariantCreated(String sourceVariantId, String targetVariantId) { - // empty default implementation - } + void onVariantCreated(String sourceVariantId, String targetVariantId); - default void onVariantOverwritten(String sourceVariantId, String targetVariantId) { - // empty default implementation - } + void onVariantOverwritten(String sourceVariantId, String targetVariantId); - default void onVariantRemoved(String variantId) { - // empty default implementation - } + void onVariantRemoved(String variantId); } diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/VoltageLevel.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/VoltageLevel.java index d70e735f2df..053007a2326 100644 --- a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/VoltageLevel.java +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/VoltageLevel.java @@ -472,7 +472,7 @@ default int getMaximumNodeIndex() { SwitchAdder newSwitch(); /** - * Get a builder to create a new switch. + * Get a builder to create a new internal connection. */ InternalConnectionAdder newInternalConnection(); diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/CreationNetworkEvent.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/CreationNetworkEvent.java new file mode 100644 index 00000000000..900057183f5 --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/CreationNetworkEvent.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2024, 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.iidm.network.events; + +import java.util.Objects; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public record CreationNetworkEvent(String id) implements NetworkEvent { + public CreationNetworkEvent { + Objects.requireNonNull(id); + } + + @Override + public Type getType() { + return Type.CREATION; + } +} diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/ExtensionCreationNetworkEvent.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/ExtensionCreationNetworkEvent.java new file mode 100644 index 00000000000..68d64f5f34e --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/ExtensionCreationNetworkEvent.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2024, 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.iidm.network.events; + +import java.util.Objects; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public record ExtensionCreationNetworkEvent(String id, String extensionName) implements NetworkEvent { + public ExtensionCreationNetworkEvent { + Objects.requireNonNull(id); + Objects.requireNonNull(extensionName); + } + + @Override + public Type getType() { + return Type.EXTENSION_CREATION; + } +} diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/ExtensionRemovalNetworkEvent.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/ExtensionRemovalNetworkEvent.java new file mode 100644 index 00000000000..ab8508ab895 --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/ExtensionRemovalNetworkEvent.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2024, 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.iidm.network.events; + +import java.util.Objects; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public record ExtensionRemovalNetworkEvent(String id, String extensionName, boolean after) implements NetworkEvent { + public ExtensionRemovalNetworkEvent { + Objects.requireNonNull(id); + Objects.requireNonNull(extensionName); + } + + @Override + public Type getType() { + return Type.EXTENSION_REMOVAL; + } +} diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/ExtensionUpdateNetworkEvent.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/ExtensionUpdateNetworkEvent.java new file mode 100644 index 00000000000..05dfd5df103 --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/ExtensionUpdateNetworkEvent.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2024, 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.iidm.network.events; + +import java.util.Objects; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public record ExtensionUpdateNetworkEvent(String id, String extensionName, String attribute, String variantId, Object oldValue, Object newValue) implements NetworkEvent { + public ExtensionUpdateNetworkEvent { + Objects.requireNonNull(id); + Objects.requireNonNull(extensionName); + Objects.requireNonNull(attribute); + } + + @Override + public Type getType() { + return Type.EXTENSION_UPDATE; + } +} diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/NetworkEvent.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/NetworkEvent.java new file mode 100644 index 00000000000..12132118863 --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/NetworkEvent.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2024, 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.iidm.network.events; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public interface NetworkEvent { + enum Type { + CREATION, + REMOVAL, + UPDATE, + PROPERTIES_UPDATE, + EXTENSION_CREATION, + EXTENSION_REMOVAL, + EXTENSION_UPDATE, + VARIANT, + } + + Type getType(); +} diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/PropertiesUpdateNetworkEvent.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/PropertiesUpdateNetworkEvent.java new file mode 100644 index 00000000000..53ffaa95841 --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/PropertiesUpdateNetworkEvent.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2024, 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.iidm.network.events; + +import java.util.Objects; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public record PropertiesUpdateNetworkEvent(String id, String key, PropertyUpdateType updateType, Object oldValue, Object newValue) implements NetworkEvent { + + public enum PropertyUpdateType { + ADDED, + REMOVED, + REPLACED; + } + + public PropertiesUpdateNetworkEvent { + Objects.requireNonNull(id); + Objects.requireNonNull(key); + Objects.requireNonNull(updateType); + } + + @Override + public Type getType() { + return Type.PROPERTIES_UPDATE; + } +} diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/RemovalNetworkEvent.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/RemovalNetworkEvent.java new file mode 100644 index 00000000000..ee55cbf7d79 --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/RemovalNetworkEvent.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2024, 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.iidm.network.events; + +import java.util.Objects; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public record RemovalNetworkEvent(String id, boolean after) implements NetworkEvent { + public RemovalNetworkEvent { + Objects.requireNonNull(id); + } + + @Override + public Type getType() { + return Type.REMOVAL; + } +} diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/UpdateNetworkEvent.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/UpdateNetworkEvent.java new file mode 100644 index 00000000000..190915f7f1f --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/UpdateNetworkEvent.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2024, 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.iidm.network.events; + +import java.util.Objects; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public record UpdateNetworkEvent(String id, String attribute, String variantId, Object oldValue, Object newValue) implements NetworkEvent { + public UpdateNetworkEvent { + Objects.requireNonNull(id); + Objects.requireNonNull(attribute); + } + + @Override + public Type getType() { + return Type.UPDATE; + } +} diff --git a/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/VariantNetworkEvent.java b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/VariantNetworkEvent.java new file mode 100644 index 00000000000..fff0c2f8b13 --- /dev/null +++ b/iidm/iidm-api/src/main/java/com/powsybl/iidm/network/events/VariantNetworkEvent.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2024, 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.iidm.network.events; + +import java.util.Objects; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public record VariantNetworkEvent(String sourceVariantId, String targetVariantId, VariantEventType eventType) implements NetworkEvent { + + public enum VariantEventType { + CREATED, + OVERWRITTEN, + REMOVED; + } + + public VariantNetworkEvent { + Objects.requireNonNull(sourceVariantId); + Objects.requireNonNull(eventType); + } + + @Override + public Type getType() { + return Type.VARIANT; + } +} diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractConnectable.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractConnectable.java index 7025a5084bf..756f6be24a2 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractConnectable.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractConnectable.java @@ -72,7 +72,7 @@ public void remove() { for (TerminalExt terminal : terminals) { terminal.removeAsRegulationPoint(); VoltageLevelExt vl = terminal.getVoltageLevel(); - vl.detach(terminal); + vl.getTopologyModel().detach(terminal); } network.getListeners().notifyAfterRemoval(id); @@ -181,10 +181,10 @@ protected void move(TerminalExt oldTerminal, TopologyPoint oldTopologyPoint, Str private void attachTerminal(TerminalExt oldTerminal, TopologyPoint oldTopologyPoint, VoltageLevelExt voltageLevel, TerminalExt terminalExt) { // first, attach new terminal to connectable and to voltage level of destination, to ensure that the new terminal is valid terminalExt.setConnectable(this); - voltageLevel.attach(terminalExt, false); + voltageLevel.getTopologyModel().attach(terminalExt, false); // then we can detach the old terminal, as we now know that the new terminal is valid - oldTerminal.getVoltageLevel().detach(oldTerminal); + oldTerminal.getVoltageLevel().getTopologyModel().detach(oldTerminal); // replace the old terminal by the new terminal in the connectable int iSide = terminals.indexOf(oldTerminal); diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractIdentifiable.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractIdentifiable.java index 284a8361811..837269c396b 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractIdentifiable.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractIdentifiable.java @@ -199,9 +199,9 @@ public String getProperty(String key, String defaultValue) { public String setProperty(String key, String value) { String oldValue = (String) properties.put(key, value); if (Objects.isNull(oldValue)) { - getNetwork().getListeners().notifyElementAdded(this, () -> getPropertyStringForNotification(key), value); + getNetwork().getListeners().notifyPropertyAdded(this, () -> getPropertyStringForNotification(key), value); } else { - getNetwork().getListeners().notifyElementReplaced(this, () -> getPropertyStringForNotification(key), oldValue, value); + getNetwork().getListeners().notifyPropertyReplaced(this, () -> getPropertyStringForNotification(key), oldValue, value); } return oldValue; } @@ -210,7 +210,7 @@ public String setProperty(String key, String value) { public boolean removeProperty(String key) { Object oldValue = properties.remove(key); if (oldValue != null) { - getNetwork().getListeners().notifyElementRemoved(this, () -> getPropertyStringForNotification(key), oldValue); + getNetwork().getListeners().notifyPropertyRemoved(this, () -> getPropertyStringForNotification(key), oldValue); return true; } return false; diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractTerminal.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractTerminal.java index 58e89278588..0f7d2f336e1 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractTerminal.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractTerminal.java @@ -182,7 +182,7 @@ public boolean connect(Predicate isTypeSwitchToOperate) { String variantId = getVariantManagerHolder().getVariantManager().getVariantId(variantIndex); boolean connectedBefore = isConnected(); connectable.notifyUpdate("beginConnect", variantId, connectedBefore, null); - boolean connected = voltageLevel.connect(this, isTypeSwitchToOperate); + boolean connected = voltageLevel.getTopologyModel().connect(this, isTypeSwitchToOperate); boolean connectedAfter = isConnected(); connectable.notifyUpdate("endConnect", variantId, null, connectedAfter); return connected; @@ -209,7 +209,7 @@ public boolean disconnect(Predicate isSwitchOpenable) { String variantId = getVariantManagerHolder().getVariantManager().getVariantId(variantIndex); boolean disconnectedBefore = !isConnected(); connectable.notifyUpdate("beginDisconnect", variantId, disconnectedBefore, null); - boolean disconnected = voltageLevel.disconnect(this, isSwitchOpenable); + boolean disconnected = voltageLevel.getTopologyModel().disconnect(this, isSwitchOpenable); boolean disconnectedAfter = !isConnected(); connectable.notifyUpdate("endDisconnect", variantId, null, disconnectedAfter); return disconnected; diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractTopologyModel.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractTopologyModel.java new file mode 100644 index 00000000000..91079102ccd --- /dev/null +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractTopologyModel.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) 2024, 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.iidm.network.impl; + +import com.google.common.collect.FluentIterable; +import com.google.common.primitives.Ints; +import com.powsybl.commons.config.PlatformConfig; +import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.util.ShortIdDictionary; + +import java.io.IOException; +import java.io.PrintStream; +import java.io.Writer; +import java.nio.file.Path; +import java.util.List; +import java.util.Objects; +import java.util.Random; +import java.util.stream.Stream; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +abstract class AbstractTopologyModel implements TopologyModel { + + public static final int DEFAULT_NODE_INDEX_LIMIT = 1000; + + public static final int NODE_INDEX_LIMIT = loadNodeIndexLimit(PlatformConfig.defaultConfig()); + + protected final VoltageLevelExt voltageLevel; + + protected AbstractTopologyModel(VoltageLevelExt voltageLevel) { + this.voltageLevel = Objects.requireNonNull(voltageLevel); + } + + protected static int loadNodeIndexLimit(PlatformConfig platformConfig) { + return platformConfig + .getOptionalModuleConfig("iidm") + .map(moduleConfig -> moduleConfig.getIntProperty("node-index-limit", DEFAULT_NODE_INDEX_LIMIT)) + .orElse(DEFAULT_NODE_INDEX_LIMIT); + } + + protected NetworkImpl getNetwork() { + return voltageLevel.getNetwork(); + } + + protected static void addNextTerminals(TerminalExt otherTerminal, List nextTerminals) { + Objects.requireNonNull(otherTerminal); + Objects.requireNonNull(nextTerminals); + Connectable otherConnectable = otherTerminal.getConnectable(); + if (otherConnectable instanceof Branch branch) { + if (branch.getTerminal1() == otherTerminal) { + nextTerminals.add((TerminalExt) branch.getTerminal2()); + } else if (branch.getTerminal2() == otherTerminal) { + nextTerminals.add((TerminalExt) branch.getTerminal1()); + } else { + throw new IllegalStateException(); + } + } else if (otherConnectable instanceof ThreeWindingsTransformer ttc) { + if (ttc.getLeg1().getTerminal() == otherTerminal) { + nextTerminals.add((TerminalExt) ttc.getLeg2().getTerminal()); + nextTerminals.add((TerminalExt) ttc.getLeg3().getTerminal()); + } else if (ttc.getLeg2().getTerminal() == otherTerminal) { + nextTerminals.add((TerminalExt) ttc.getLeg1().getTerminal()); + nextTerminals.add((TerminalExt) ttc.getLeg3().getTerminal()); + } else if (ttc.getLeg3().getTerminal() == otherTerminal) { + nextTerminals.add((TerminalExt) ttc.getLeg1().getTerminal()); + nextTerminals.add((TerminalExt) ttc.getLeg2().getTerminal()); + } else { + throw new IllegalStateException(); + } + } + } + + public void invalidateCache() { + invalidateCache(false); + } + + public abstract Iterable getTerminals(); + + public abstract Stream getTerminalStream(); + + public Iterable getConnectables(Class clazz) { + Iterable terminals = getTerminals(); + return FluentIterable.from(terminals) + .transform(Terminal::getConnectable) + .filter(clazz) + .toSet(); + } + + public Stream getConnectableStream(Class clazz) { + return getTerminalStream() + .map(Terminal::getConnectable) + .filter(clazz::isInstance) + .map(clazz::cast) + .distinct(); + } + + public int getConnectableCount(Class clazz) { + return Ints.checkedCast(getConnectableStream(clazz).count()); + } + + public Iterable getConnectables() { + return FluentIterable.from(getTerminals()) + .transform(Terminal::getConnectable) + .toSet(); + } + + public Stream getConnectableStream() { + return getTerminalStream() + .map(Terminal::getConnectable) + .distinct(); + } + + public abstract VoltageLevelExt.NodeBreakerViewExt getNodeBreakerView(); + + public abstract VoltageLevelExt.BusBreakerViewExt getBusBreakerView(); + + public abstract VoltageLevelExt.BusViewExt getBusView(); + + public abstract Iterable getSwitches(); + + public abstract int getSwitchCount(); + + public abstract TopologyKind getTopologyKind(); + + public abstract void extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex); + + public abstract void reduceVariantArraySize(int number); + + public abstract void deleteVariantArrayElement(int index); + + public abstract void allocateVariantArrayElement(int[] indexes, int sourceIndex); + + protected abstract void removeTopology(); + + public abstract void printTopology(); + + public abstract void printTopology(PrintStream out, ShortIdDictionary dict); + + public abstract void exportTopology(Path file) throws IOException; + + public abstract void exportTopology(Writer writer); + + public abstract void exportTopology(Writer writer, Random random); +} diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BatteryAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BatteryAdderImpl.java index dbe328bfa95..d865fce6cbe 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BatteryAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BatteryAdderImpl.java @@ -92,7 +92,7 @@ public BatteryImpl add() { BatteryImpl battery = new BatteryImpl(getNetworkRef(), id, getName(), isFictitious(), targetP, targetQ, minP, maxP); battery.addTerminal(terminal); - voltageLevel.attach(terminal, false); + voltageLevel.getTopologyModel().attach(terminal, false); network.getIndex().checkAndAdd(battery); network.getListeners().notifyCreation(battery); return battery; diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusAdderImpl.java index dd663b3173f..fa139ab2165 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusAdderImpl.java @@ -15,9 +15,9 @@ */ class BusAdderImpl extends AbstractIdentifiableAdder implements BusAdder { - private final BusBreakerVoltageLevel voltageLevel; + private final VoltageLevelExt voltageLevel; - BusAdderImpl(BusBreakerVoltageLevel voltageLevel) { + BusAdderImpl(VoltageLevelExt voltageLevel) { this.voltageLevel = voltageLevel; } @@ -35,7 +35,7 @@ protected String getTypeDescription() { public ConfiguredBus add() { String id = checkAndGetUniqueId(); ConfiguredBusImpl bus = new ConfiguredBusImpl(id, getName(), isFictitious(), voltageLevel); - voltageLevel.addBus(bus); + ((BusBreakerTopologyModel) voltageLevel.getTopologyModel()).addBus(bus); getNetwork().getListeners().notifyCreation(bus); return bus; } diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusBreakerVoltageLevel.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusBreakerTopologyModel.java similarity index 91% rename from iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusBreakerVoltageLevel.java rename to iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusBreakerTopologyModel.java index cc565709153..95d1a89dd97 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusBreakerVoltageLevel.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusBreakerTopologyModel.java @@ -13,7 +13,6 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.commons.util.Colors; import com.powsybl.iidm.network.*; -import com.powsybl.commons.ref.Ref; import com.powsybl.iidm.network.util.Identifiables; import com.powsybl.iidm.network.util.Networks; import com.powsybl.iidm.network.util.ShortIdDictionary; @@ -44,11 +43,11 @@ /** * @author Geoffroy Jamgotchian {@literal } */ -class BusBreakerVoltageLevel extends AbstractVoltageLevel { +class BusBreakerTopologyModel extends AbstractTopologyModel { private static final boolean DRAW_SWITCH_ID = true; - private final class SwitchAdderImpl extends AbstractIdentifiableAdder implements BusBreakerView.SwitchAdder { + private final class SwitchAdderImpl extends AbstractIdentifiableAdder implements VoltageLevel.BusBreakerView.SwitchAdder { private String busId1; @@ -61,7 +60,7 @@ private SwitchAdderImpl() { @Override protected NetworkImpl getNetwork() { - return BusBreakerVoltageLevel.this.getNetwork(); + return BusBreakerTopologyModel.this.getNetwork(); } @Override @@ -70,19 +69,19 @@ protected String getTypeDescription() { } @Override - public BusBreakerView.SwitchAdder setBus1(String bus1) { + public VoltageLevel.BusBreakerView.SwitchAdder setBus1(String bus1) { this.busId1 = bus1; return this; } @Override - public BusBreakerView.SwitchAdder setBus2(String bus2) { + public VoltageLevel.BusBreakerView.SwitchAdder setBus2(String bus2) { this.busId2 = bus2; return this; } @Override - public BusBreakerView.SwitchAdder setOpen(boolean open) { + public VoltageLevel.BusBreakerView.SwitchAdder setOpen(boolean open) { this.open = open; return this; } @@ -100,7 +99,7 @@ public Switch add() { throw new ValidationException(this, "same bus at both ends"); } - SwitchImpl aSwitch = new SwitchImpl(BusBreakerVoltageLevel.this, id, getName(), isFictitious(), SwitchKind.BREAKER, open, true); + SwitchImpl aSwitch = new SwitchImpl(voltageLevel, id, getName(), isFictitious(), SwitchKind.BREAKER, open, true); addSwitch(aSwitch, busId1, busId2); getNetwork().getListeners().notifyCreation(aSwitch); return aSwitch; @@ -122,7 +121,7 @@ private Integer getVertex(String busId, boolean throwException) { if (throwException && v == null) { throw new PowsyblException("Bus " + busId + " not found in voltage level " - + BusBreakerVoltageLevel.this.id); + + voltageLevel.getId()); } return v; } @@ -145,7 +144,7 @@ private Integer getEdge(String switchId, boolean throwException) { if (throwException && e == null) { throw new PowsyblException("Switch " + switchId + " not found in voltage level" - + BusBreakerVoltageLevel.this.id); + + voltageLevel.getId()); } return e; } @@ -215,9 +214,9 @@ protected boolean isBusValid(Set busSet) { private MergedBus createMergedBus(int busNum, Set busSet) { String suffix = "_" + busNum; - String mergedBusId = Identifiables.getUniqueId(BusBreakerVoltageLevel.this.id + suffix, getNetwork().getIndex()::contains); - String mergedBusName = BusBreakerVoltageLevel.this.name != null ? BusBreakerVoltageLevel.this.name + suffix : null; - return new MergedBus(mergedBusId, mergedBusName, BusBreakerVoltageLevel.this.fictitious, busSet); + String mergedBusId = Identifiables.getUniqueId(voltageLevel.getId() + suffix, getNetwork().getIndex()::contains); + String mergedBusName = voltageLevel.getOptionalName().map(name -> name + suffix).orElse(null); + return new MergedBus(mergedBusId, mergedBusName, voltageLevel.isFictitious(), busSet); } private void updateCache() { @@ -278,7 +277,7 @@ private MergedBus getMergedBus(String mergedBusId, boolean throwException) { if (throwException && bus == null) { throw new PowsyblException("Bus " + mergedBusId + " not found in voltage level " - + BusBreakerVoltageLevel.this.id); + + voltageLevel.getId()); } return bus; } @@ -309,11 +308,10 @@ public VariantImpl copy() { protected final VariantArray variants; - BusBreakerVoltageLevel(String id, String name, boolean fictitious, SubstationImpl substation, Ref ref, - Ref subnetworkRef, double nominalV, double lowVoltageLimit, double highVoltageLimit) { - super(id, name, fictitious, substation, ref, subnetworkRef, nominalV, lowVoltageLimit, highVoltageLimit); + BusBreakerTopologyModel(VoltageLevelExt voltageLevel) { + super(voltageLevel); // the ref object of the variant array is the same as the current object - variants = new VariantArray<>(ref, VariantImpl::new); + variants = new VariantArray<>(voltageLevel.getNetworkRef(), VariantImpl::new); // invalidate topology and connected components graph.addListener(new UndirectedGraphListener<>() { @Override @@ -388,14 +386,14 @@ static PowsyblException createNotSupportedBusBreakerTopologyException() { return new PowsyblException("Not supported in a bus breaker topology"); } - private final NodeBreakerViewExt nodeBreakerView = new NodeBreakerViewExt() { + private final VoltageLevelExt.NodeBreakerViewExt nodeBreakerView = new VoltageLevelExt.NodeBreakerViewExt() { @Override public double getFictitiousP0(int node) { throw createNotSupportedBusBreakerTopologyException(); } @Override - public NodeBreakerView setFictitiousP0(int node, double p0) { + public VoltageLevel.NodeBreakerView setFictitiousP0(int node, double p0) { throw createNotSupportedBusBreakerTopologyException(); } @@ -405,7 +403,7 @@ public double getFictitiousQ0(int node) { } @Override - public NodeBreakerView setFictitiousQ0(int node, double q0) { + public VoltageLevel.NodeBreakerView setFictitiousQ0(int node, double q0) { throw createNotSupportedBusBreakerTopologyException(); } @@ -576,11 +574,11 @@ public void traverse(int[] node, TopologyTraverser traverser) { }; @Override - public NodeBreakerViewExt getNodeBreakerView() { + public VoltageLevelExt.NodeBreakerViewExt getNodeBreakerView() { return nodeBreakerView; } - private final BusBreakerViewExt busBreakerView = new BusBreakerViewExt() { + private final VoltageLevelExt.BusBreakerViewExt busBreakerView = new VoltageLevelExt.BusBreakerViewExt() { @Override public Iterable getBuses() { @@ -599,22 +597,22 @@ public int getBusCount() { @Override public ConfiguredBus getBus(String id) { - return BusBreakerVoltageLevel.this.getBus(id, false); + return BusBreakerTopologyModel.this.getBus(id, false); } @Override public BusAdder newBus() { - return new BusAdderImpl(BusBreakerVoltageLevel.this); + return new BusAdderImpl(voltageLevel); } @Override public void removeBus(String busId) { - BusBreakerVoltageLevel.this.removeBus(busId); + BusBreakerTopologyModel.this.removeBus(busId); } @Override public void removeAllBuses() { - BusBreakerVoltageLevel.this.removeAllBuses(); + BusBreakerTopologyModel.this.removeAllBuses(); } @Override @@ -634,12 +632,12 @@ public int getSwitchCount() { @Override public void removeSwitch(String switchId) { - BusBreakerVoltageLevel.this.removeSwitch(switchId); + BusBreakerTopologyModel.this.removeSwitch(switchId); } @Override public void removeAllSwitches() { - BusBreakerVoltageLevel.this.removeAllSwitches(); + BusBreakerTopologyModel.this.removeAllSwitches(); } @Override @@ -671,11 +669,11 @@ public Stream getBusStreamFromBusViewBusId(String mergedBusId) { @Override public SwitchImpl getSwitch(String switchId) { - return BusBreakerVoltageLevel.this.getSwitch(switchId, false); + return BusBreakerTopologyModel.this.getSwitch(switchId, false); } @Override - public BusBreakerView.SwitchAdder newSwitch() { + public VoltageLevel.BusBreakerView.SwitchAdder newSwitch() { return new SwitchAdderImpl(); } @@ -690,11 +688,11 @@ public void traverse(Bus bus, TopologyTraverser traverser) { }; @Override - public BusBreakerViewExt getBusBreakerView() { + public VoltageLevelExt.BusBreakerViewExt getBusBreakerView() { return busBreakerView; } - private final BusViewExt busView = new BusViewExt() { + private final VoltageLevelExt.BusViewExt busView = new VoltageLevelExt.BusViewExt() { @Override public Iterable getBuses() { @@ -719,7 +717,7 @@ public Bus getMergedBus(String configuredBusId) { }; @Override - public BusViewExt getBusView() { + public VoltageLevelExt.BusViewExt getBusView() { return busView; } @@ -748,7 +746,7 @@ void addBus(ConfiguredBus bus) { private void removeBus(String busId) { ConfiguredBus bus = getBus(busId, true); if (bus.getTerminalCount() > 0) { - throw new ValidationException(this, "Cannot remove bus " + throw new ValidationException(voltageLevel, "Cannot remove bus " + bus.getId() + " because of connectable equipments"); } // TODO improve check efficency @@ -777,11 +775,11 @@ private void removeBus(String busId) { private void removeAllBuses() { if (graph.getEdgeCount() > 0) { - throw new ValidationException(this, "Cannot remove all buses because there is still some switches"); + throw new ValidationException(voltageLevel, "Cannot remove all buses because there is still some switches"); } for (ConfiguredBus bus : graph.getVerticesObj()) { if (bus.getTerminalCount() > 0) { - throw new ValidationException(this, "Cannot remove bus " + throw new ValidationException(voltageLevel, "Cannot remove bus " + bus.getId() + " because of connected equipments"); } } @@ -811,7 +809,7 @@ private void removeSwitch(String switchId) { Integer e = switches.get(switchId); if (e == null) { throw new PowsyblException("Switch '" + switchId - + "' not found in voltage level '" + id + "'"); + + "' not found in voltage level '" + voltageLevel.getId() + "'"); } NetworkImpl network = getNetwork(); SwitchImpl aSwitch = graph.getEdgeObject(e); @@ -845,7 +843,7 @@ private void removeAllSwitches() { private void checkTerminal(TerminalExt terminal) { if (!(terminal instanceof BusTerminal)) { throw new ValidationException(terminal.getConnectable(), - "voltage level " + BusBreakerVoltageLevel.this.id + " has a bus/breaker topology" + "voltage level " + voltageLevel.getId() + " has a bus/breaker topology" + ", a bus connection should be specified instead of a node connection"); } @@ -863,7 +861,7 @@ public void attach(final TerminalExt terminal, boolean test) { return; } // create the link terminal -> voltage level - terminal.setVoltageLevel(this); + terminal.setVoltageLevel(voltageLevel); // create the link bus -> terminal String connectableBusId = ((BusTerminal) terminal).getConnectableBusId(); @@ -891,7 +889,7 @@ public void detach(final TerminalExt terminal) { getNetwork().getVariantManager().forEachVariant(() -> { connectableBus.removeTerminal((BusTerminal) terminal); - ((BusTerminal) terminal).setConnectableBusId(null); + ((BusTerminal) terminal).unsetConnectableBusId(); invalidateCache(); }); @@ -899,8 +897,7 @@ public void detach(final TerminalExt terminal) { terminal.setVoltageLevel(null); } - @Override - public boolean connect(TerminalExt terminal) { + boolean connect(TerminalExt terminal) { if (!(terminal instanceof BusTerminal)) { throw new IllegalStateException("Given TerminalExt not supported: " + terminal.getClass().getName()); } @@ -923,8 +920,7 @@ public boolean connect(TerminalExt terminal, Predicate isTyp return connect(terminal); } - @Override - public boolean disconnect(TerminalExt terminal) { + boolean disconnect(TerminalExt terminal) { if (!(terminal instanceof BusTerminal)) { throw new IllegalStateException("Given TerminalExt not supported: " + terminal.getClass().getName()); } @@ -1021,25 +1017,21 @@ private static TraverseResult getTraverserResult(Set visitedTerminals, @Override public void extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex) { - super.extendVariantArraySize(initVariantArraySize, number, sourceIndex); variants.push(number, () -> variants.copy(sourceIndex)); } @Override public void reduceVariantArraySize(int number) { - super.reduceVariantArraySize(number); variants.pop(number); } @Override public void deleteVariantArrayElement(int index) { - super.deleteVariantArrayElement(index); variants.delete(index); } @Override public void allocateVariantArrayElement(int[] indexes, final int sourceIndex) { - super.allocateVariantArrayElement(indexes, sourceIndex); variants.allocate(indexes, () -> variants.copy(sourceIndex)); } @@ -1057,7 +1049,7 @@ public void printTopology() { @Override public void printTopology(PrintStream out, ShortIdDictionary dict) { out.println("-------------------------------------------------------------"); - out.println("Topology of " + BusBreakerVoltageLevel.this.id); + out.println("Topology of " + voltageLevel.getId()); Function vertexToString = bus -> { StringBuilder builder = new StringBuilder(); diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusTerminal.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusTerminal.java index 80e92cf69f8..383023ceea8 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusTerminal.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusTerminal.java @@ -26,10 +26,14 @@ */ class BusTerminal extends AbstractTerminal { + private BusBreakerTopologyModel getTopologyModel() { + return (BusBreakerTopologyModel) voltageLevel.getTopologyModel(); + } + private final NodeBreakerView nodeBreakerView = new NodeBreakerView() { @Override public int getNode() { - throw BusBreakerVoltageLevel.createNotSupportedBusBreakerTopologyException(); + throw BusBreakerTopologyModel.createNotSupportedBusBreakerTopologyException(); } @Override @@ -56,7 +60,7 @@ public ConfiguredBus getConnectableBus() { if (removed) { throw new PowsyblException(CANNOT_ACCESS_BUS_REMOVED_EQUIPMENT + connectable.id); } - return ((BusBreakerVoltageLevel) voltageLevel).getBus(getConnectableBusId(), true); + return getTopologyModel().getBus(getConnectableBusId(), true); } @Override @@ -65,15 +69,15 @@ public void setConnectableBus(String busId) { throw new PowsyblException(UNMODIFIABLE_REMOVED_EQUIPMENT + connectable.id); } Objects.requireNonNull(busId); - BusBreakerVoltageLevel vl = (BusBreakerVoltageLevel) voltageLevel; + BusBreakerTopologyModel topologyModel = getTopologyModel(); // Assert that the new bus exists - vl.getBus(busId, true); + topologyModel.getBus(busId, true); - vl.detach(BusTerminal.this); + topologyModel.detach(BusTerminal.this); int variantIndex = getVariantManagerHolder().getVariantIndex(); String oldValue = BusTerminal.this.connectableBusId.set(variantIndex, busId); - vl.attach(BusTerminal.this, false); + topologyModel.attach(BusTerminal.this, false); String variantId = getVariantManagerHolder().getVariantManager().getVariantId(variantIndex); getConnectable().notifyUpdate("connectableBusId", variantId, oldValue, busId); } @@ -108,8 +112,8 @@ public MergedBus getConnectableBus() { if (removed) { throw new PowsyblException(CANNOT_ACCESS_BUS_REMOVED_EQUIPMENT + connectable.id); } - ConfiguredBus bus = ((BusBreakerVoltageLevel) voltageLevel).getBus(getConnectableBusId(), true); - return ((BusBreakerVoltageLevel) voltageLevel).calculatedBusTopology.getMergedBus(bus); + ConfiguredBus bus = getTopologyModel().getBus(getConnectableBusId(), true); + return getTopologyModel().calculatedBusTopology.getMergedBus(bus); } }; @@ -132,14 +136,12 @@ public MergedBus getConnectableBus() { } } - void setConnectableBusId(String connectableBusId) { + void unsetConnectableBusId() { if (removed) { throw new PowsyblException(UNMODIFIABLE_REMOVED_EQUIPMENT + connectable.id); } int variantIndex = getVariantManagerHolder().getVariantIndex(); - String oldValue = this.connectableBusId.set(variantIndex, connectableBusId); - String variantId = getVariantManagerHolder().getVariantManager().getVariantId(variantIndex); - getConnectable().notifyUpdate("connectableBusId", variantId, oldValue, connectableBusId); + this.connectableBusId.set(variantIndex, null); } String getConnectableBusId() { @@ -172,7 +174,7 @@ public boolean traverse(TopologyTraverser traverser, Set visitedTermin if (removed) { throw new PowsyblException(String.format("Associated equipment %s is removed", connectable.id)); } - return ((BusBreakerVoltageLevel) voltageLevel).traverse(this, traverser, visitedTerminals, traversalType); + return getTopologyModel().traverse(this, traverser, visitedTerminals, traversalType); } @Override @@ -185,7 +187,7 @@ public void traverse(TopologyTraverser traverser, TraversalType traversalType) { if (removed) { throw new PowsyblException(String.format("Associated equipment %s is removed", connectable.id)); } - ((BusBreakerVoltageLevel) voltageLevel).traverse(this, traverser, traversalType); + getTopologyModel().traverse(this, traverser, traversalType); } @Override diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusbarSectionAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusbarSectionAdderImpl.java index 1bd5708ecc7..0e513c7198b 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusbarSectionAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/BusbarSectionAdderImpl.java @@ -50,7 +50,7 @@ public BusbarSection add() { TerminalExt terminal = new NodeTerminal(voltageLevel.getNetworkRef(), null, node); BusbarSectionImpl section = new BusbarSectionImpl(voltageLevel.getNetworkRef(), id, getName(), isFictitious()); section.addTerminal(terminal); - voltageLevel.attach(terminal, false); + voltageLevel.getTopologyModel().attach(terminal, false); getNetwork().getIndex().checkAndAdd(section); getNetwork().getListeners().notifyCreation(section); return section; diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/CalculatedBusImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/CalculatedBusImpl.java index bf1cd008d4c..60907282a5b 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/CalculatedBusImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/CalculatedBusImpl.java @@ -29,7 +29,7 @@ class CalculatedBusImpl extends AbstractBus implements CalculatedBus { private NodeTerminal terminalRef; - CalculatedBusImpl(String id, String name, boolean fictitious, NodeBreakerVoltageLevel voltageLevel, TIntArrayList nodes, List terminals, Function getBusFromTerminal) { + CalculatedBusImpl(String id, String name, boolean fictitious, VoltageLevelExt voltageLevel, TIntArrayList nodes, List terminals, Function getBusFromTerminal) { super(id, name, fictitious, voltageLevel); this.terminals = Objects.requireNonNull(terminals); this.getBusFromTerminal = Objects.requireNonNull(getBusFromTerminal); @@ -47,7 +47,7 @@ class CalculatedBusImpl extends AbstractBus implements CalculatedBus { * @param terminals The terminals belong to this bus * @return The first terminal of the {@code terminals} list, or a terminal which belongs to an equivalent "electrical" bus. */ - private static NodeTerminal findTerminal(NodeBreakerVoltageLevel voltageLevel, TIntArrayList nodes, List terminals) { + private static NodeTerminal findTerminal(VoltageLevelExt voltageLevel, TIntArrayList nodes, List terminals) { if (!terminals.isEmpty()) { return terminals.get(0); } diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ConnectDisconnectUtil.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ConnectDisconnectUtil.java index e178a176e2e..861c4883022 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ConnectDisconnectUtil.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ConnectDisconnectUtil.java @@ -19,6 +19,7 @@ import java.util.function.Predicate; import static com.powsybl.iidm.network.TopologyKind.BUS_BREAKER; +import static com.powsybl.iidm.network.TopologyKind.NODE_BREAKER; /** * @author Nicolas Rol {@literal } @@ -63,8 +64,9 @@ static boolean connectAllTerminals(Identifiable identifiable, List identifiable, List getVoltageLevels() { - return Iterables.concat(index.getAll(BusBreakerVoltageLevel.class), - index.getAll(NodeBreakerVoltageLevel.class)); + return Collections.unmodifiableCollection(index.getAll(VoltageLevelImpl.class)); } @Override public Stream getVoltageLevelStream() { - return Stream.concat(index.getAll(BusBreakerVoltageLevel.class).stream(), - index.getAll(NodeBreakerVoltageLevel.class).stream()); + return index.getAll(VoltageLevelImpl.class).stream().map(Function.identity()); } @Override public int getVoltageLevelCount() { - return index.getAll(BusBreakerVoltageLevel.class).size() - + index.getAll(NodeBreakerVoltageLevel.class).size(); + return index.getAll(VoltageLevelImpl.class).size(); } @Override @@ -1259,15 +1256,13 @@ public ValidationLevel getValidationLevel() { } @Override - public Network setMinimumAcceptableValidationLevel(ValidationLevel validationLevel) { - Objects.requireNonNull(validationLevel); - if (this.validationLevel == null) { - this.validationLevel = ValidationUtil.validate(Collections.unmodifiableCollection(index.getAll()), false, false, this.validationLevel, ReportNode.NO_OP); + public Network setMinimumAcceptableValidationLevel(ValidationLevel minLevel) { + Objects.requireNonNull(minLevel); + ValidationLevel currentLevel = getValidationLevel(); + if (currentLevel.compareTo(minLevel) < 0) { + throw new ValidationException(this, "Network should be corrected in order to correspond to validation level " + minLevel); } - if (this.validationLevel.compareTo(validationLevel) < 0) { - throw new ValidationException(this, "Network should be corrected in order to correspond to validation level " + validationLevel); - } - this.minValidationLevel = validationLevel; + this.minValidationLevel = minLevel; return this; } diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NetworkListenerList.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NetworkListenerList.java index fda2be587ab..91f127a9b04 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NetworkListenerList.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NetworkListenerList.java @@ -37,23 +37,13 @@ void remove(NetworkListener listener) { void notifyUpdate(Identifiable identifiable, Supplier attribute, Object oldValue, Object newValue) { if (!listeners.isEmpty() && !Objects.equals(oldValue, newValue)) { - notifyUpdateListeners(identifiable, attribute.get(), oldValue, newValue); + notifyUpdateListeners(identifiable, attribute.get(), null, oldValue, newValue); } } void notifyUpdate(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { if (!listeners.isEmpty() && !Objects.equals(oldValue, newValue)) { - notifyUpdateListeners(identifiable, attribute, oldValue, newValue); - } - } - - private void notifyUpdateListeners(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { - for (NetworkListener listener : listeners) { - try { - listener.onUpdate(identifiable, attribute, oldValue, newValue); - } catch (Exception t) { - LOGGER.error(t.toString(), t); - } + notifyUpdateListeners(identifiable, attribute, null, oldValue, newValue); } } @@ -109,16 +99,16 @@ public void notifyExtensionAfterRemoval(Identifiable identifiable, String ext } } - public void notifyExtensionUpdate(Extension extension, String attribute, Object oldValue, Object newValue) { + public void notifyExtensionUpdate(Extension extension, String attribute, String variantId, Object oldValue, Object newValue) { if (!listeners.isEmpty() && !Objects.equals(oldValue, newValue)) { - notifyExtensionUpdateListeners(extension, attribute, oldValue, newValue); + notifyExtensionUpdateListeners(extension, attribute, variantId, oldValue, newValue); } } - private void notifyExtensionUpdateListeners(Extension extension, String attribute, Object oldValue, Object newValue) { + private void notifyExtensionUpdateListeners(Extension extension, String attribute, String variantId, Object oldValue, Object newValue) { for (NetworkListener listener : listeners) { try { - listener.onExtensionUpdate(extension, attribute, oldValue, newValue); + listener.onExtensionUpdate(extension, attribute, variantId, oldValue, newValue); } catch (Exception t) { LOGGER.error(t.toString(), t); } @@ -155,48 +145,48 @@ void notifyAfterRemoval(String id) { } } - void notifyElementAdded(Identifiable identifiable, Supplier attribute, Object newValue) { + void notifyPropertyAdded(Identifiable identifiable, Supplier attribute, Object newValue) { if (!listeners.isEmpty()) { - notifyElementAdded(identifiable, attribute.get(), newValue); + notifyPropertyAdded(identifiable, attribute.get(), newValue); } } - void notifyElementAdded(Identifiable identifiable, String attribute, Object newValue) { + void notifyPropertyAdded(Identifiable identifiable, String attribute, Object newValue) { for (NetworkListener listener : listeners) { try { - listener.onElementAdded(identifiable, attribute, newValue); + listener.onPropertyAdded(identifiable, attribute, newValue); } catch (Exception t) { LOGGER.error(t.toString(), t); } } } - void notifyElementReplaced(Identifiable identifiable, Supplier attribute, Object oldValue, Object newValue) { + void notifyPropertyReplaced(Identifiable identifiable, Supplier attribute, Object oldValue, Object newValue) { if (!listeners.isEmpty() && !Objects.equals(oldValue, newValue)) { - notifyElementReplaced(identifiable, attribute.get(), oldValue, newValue); + notifyPropertyReplaced(identifiable, attribute.get(), oldValue, newValue); } } - void notifyElementReplaced(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { + void notifyPropertyReplaced(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { for (NetworkListener listener : listeners) { try { - listener.onElementReplaced(identifiable, attribute, oldValue, newValue); + listener.onPropertyReplaced(identifiable, attribute, oldValue, newValue); } catch (Exception t) { LOGGER.error(t.toString(), t); } } } - void notifyElementRemoved(Identifiable identifiable, Supplier attribute, Object oldValue) { + void notifyPropertyRemoved(Identifiable identifiable, Supplier attribute, Object oldValue) { if (!listeners.isEmpty()) { - notifyElementRemoved(identifiable, attribute.get(), oldValue); + notifyPropertyRemoved(identifiable, attribute.get(), oldValue); } } - void notifyElementRemoved(Identifiable identifiable, String attribute, Object oldValue) { + void notifyPropertyRemoved(Identifiable identifiable, String attribute, Object oldValue) { for (NetworkListener listener : listeners) { try { - listener.onElementRemoved(identifiable, attribute, oldValue); + listener.onPropertyRemoved(identifiable, attribute, oldValue); } catch (Exception t) { LOGGER.error(t.toString(), t); } diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeBreakerVoltageLevel.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeBreakerTopologyModel.java similarity index 91% rename from iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeBreakerVoltageLevel.java rename to iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeBreakerTopologyModel.java index f8483387a6d..e58a76de39c 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeBreakerVoltageLevel.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeBreakerTopologyModel.java @@ -14,8 +14,8 @@ import com.powsybl.commons.PowsyblException; import com.powsybl.commons.util.Colors; import com.powsybl.iidm.network.*; +import com.powsybl.iidm.network.VoltageLevel.NodeBreakerView.InternalConnectionAdder; import com.powsybl.iidm.network.VoltageLevel.NodeBreakerView.SwitchAdder; -import com.powsybl.commons.ref.Ref; import com.powsybl.iidm.network.util.Identifiables; import com.powsybl.iidm.network.util.ShortIdDictionary; import com.powsybl.iidm.network.util.SwitchPredicates; @@ -50,9 +50,9 @@ /** * @author Geoffroy Jamgotchian {@literal } */ -class NodeBreakerVoltageLevel extends AbstractVoltageLevel { +class NodeBreakerTopologyModel extends AbstractTopologyModel { - private static final Logger LOGGER = LoggerFactory.getLogger(NodeBreakerVoltageLevel.class); + private static final Logger LOGGER = LoggerFactory.getLogger(NodeBreakerTopologyModel.class); private static final String WRONG_TERMINAL_TYPE_EXCEPTION_MESSAGE = "Given TerminalExt not supported: "; @@ -85,7 +85,7 @@ public VariantImpl copy() { private final VariantArray variants; - private final class SwitchAdderImpl extends AbstractIdentifiableAdder implements NodeBreakerView.SwitchAdder { + private final class SwitchAdderImpl extends AbstractIdentifiableAdder implements SwitchAdder { private Integer node1; @@ -107,7 +107,7 @@ private SwitchAdderImpl(SwitchKind kind) { @Override protected NetworkImpl getNetwork() { - return NodeBreakerVoltageLevel.this.getNetwork(); + return NodeBreakerTopologyModel.this.getNetwork(); } @Override @@ -116,19 +116,19 @@ protected String getTypeDescription() { } @Override - public NodeBreakerView.SwitchAdder setNode1(int node1) { + public SwitchAdder setNode1(int node1) { this.node1 = node1; return this; } @Override - public NodeBreakerView.SwitchAdder setNode2(int node2) { + public SwitchAdder setNode2(int node2) { this.node2 = node2; return this; } @Override - public NodeBreakerView.SwitchAdder setKind(SwitchKind kind) { + public SwitchAdder setKind(SwitchKind kind) { if (kind == null) { throw new NullPointerException("kind is null"); } @@ -142,13 +142,13 @@ public SwitchAdder setKind(String kind) { } @Override - public NodeBreakerView.SwitchAdder setOpen(boolean open) { + public SwitchAdder setOpen(boolean open) { this.open = open; return this; } @Override - public NodeBreakerView.SwitchAdder setRetained(boolean retained) { + public SwitchAdder setRetained(boolean retained) { this.retained = retained; return this; } @@ -168,7 +168,7 @@ public Switch add() { if (kind == null) { throw new ValidationException(this, "kind is not set"); } - SwitchImpl aSwitch = new SwitchImpl(NodeBreakerVoltageLevel.this, id, getName(), isFictitious(), kind, open, retained); + SwitchImpl aSwitch = new SwitchImpl(voltageLevel, id, getName(), isFictitious(), kind, open, retained); graph.addVertexIfNotPresent(node1); graph.addVertexIfNotPresent(node2); graph.addEdge(node1, node2, aSwitch); @@ -177,7 +177,7 @@ public Switch add() { } - private final class InternalConnectionAdderImpl implements NodeBreakerView.InternalConnectionAdder { + private final class InternalConnectionAdderImpl implements InternalConnectionAdder { private Integer node1; @@ -187,13 +187,13 @@ private InternalConnectionAdderImpl() { } @Override - public NodeBreakerView.InternalConnectionAdder setNode1(int node1) { + public InternalConnectionAdder setNode1(int node1) { this.node1 = node1; return this; } @Override - public NodeBreakerView.InternalConnectionAdder setNode2(int node2) { + public InternalConnectionAdder setNode2(int node2) { this.node2 = node2; return this; } @@ -201,10 +201,10 @@ public NodeBreakerView.InternalConnectionAdder setNode2(int node2) { @Override public void add() { if (node1 == null) { - throw new ValidationException(NodeBreakerVoltageLevel.this, "first connection node is not set"); + throw new ValidationException(voltageLevel, "first connection node is not set"); } if (node2 == null) { - throw new ValidationException(NodeBreakerVoltageLevel.this, "second connection node is not set"); + throw new ValidationException(voltageLevel, "second connection node is not set"); } graph.addVertexIfNotPresent(node1); graph.addVertexIfNotPresent(node2); @@ -274,7 +274,7 @@ private void traverse(int n, boolean[] encountered, Predicate termin }, encountered); // check that the component is a bus - String busId = Identifiables.getUniqueId(NAMING_STRATEGY.getId(NodeBreakerVoltageLevel.this, nodes), getNetwork().getIndex()::contains); + String busId = Identifiables.getUniqueId(NAMING_STRATEGY.getId(voltageLevel, nodes), getNetwork().getIndex()::contains); CopyOnWriteArrayList terminals = new CopyOnWriteArrayList<>(); for (int i = 0; i < nodes.size(); i++) { int n2 = nodes.getQuick(i); @@ -291,9 +291,9 @@ private void traverse(int n, boolean[] encountered, Predicate termin private void addBus(TIntArrayList nodes, Map id2bus, CalculatedBus[] node2bus, String busId, CopyOnWriteArrayList terminals) { - String busName = NAMING_STRATEGY.getName(NodeBreakerVoltageLevel.this, nodes); + String busName = NAMING_STRATEGY.getName(voltageLevel, nodes); Function getBusFromTerminal = getBusChecker() == CALCULATED_BUS_CHECKER ? t -> t.getBusView().getBus() : t -> t.getBusBreakerView().getBus(); - CalculatedBusImpl bus = new CalculatedBusImpl(busId, busName, NodeBreakerVoltageLevel.this.fictitious, NodeBreakerVoltageLevel.this, nodes, terminals, getBusFromTerminal); + CalculatedBusImpl bus = new CalculatedBusImpl(busId, busName, voltageLevel.isFictitious(), voltageLevel, nodes, terminals, getBusFromTerminal); id2bus.put(busId, bus); for (int i = 0; i < nodes.size(); i++) { node2bus[nodes.getQuick(i)] = bus; @@ -304,7 +304,7 @@ protected void updateCache(final Predicate terminate) { if (busCache != null) { return; } - LOGGER.trace("Update bus topology of voltage level {}", NodeBreakerVoltageLevel.this.id); + LOGGER.trace("Update bus topology of voltage level {}", voltageLevel.getId()); Map id2bus = new LinkedHashMap<>(); CalculatedBus[] node2bus = new CalculatedBus[graph.getVertexCapacity()]; boolean[] encountered = new boolean[graph.getVertexCapacity()]; @@ -497,28 +497,27 @@ public boolean isValid(UndirectedGraph graph, private interface BusNamingStrategy { - String getId(NodeBreakerVoltageLevel voltageLevel, TIntArrayList nodes); + String getId(VoltageLevel voltageLevel, TIntArrayList nodes); - String getName(NodeBreakerVoltageLevel voltageLevel, TIntArrayList nodes); + String getName(VoltageLevel voltageLevel, TIntArrayList nodes); } private static final class LowestNodeNumberBusNamingStrategy implements BusNamingStrategy { @Override - public String getId(NodeBreakerVoltageLevel voltageLevel, TIntArrayList nodes) { + public String getId(VoltageLevel voltageLevel, TIntArrayList nodes) { return voltageLevel.getId() + "_" + nodes.min(); } @Override - public String getName(NodeBreakerVoltageLevel voltageLevel, TIntArrayList nodes) { - return voltageLevel.name != null ? voltageLevel.name + "_" + nodes.min() : null; + public String getName(VoltageLevel voltageLevel, TIntArrayList nodes) { + return voltageLevel.getOptionalName().map(name -> name + "_" + nodes.min()).orElse(null); } } - NodeBreakerVoltageLevel(String id, String name, boolean fictitious, SubstationImpl substation, Ref ref, - Ref subnetworkRef, double nominalV, double lowVoltageLimit, double highVoltageLimit) { - super(id, name, fictitious, substation, ref, subnetworkRef, nominalV, lowVoltageLimit, highVoltageLimit); - variants = new VariantArray<>(ref, VariantImpl::new); + NodeBreakerTopologyModel(VoltageLevelExt voltageLevel) { + super(voltageLevel); + variants = new VariantArray<>(voltageLevel.getNetworkRef(), VariantImpl::new); graph.addListener(new DefaultUndirectedGraphListener<>() { private static final String INTERNAL_CONNECTION = "internalConnection"; @@ -531,7 +530,7 @@ public void edgeAdded(int e, SwitchImpl aSwitch) { switches.put(aSwitch.getId(), e); network.getListeners().notifyCreation(aSwitch); } else { - network.getListeners().notifyElementAdded(NodeBreakerVoltageLevel.this, INTERNAL_CONNECTION, null); + network.getListeners().notifyPropertyAdded(voltageLevel, INTERNAL_CONNECTION, null); } invalidateCache(); } @@ -553,7 +552,7 @@ public void edgeRemoved(int e, SwitchImpl aSwitch) { switches.remove(switchId); network.getListeners().notifyAfterRemoval(switchId); } else { - network.getListeners().notifyElementRemoved(NodeBreakerVoltageLevel.this, INTERNAL_CONNECTION, null); + network.getListeners().notifyPropertyRemoved(voltageLevel, INTERNAL_CONNECTION, null); } } @@ -570,7 +569,7 @@ public void allEdgesRemoved(Collection aSwitches) { if (ss != null) { network.getIndex().remove(ss); } else { - network.getListeners().notifyElementRemoved(NodeBreakerVoltageLevel.this, INTERNAL_CONNECTION, null); + network.getListeners().notifyPropertyRemoved(voltageLevel, INTERNAL_CONNECTION, null); } }); switches.clear(); @@ -627,7 +626,7 @@ CalculatedBusTopology getCalculatedBusTopology() { return variants.get().calculatedBusTopology; } - private final NodeBreakerViewExt nodeBreakerView = new NodeBreakerViewExt() { + private final VoltageLevelExt.NodeBreakerViewExt nodeBreakerView = new VoltageLevelExt.NodeBreakerViewExt() { private final TIntObjectMap fictitiousP0ByNode = TCollections.synchronizedMap(new TIntObjectHashMap<>()); private final TIntObjectMap fictitiousQ0ByNode = TCollections.synchronizedMap(new TIntObjectHashMap<>()); @@ -642,9 +641,9 @@ public double getFictitiousP0(int node) { } @Override - public NodeBreakerView setFictitiousP0(int node, double p0) { + public VoltageLevel.NodeBreakerView setFictitiousP0(int node, double p0) { if (Double.isNaN(p0)) { - throw new ValidationException(NodeBreakerVoltageLevel.this, "undefined value cannot be set as fictitious p0"); + throw new ValidationException(voltageLevel, "undefined value cannot be set as fictitious p0"); } TDoubleArrayList p0ByVariant = fictitiousP0ByNode.get(node); if (p0ByVariant == null) { @@ -660,7 +659,7 @@ public NodeBreakerView setFictitiousP0(int node, double p0) { int variantIndex = getNetwork().getVariantIndex(); double oldValue = p0ByVariant.set(getNetwork().getVariantIndex(), p0); String variantId = getNetwork().getVariantManager().getVariantId(variantIndex); - getNetwork().getListeners().notifyUpdate(NodeBreakerVoltageLevel.this, "fictitiousP0", variantId, oldValue, p0); + getNetwork().getListeners().notifyUpdate(voltageLevel, "fictitiousP0", variantId, oldValue, p0); TIntSet toRemove = clearFictitiousInjections(fictitiousP0ByNode); synchronized (fictitiousP0ByNode) { toRemove.forEach(n -> { @@ -681,9 +680,9 @@ public double getFictitiousQ0(int node) { } @Override - public NodeBreakerView setFictitiousQ0(int node, double q0) { + public VoltageLevel.NodeBreakerView setFictitiousQ0(int node, double q0) { if (Double.isNaN(q0)) { - throw new ValidationException(NodeBreakerVoltageLevel.this, "undefined value cannot be set as fictitious q0"); + throw new ValidationException(voltageLevel, "undefined value cannot be set as fictitious q0"); } TDoubleArrayList q0ByVariant = fictitiousQ0ByNode.get(node); if (q0ByVariant == null) { @@ -699,7 +698,7 @@ public NodeBreakerView setFictitiousQ0(int node, double q0) { int variantIndex = getNetwork().getVariantIndex(); double oldValue = q0ByVariant.set(getNetwork().getVariantIndex(), q0); String variantId = getNetwork().getVariantManager().getVariantId(variantIndex); - getNetwork().getListeners().notifyUpdate(NodeBreakerVoltageLevel.this, "fictitiousQ0", variantId, oldValue, q0); + getNetwork().getListeners().notifyUpdate(voltageLevel, "fictitiousQ0", variantId, oldValue, q0); TIntSet toRemove = clearFictitiousInjections(fictitiousQ0ByNode); synchronized (fictitiousQ0ByNode) { toRemove.forEach(n -> { @@ -877,7 +876,7 @@ public void removeSwitch(String switchId) { Integer e = switches.get(switchId); if (e == null) { throw new PowsyblException("Switch '" + switchId - + "' not found in voltage level '" + id + "'"); + + "' not found in voltage level '" + voltageLevel.getId() + "'"); } graph.removeEdge(e); graph.removeIsolatedVertices(); @@ -885,7 +884,7 @@ public void removeSwitch(String switchId) { @Override public BusbarSectionAdder newBusbarSection() { - return new BusbarSectionAdderImpl(NodeBreakerVoltageLevel.this); + return new BusbarSectionAdderImpl(voltageLevel); } @Override @@ -906,7 +905,7 @@ public int getBusbarSectionCount() { @Override public BusbarSection getBusbarSection(String id) { BusbarSection bbs = getNetwork().getIndex().get(id, BusbarSection.class); - if (bbs != null && bbs.getTerminal().getVoltageLevel() != NodeBreakerVoltageLevel.this) { + if (bbs != null && bbs.getTerminal().getVoltageLevel() != voltageLevel) { return null; } return bbs; @@ -942,11 +941,11 @@ private static TIntSet clearFictitiousInjections(TIntObjectMap } @Override - public NodeBreakerViewExt getNodeBreakerView() { + public VoltageLevelExt.NodeBreakerViewExt getNodeBreakerView() { return nodeBreakerView; } - private final BusViewExt busView = new BusViewExt() { + private final VoltageLevelExt.BusViewExt busView = new VoltageLevelExt.BusViewExt() { @Override public Iterable getBuses() { @@ -972,11 +971,11 @@ public Bus getMergedBus(String busBarId) { }; @Override - public BusViewExt getBusView() { + public VoltageLevelExt.BusViewExt getBusView() { return busView; } - private final BusBreakerViewExt busBreakerView = new BusBreakerViewExt() { + private final VoltageLevelExt.BusBreakerViewExt busBreakerView = new VoltageLevelExt.BusBreakerViewExt() { @Override public Iterable getBuses() { @@ -1074,7 +1073,7 @@ public Switch getSwitch(String switchId) { } @Override - public BusBreakerView.SwitchAdder newSwitch() { + public SwitchAdder newSwitch() { throw createNotSupportedNodeBreakerTopologyException(); } @@ -1085,7 +1084,7 @@ public void traverse(Bus bus, TopologyTraverser traverser) { }; @Override - public BusBreakerViewExt getBusBreakerView() { + public VoltageLevelExt.BusBreakerViewExt getBusBreakerView() { return busBreakerView; } @@ -1107,7 +1106,7 @@ public TopologyKind getTopologyKind() { private void checkTerminal(TerminalExt terminal) { if (!(terminal instanceof NodeTerminal)) { throw new ValidationException(terminal.getConnectable(), - "voltage level " + NodeBreakerVoltageLevel.this.id + " has a node/breaker topology" + "voltage level " + voltageLevel.getId() + " has a node/breaker topology" + ", a node connection should be specified instead of a bus connection"); } int node = ((NodeTerminal) terminal).getNode(); @@ -1116,7 +1115,7 @@ private void checkTerminal(TerminalExt terminal) { throw new ValidationException(terminal.getConnectable(), "an equipment (" + graph.getVertexObject(node).getConnectable().getId() + ") is already connected to node " + node + " of voltage level " - + NodeBreakerVoltageLevel.this.id); + + voltageLevel.getId()); } } @@ -1129,12 +1128,12 @@ public void attach(TerminalExt terminal, boolean test) { int node = ((NodeTerminal) terminal).getNode(); // create the link terminal <-> voltage level - terminal.setVoltageLevel(NodeBreakerVoltageLevel.this); + terminal.setVoltageLevel(voltageLevel); // create the link terminal <-> graph vertex graph.setVertexObject(node, (NodeTerminal) terminal); - getNetwork().getVariantManager().forEachVariant(this::invalidateCache); + getNetwork().getVariantManager().forEachVariant(NodeBreakerTopologyModel.this::invalidateCache); } @Override @@ -1147,7 +1146,7 @@ public void detach(TerminalExt terminal) { graph.setVertexObject(node, null); - getNetwork().getVariantManager().forEachVariant(this::invalidateCache); + getNetwork().getVariantManager().forEachVariant(NodeBreakerTopologyModel.this::invalidateCache); // remove the link terminal -> voltage level terminal.setVoltageLevel(null); @@ -1181,8 +1180,7 @@ private void checkTopologyKind(Terminal terminal) { * @param terminal Terminal to connect * @return true if the terminal has been connected, false if it hasn't or if it was already connected */ - @Override - public boolean connect(TerminalExt terminal) { + boolean connect(TerminalExt terminal) { // Only keep the closed non-fictional breakers in the nominal case return connect(terminal, SwitchPredicates.IS_NONFICTIONAL_BREAKER); } @@ -1224,7 +1222,7 @@ boolean getConnectingSwitches(Terminal terminal, Predicate i // find all paths starting from the current terminal to a busbar section that does not contain an open switch // that is not of the type of switch the user wants to operate // Paths are already sorted by the number of open switches and by the size of the paths - List paths = graph.findAllPaths(node, NodeBreakerVoltageLevel::isBusbarSection, sw -> checkNonClosableSwitch(sw, isSwitchOperable), + List paths = graph.findAllPaths(node, NodeBreakerTopologyModel::isBusbarSection, sw -> checkNonClosableSwitch(sw, isSwitchOperable), Comparator.comparing((TIntArrayList o) -> o.grep(idx -> SwitchPredicates.IS_OPEN.test(graph.getEdgeObject(idx))).size()) .thenComparing(TIntArrayList::size)); if (!paths.isEmpty()) { @@ -1245,8 +1243,7 @@ boolean getConnectingSwitches(Terminal terminal, Predicate i return false; } - @Override - public boolean disconnect(TerminalExt terminal) { + boolean disconnect(TerminalExt terminal) { // Only keep the closed non-fictional breakers in the nominal case return disconnect(terminal, SwitchPredicates.IS_CLOSED_BREAKER); } @@ -1280,7 +1277,7 @@ boolean getDisconnectingSwitches(Terminal terminal, Predicate paths = graph.findAllPaths(node, NodeBreakerVoltageLevel::isBusbarSection, SwitchPredicates.IS_OPEN); + List paths = graph.findAllPaths(node, NodeBreakerTopologyModel::isBusbarSection, SwitchPredicates.IS_OPEN); if (paths.isEmpty()) { return false; } @@ -1385,25 +1382,21 @@ private static TraverseResult getTraverseResult(Set visitedTerminals, @Override public void extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex) { - super.extendVariantArraySize(initVariantArraySize, number, sourceIndex); variants.push(number, VariantImpl::new); } @Override public void reduceVariantArraySize(int number) { - super.reduceVariantArraySize(number); variants.pop(number); } @Override public void deleteVariantArrayElement(int index) { - super.deleteVariantArrayElement(index); variants.delete(index); } @Override public void allocateVariantArrayElement(int[] indexes, final int sourceIndex) { - super.allocateVariantArrayElement(indexes, sourceIndex); variants.allocate(indexes, VariantImpl::new); } @@ -1424,7 +1417,7 @@ public void printTopology() { @Override public void printTopology(PrintStream out, ShortIdDictionary dict) { out.println("-------------------------------------------------------------"); - out.println("Topology of " + NodeBreakerVoltageLevel.this.id); + out.println("Topology of " + voltageLevel.getId()); graph.print(out, terminal -> terminal != null ? terminal.getConnectable().toString() : null, null); } diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeTerminal.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeTerminal.java index 31fe6f1d27b..e1acd93912c 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeTerminal.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/NodeTerminal.java @@ -57,6 +57,10 @@ public void moveConnectable(int node, String voltageLevelId) { } }; + private NodeBreakerTopologyModel getTopologyModel() { + return (NodeBreakerTopologyModel) voltageLevel.getTopologyModel(); + } + private final BusBreakerViewExt busBreakerView = new BusBreakerViewExt() { @Override @@ -64,7 +68,7 @@ public BusExt getBus() { if (removed) { throw new PowsyblException(CANNOT_ACCESS_BUS_REMOVED_EQUIPMENT + connectable.id); } - return ((NodeBreakerVoltageLevel) voltageLevel).getCalculatedBusBreakerTopology().getBus(node); + return getTopologyModel().getCalculatedBusBreakerTopology().getBus(node); } @Override @@ -72,12 +76,12 @@ public BusExt getConnectableBus() { if (removed) { throw new PowsyblException(CANNOT_ACCESS_BUS_REMOVED_EQUIPMENT + connectable.id); } - return ((NodeBreakerVoltageLevel) voltageLevel).getCalculatedBusBreakerTopology().getConnectableBus(node); + return getTopologyModel().getCalculatedBusBreakerTopology().getConnectableBus(node); } @Override public void setConnectableBus(String busId) { - throw NodeBreakerVoltageLevel.createNotSupportedNodeBreakerTopologyException(); + throw NodeBreakerTopologyModel.createNotSupportedNodeBreakerTopologyException(); } @Override @@ -102,7 +106,7 @@ public BusExt getBus() { if (removed) { throw new PowsyblException(CANNOT_ACCESS_BUS_REMOVED_EQUIPMENT + connectable.id); } - return ((NodeBreakerVoltageLevel) voltageLevel).getCalculatedBusTopology().getBus(node); + return getTopologyModel().getCalculatedBusTopology().getBus(node); } @Override @@ -110,7 +114,7 @@ public BusExt getConnectableBus() { if (removed) { throw new PowsyblException(CANNOT_ACCESS_BUS_REMOVED_EQUIPMENT + connectable.id); } - return ((NodeBreakerVoltageLevel) voltageLevel).getCalculatedBusTopology().getConnectableBus(node); + return getTopologyModel().getCalculatedBusTopology().getConnectableBus(node); } }; @@ -231,7 +235,7 @@ public boolean isConnected() { if (removed) { throw new PowsyblException("Cannot access connectivity status of removed equipment " + connectable.id); } - return ((NodeBreakerVoltageLevel) voltageLevel).isConnected(this); + return getTopologyModel().isConnected(this); } @Override @@ -239,7 +243,7 @@ public boolean traverse(TopologyTraverser traverser, Set visitedTermin if (removed) { throw new PowsyblException(String.format("Associated equipment %s is removed", connectable.id)); } - return ((NodeBreakerVoltageLevel) voltageLevel).traverse(this, traverser, visitedTerminals, traversalType); + return getTopologyModel().traverse(this, traverser, visitedTerminals, traversalType); } @Override @@ -252,7 +256,7 @@ public void traverse(TopologyTraverser traverser, TraversalType traversalType) { if (removed) { throw new PowsyblException(String.format("Associated equipment %s is removed", connectable.id)); } - ((NodeBreakerVoltageLevel) voltageLevel).traverse(this, traverser, traversalType); + getTopologyModel().traverse(this, traverser, traversalType); } @Override diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ShuntCompensatorAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ShuntCompensatorAdderImpl.java index 5802e57907d..a83a21c13c4 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ShuntCompensatorAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ShuntCompensatorAdderImpl.java @@ -225,7 +225,7 @@ id, getName(), isFictitious(), modelBuilder.build(), sectionCount, voltageRegulatorOn, targetV, targetDeadband); shunt.addTerminal(terminal); - voltageLevel.attach(terminal, false); + voltageLevel.getTopologyModel().attach(terminal, false); network.getIndex().checkAndAdd(shunt); network.getListeners().notifyCreation(shunt); return shunt; diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/StaticVarCompensatorAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/StaticVarCompensatorAdderImpl.java index 1952e3e1c8b..af6a95bbb75 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/StaticVarCompensatorAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/StaticVarCompensatorAdderImpl.java @@ -91,7 +91,7 @@ public StaticVarCompensatorImpl add() { regulationMode, regulatingTerminal != null ? regulatingTerminal : terminal, getNetworkRef()); svc.addTerminal(terminal); - voltageLevel.attach(terminal, false); + voltageLevel.getTopologyModel().attach(terminal, false); network.getIndex().checkAndAdd(svc); network.getListeners().notifyCreation(svc); return svc; diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/SubstationImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/SubstationImpl.java index 1be352b22aa..d8348f9b21c 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/SubstationImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/SubstationImpl.java @@ -203,8 +203,9 @@ public Substation addGeographicalTag(String tag) { if (tag == null) { throw new ValidationException(this, "geographical tag is null"); } + Set oldGeographicalTags = new LinkedHashSet<>(geographicalTags); if (geographicalTags.add(tag)) { - getNetwork().getListeners().notifyElementAdded(this, "geographicalTags", tag); + getNetwork().getListeners().notifyUpdate(this, "geographicalTags", oldGeographicalTags, geographicalTags); } return this; } diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/SwitchImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/SwitchImpl.java index f66a27304dc..144f9fde0c3 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/SwitchImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/SwitchImpl.java @@ -70,7 +70,7 @@ public void setOpen(boolean open) { boolean oldValue = this.open.get(index); if (oldValue != open) { this.open.set(index, open); - voltageLevel.invalidateCache(isRetained()); + voltageLevel.getTopologyModel().invalidateCache(isRetained()); String variantId = network.getVariantManager().getVariantId(index); network.getListeners().notifyUpdate(this, "open", variantId, oldValue, open); } @@ -91,7 +91,7 @@ public void setRetained(boolean retained) { boolean oldValue = this.retained.get(index); if (oldValue != retained) { this.retained.set(index, retained); - voltageLevel.invalidateCache(); + voltageLevel.getTopologyModel().invalidateCache(); String variantId = network.getVariantManager().getVariantId(index); network.getListeners().notifyUpdate(this, "retained", variantId, oldValue, retained); } @@ -102,7 +102,7 @@ public void setFictitious(boolean fictitious) { boolean oldValue = this.fictitious; if (oldValue != fictitious) { this.fictitious = fictitious; - voltageLevel.invalidateCache(); + voltageLevel.getTopologyModel().invalidateCache(); NetworkImpl network = getNetwork(); network.getListeners().notifyUpdate(this, "fictitious", oldValue, fictitious); } diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ThreeWindingsTransformerAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ThreeWindingsTransformerAdderImpl.java index c426ceaa21a..aa556962e45 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ThreeWindingsTransformerAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/ThreeWindingsTransformerAdderImpl.java @@ -291,14 +291,14 @@ public ThreeWindingsTransformerImpl add() { // check that the 3 windings transformer is attachable on the 3 sides (only // verify) - voltageLevel1.attach(terminal1, true); - voltageLevel2.attach(terminal2, true); - voltageLevel3.attach(terminal3, true); + voltageLevel1.getTopologyModel().attach(terminal1, true); + voltageLevel2.getTopologyModel().attach(terminal2, true); + voltageLevel3.getTopologyModel().attach(terminal3, true); // do attach - voltageLevel1.attach(terminal1, false); - voltageLevel2.attach(terminal2, false); - voltageLevel3.attach(terminal3, false); + voltageLevel1.getTopologyModel().attach(terminal1, false); + voltageLevel2.getTopologyModel().attach(terminal2, false); + voltageLevel3.getTopologyModel().attach(terminal3, false); getNetwork().getIndex().checkAndAdd(transformer); getNetwork().getListeners().notifyCreation(transformer); diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TopologyModel.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TopologyModel.java new file mode 100644 index 00000000000..6914887600e --- /dev/null +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TopologyModel.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2024, 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.iidm.network.impl; + +import java.util.function.Predicate; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +interface TopologyModel { + + void invalidateCache(boolean exceptBusBreakerView); + + void invalidateCache(); + + void attach(TerminalExt terminal, boolean test); + + void detach(TerminalExt terminal); + + boolean connect(TerminalExt terminal, Predicate isTypeSwitchToOperate); + + boolean disconnect(TerminalExt terminal, Predicate isSwitchOpenable); +} diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TwoWindingsTransformerAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TwoWindingsTransformerAdderImpl.java index e9835ac7c06..bf553f4889c 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TwoWindingsTransformerAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/TwoWindingsTransformerAdderImpl.java @@ -124,11 +124,11 @@ public TwoWindingsTransformer add() { transformer.addTerminal(terminal2); // check that the two windings transformer is attachable on both side - voltageLevel1.attach(terminal1, true); - voltageLevel2.attach(terminal2, true); + voltageLevel1.getTopologyModel().attach(terminal1, true); + voltageLevel2.getTopologyModel().attach(terminal2, true); - voltageLevel1.attach(terminal1, false); - voltageLevel2.attach(terminal2, false); + voltageLevel1.getTopologyModel().attach(terminal1, false); + voltageLevel2.getTopologyModel().attach(terminal2, false); getNetwork().getIndex().checkAndAdd(transformer); getNetwork().getListeners().notifyCreation(transformer); return transformer; diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelAdderImpl.java index 3d8130a7b63..bff9f8ddab7 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelAdderImpl.java @@ -94,12 +94,7 @@ public VoltageLevel add() { ValidationUtil.checkVoltageLimits(this, lowVoltageLimit, highVoltageLimit); ValidationUtil.checkTopologyKind(this, topologyKind); - VoltageLevelExt voltageLevel = switch (topologyKind) { - case NODE_BREAKER -> - new NodeBreakerVoltageLevel(id, getName(), isFictitious(), substation, networkRef, subnetworkRef, nominalV, lowVoltageLimit, highVoltageLimit); - case BUS_BREAKER -> - new BusBreakerVoltageLevel(id, getName(), isFictitious(), substation, networkRef, subnetworkRef, nominalV, lowVoltageLimit, highVoltageLimit); - }; + VoltageLevelExt voltageLevel = new VoltageLevelImpl(id, getName(), isFictitious(), substation, networkRef, subnetworkRef, nominalV, lowVoltageLimit, highVoltageLimit, topologyKind); getNetwork().getIndex().checkAndAdd(voltageLevel); Optional.ofNullable(substation).ifPresent(s -> s.addVoltageLevel(voltageLevel)); getNetwork().getListeners().notifyCreation(voltageLevel); diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelExt.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelExt.java index 7a465e87fb3..7c9d1636688 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelExt.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelExt.java @@ -7,16 +7,15 @@ */ package com.powsybl.iidm.network.impl; +import com.powsybl.iidm.network.Validable; import com.powsybl.iidm.network.VoltageLevel; import com.powsybl.commons.ref.Ref; -import java.util.function.Predicate; - /** * * @author Geoffroy Jamgotchian {@literal } */ -interface VoltageLevelExt extends VoltageLevel, MultiVariantObject { +interface VoltageLevelExt extends VoltageLevel, MultiVariantObject, Validable { interface NodeBreakerViewExt extends NodeBreakerView { @@ -45,29 +44,7 @@ interface BusViewExt extends BusView { @Override NetworkExt getParentNetwork(); - /** - * Attach an equipment to the topology. - */ - void attach(TerminalExt terminal, boolean test); - - /** - * Detach an equipment from the topology. - */ - void detach(TerminalExt terminal); - - boolean connect(TerminalExt terminal); - - boolean connect(TerminalExt terminal, Predicate isTypeSwitchToOperate); - - boolean disconnect(TerminalExt terminal); - - boolean disconnect(TerminalExt terminal, Predicate isSwitchOpenable); - - default void invalidateCache() { - invalidateCache(false); - } - - void invalidateCache(boolean exceptBusBreakerView); + TopologyModel getTopologyModel(); String getSubnetworkId(); diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractVoltageLevel.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelImpl.java similarity index 81% rename from iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractVoltageLevel.java rename to iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelImpl.java index d438ab56d18..7fc379bc153 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/AbstractVoltageLevel.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VoltageLevelImpl.java @@ -7,14 +7,17 @@ */ package com.powsybl.iidm.network.impl; -import com.google.common.collect.FluentIterable; import com.google.common.collect.Lists; import com.google.common.primitives.Ints; import com.powsybl.commons.PowsyblException; -import com.powsybl.commons.config.PlatformConfig; import com.powsybl.iidm.network.*; import com.powsybl.commons.ref.Ref; +import com.powsybl.iidm.network.util.ShortIdDictionary; +import java.io.IOException; +import java.io.PrintStream; +import java.io.Writer; +import java.nio.file.Path; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -23,14 +26,10 @@ * * @author Geoffroy Jamgotchian {@literal } */ -abstract class AbstractVoltageLevel extends AbstractIdentifiable implements VoltageLevelExt { - - private static final int DEFAULT_NODE_INDEX_LIMIT = 1000; - - public static final int NODE_INDEX_LIMIT = loadNodeIndexLimit(PlatformConfig.defaultConfig()); +class VoltageLevelImpl extends AbstractIdentifiable implements VoltageLevelExt { private final Ref networkRef; - private Ref subnetworkRef; + private final Ref subnetworkRef; private final SubstationImpl substation; @@ -40,13 +39,16 @@ abstract class AbstractVoltageLevel extends AbstractIdentifiable i private double highVoltageLimit; + private final AbstractTopologyModel topologyModel; + /** Areas associated to this VoltageLevel, with at most one area for each area type */ private final Set areas = new LinkedHashSet<>(); private boolean removed = false; - AbstractVoltageLevel(String id, String name, boolean fictitious, SubstationImpl substation, Ref networkRef, - Ref subnetworkRef, double nominalV, double lowVoltageLimit, double highVoltageLimit) { + VoltageLevelImpl(String id, String name, boolean fictitious, SubstationImpl substation, Ref networkRef, + Ref subnetworkRef, double nominalV, double lowVoltageLimit, double highVoltageLimit, + TopologyKind topologyKind) { super(id, name, fictitious); this.substation = substation; this.networkRef = networkRef; @@ -54,13 +56,15 @@ abstract class AbstractVoltageLevel extends AbstractIdentifiable i this.nominalV = nominalV; this.lowVoltageLimit = lowVoltageLimit; this.highVoltageLimit = highVoltageLimit; + this.topologyModel = switch (Objects.requireNonNull(topologyKind)) { + case NODE_BREAKER -> new NodeBreakerTopologyModel(this); + case BUS_BREAKER -> new BusBreakerTopologyModel(this); + }; } - protected static int loadNodeIndexLimit(PlatformConfig platformConfig) { - return platformConfig - .getOptionalModuleConfig("iidm") - .map(moduleConfig -> moduleConfig.getIntProperty("node-index-limit", DEFAULT_NODE_INDEX_LIMIT)) - .orElse(DEFAULT_NODE_INDEX_LIMIT); + @Override + public AbstractTopologyModel getTopologyModel() { + return topologyModel; } @Override @@ -157,6 +161,21 @@ public Substation getNullableSubstation() { return substation; } + @Override + public NodeBreakerViewExt getNodeBreakerView() { + return topologyModel.getNodeBreakerView(); + } + + @Override + public BusBreakerViewExt getBusBreakerView() { + return topologyModel.getBusBreakerView(); + } + + @Override + public BusViewExt getBusView() { + return topologyModel.getBusView(); + } + @Override public NetworkImpl getNetwork() { if (removed) { @@ -247,39 +266,27 @@ public T getConnectable(String id, Class aClass) { @Override public Iterable getConnectables(Class clazz) { - Iterable terminals = getTerminals(); - return FluentIterable.from(terminals) - .transform(Terminal::getConnectable) - .filter(clazz) - .toSet(); + return topologyModel.getConnectables(clazz); } @Override public Stream getConnectableStream(Class clazz) { - return getTerminalStream() - .map(Terminal::getConnectable) - .filter(clazz::isInstance) - .map(clazz::cast) - .distinct(); + return topologyModel.getConnectableStream(clazz); } @Override public int getConnectableCount(Class clazz) { - return Ints.checkedCast(getConnectableStream(clazz).count()); + return topologyModel.getConnectableCount(clazz); } @Override public Iterable getConnectables() { - return FluentIterable.from(getTerminals()) - .transform(Terminal::getConnectable) - .toSet(); + return topologyModel.getConnectables(); } @Override public Stream getConnectableStream() { - return getTerminalStream() - .map(Terminal::getConnectable) - .distinct(); + return topologyModel.getConnectableStream(); } @Override @@ -342,6 +349,16 @@ public Stream getLoadStream() { return getConnectableStream(Load.class); } + @Override + public Iterable getSwitches() { + return topologyModel.getSwitches(); + } + + @Override + public int getSwitchCount() { + return topologyModel.getSwitchCount(); + } + @Override public int getLoadCount() { return getConnectableCount(Load.class); @@ -517,41 +534,39 @@ protected String getTypeDescription() { return "Voltage level"; } - protected abstract Iterable getTerminals(); + @Override + public void visitEquipments(TopologyVisitor visitor) { + AbstractBus.visitEquipments(topologyModel.getTerminals(), visitor); + } - protected abstract Stream getTerminalStream(); + @Override + public TopologyKind getTopologyKind() { + return topologyModel.getTopologyKind(); + } @Override - public void visitEquipments(TopologyVisitor visitor) { - AbstractBus.visitEquipments(getTerminals(), visitor); - } - - protected static void addNextTerminals(TerminalExt otherTerminal, List nextTerminals) { - Objects.requireNonNull(otherTerminal); - Objects.requireNonNull(nextTerminals); - Connectable otherConnectable = otherTerminal.getConnectable(); - if (otherConnectable instanceof Branch branch) { - if (branch.getTerminal1() == otherTerminal) { - nextTerminals.add((TerminalExt) branch.getTerminal2()); - } else if (branch.getTerminal2() == otherTerminal) { - nextTerminals.add((TerminalExt) branch.getTerminal1()); - } else { - throw new IllegalStateException(); - } - } else if (otherConnectable instanceof ThreeWindingsTransformer ttc) { - if (ttc.getLeg1().getTerminal() == otherTerminal) { - nextTerminals.add((TerminalExt) ttc.getLeg2().getTerminal()); - nextTerminals.add((TerminalExt) ttc.getLeg3().getTerminal()); - } else if (ttc.getLeg2().getTerminal() == otherTerminal) { - nextTerminals.add((TerminalExt) ttc.getLeg1().getTerminal()); - nextTerminals.add((TerminalExt) ttc.getLeg3().getTerminal()); - } else if (ttc.getLeg3().getTerminal() == otherTerminal) { - nextTerminals.add((TerminalExt) ttc.getLeg1().getTerminal()); - nextTerminals.add((TerminalExt) ttc.getLeg2().getTerminal()); - } else { - throw new IllegalStateException(); - } - } + public void printTopology() { + topologyModel.printTopology(); + } + + @Override + public void printTopology(PrintStream out, ShortIdDictionary dict) { + topologyModel.printTopology(out, dict); + } + + @Override + public void exportTopology(Path file) throws IOException { + topologyModel.exportTopology(file); + } + + @Override + public void exportTopology(Writer writer, Random random) { + topologyModel.exportTopology(writer, random); + } + + @Override + public void exportTopology(Writer writer) { + topologyModel.exportTopology(writer); } @Override @@ -568,7 +583,7 @@ public void remove() { } // Remove the topology - removeTopology(); + topologyModel.removeTopology(); // Remove this voltage level from the areas getAreas().forEach(area -> area.removeVoltageLevel(this)); @@ -580,5 +595,27 @@ public void remove() { removed = true; } - protected abstract void removeTopology(); + @Override + public void extendVariantArraySize(int initVariantArraySize, int number, int sourceIndex) { + super.extendVariantArraySize(initVariantArraySize, number, sourceIndex); + topologyModel.extendVariantArraySize(initVariantArraySize, number, sourceIndex); + } + + @Override + public void reduceVariantArraySize(int number) { + super.reduceVariantArraySize(number); + topologyModel.reduceVariantArraySize(number); + } + + @Override + public void deleteVariantArrayElement(int index) { + super.deleteVariantArrayElement(index); + topologyModel.deleteVariantArrayElement(index); + } + + @Override + public void allocateVariantArrayElement(int[] indexes, int sourceIndex) { + super.allocateVariantArrayElement(indexes, sourceIndex); + topologyModel.allocateVariantArrayElement(indexes, sourceIndex); + } } diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VscConverterStationAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VscConverterStationAdderImpl.java index ced37052959..3c361ab1cdf 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VscConverterStationAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/VscConverterStationAdderImpl.java @@ -73,7 +73,7 @@ public VscConverterStationImpl add() { = new VscConverterStationImpl(id, name, isFictitious(), getLossFactor(), getNetworkRef(), voltageRegulatorOn, reactivePowerSetpoint, voltageSetpoint, regulatingTerminal == null ? terminal : regulatingTerminal); converterStation.addTerminal(terminal); - getVoltageLevel().attach(terminal, false); + getVoltageLevel().getTopologyModel().attach(terminal, false); network.getIndex().checkAndAdd(converterStation); network.getListeners().notifyCreation(converterStation); return converterStation; diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ActivePowerControlAdderImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ActivePowerControlAdderImpl.java index 59fdb4e1a21..f0618a9b5ea 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ActivePowerControlAdderImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ActivePowerControlAdderImpl.java @@ -7,13 +7,12 @@ */ package com.powsybl.iidm.network.impl.extensions; -import com.powsybl.commons.extensions.AbstractExtensionAdder; import com.powsybl.iidm.network.Injection; import com.powsybl.iidm.network.extensions.ActivePowerControl; import com.powsybl.iidm.network.extensions.ActivePowerControlAdder; public class ActivePowerControlAdderImpl> - extends AbstractExtensionAdder> + extends AbstractIidmExtensionAdder> implements ActivePowerControlAdder { private boolean participate; diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ActivePowerControlImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ActivePowerControlImpl.java index 22339d7ba18..18b46dbdee2 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ActivePowerControlImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ActivePowerControlImpl.java @@ -14,6 +14,7 @@ import com.powsybl.iidm.network.Injection; import com.powsybl.iidm.network.extensions.ActivePowerControl; import com.powsybl.iidm.network.impl.AbstractMultiVariantIdentifiableExtension; +import com.powsybl.iidm.network.impl.NetworkImpl; import gnu.trove.list.array.TDoubleArrayList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -122,7 +123,14 @@ public boolean isParticipate() { } public void setParticipate(boolean participate) { - this.participate.set(getVariantIndex(), participate); + int variantIndex = getVariantIndex(); + boolean oldParticipate = this.participate.get(variantIndex); + if (oldParticipate != participate) { + this.participate.set(variantIndex, participate); + NetworkImpl network = (NetworkImpl) getExtendable().getNetwork(); + String variantId = getVariantManagerHolder().getVariantManager().getWorkingVariantId(); + network.getListeners().notifyExtensionUpdate(this, "participate", variantId, oldParticipate, participate); + } } public double getDroop() { @@ -130,7 +138,14 @@ public double getDroop() { } public void setDroop(double droop) { - this.droop.set(getVariantIndex(), droop); + int variantIndex = getVariantIndex(); + double oldDroop = this.droop.get(variantIndex); + if (oldDroop != droop) { + this.droop.set(variantIndex, droop); + NetworkImpl network = (NetworkImpl) getExtendable().getNetwork(); + String variantId = getVariantManagerHolder().getVariantManager().getWorkingVariantId(); + network.getListeners().notifyExtensionUpdate(this, "droop", variantId, oldDroop, droop); + } } public double getParticipationFactor() { diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ControlUnitImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ControlUnitImpl.java index e6a36dd3b0f..828acf48666 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ControlUnitImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/ControlUnitImpl.java @@ -48,7 +48,7 @@ public void setParticipate(boolean participate) { this.participate = participate; SecondaryVoltageControlImpl secondaryVoltageControl = controlZone.getSecondaryVoltageControl(); NetworkImpl network = (NetworkImpl) secondaryVoltageControl.getExtendable(); - network.getListeners().notifyExtensionUpdate(secondaryVoltageControl, "controlUnitParticipate", + network.getListeners().notifyExtensionUpdate(secondaryVoltageControl, "controlUnitParticipate", null, new ParticipateEvent(controlZone.getName(), id, !this.participate), new ParticipateEvent(controlZone.getName(), id, this.participate)); } } diff --git a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/PilotPointImpl.java b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/PilotPointImpl.java index 21b04597fc3..4a8a5588420 100644 --- a/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/PilotPointImpl.java +++ b/iidm/iidm-impl/src/main/java/com/powsybl/iidm/network/impl/extensions/PilotPointImpl.java @@ -58,7 +58,7 @@ public void setTargetV(double targetV) { this.targetV = targetV; SecondaryVoltageControlImpl secondaryVoltageControl = controlZone.getSecondaryVoltageControl(); NetworkImpl network = (NetworkImpl) secondaryVoltageControl.getExtendable(); - network.getListeners().notifyExtensionUpdate(secondaryVoltageControl, "pilotPointTargetV", + network.getListeners().notifyExtensionUpdate(secondaryVoltageControl, "pilotPointTargetV", null, new TargetVoltageEvent(controlZone.getName(), oldTargetV), new TargetVoltageEvent(controlZone.getName(), targetV)); } } diff --git a/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/NodeBreakerConnectTest.java b/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/NodeBreakerConnectTest.java index ad1ec8a5db1..6be33d030ac 100644 --- a/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/NodeBreakerConnectTest.java +++ b/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/NodeBreakerConnectTest.java @@ -158,8 +158,8 @@ void testNodeBreakerConnectViaVoltageLevelConnectedLoad() { assertTrue(network.getSwitch("B2").isOpen()); if (l.getTerminal() instanceof TerminalExt terminal) { - NodeBreakerVoltageLevel voltageLevel = (NodeBreakerVoltageLevel) network.getVoltageLevel("VL"); - voltageLevel.connect(terminal); + NodeBreakerTopologyModel topologyModel = (NodeBreakerTopologyModel) ((VoltageLevelImpl) network.getVoltageLevel("VL")).getTopologyModel(); + topologyModel.connect(terminal); } assertTrue(network.getSwitch("B2").isOpen()); assertTrue(l.getTerminal().isConnected()); @@ -183,8 +183,8 @@ void testNodeBreakerDisconnectionDiamond() { Load l = network.getLoad("L"); assertTrue(l.getTerminal().isConnected()); if (l.getTerminal() instanceof TerminalExt terminal) { - NodeBreakerVoltageLevel voltageLevel = (NodeBreakerVoltageLevel) network.getVoltageLevel("VL"); - voltageLevel.disconnect(terminal); + NodeBreakerTopologyModel topologyModel = (NodeBreakerTopologyModel) ((VoltageLevelImpl) network.getVoltageLevel("VL")).getTopologyModel(); + topologyModel.disconnect(terminal); } assertFalse(l.getTerminal().isConnected()); } diff --git a/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/OperationalLimitsGroupImplTest.java b/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/OperationalLimitsGroupImplTest.java index 77461eaac64..a5870d7e7a5 100644 --- a/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/OperationalLimitsGroupImplTest.java +++ b/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/OperationalLimitsGroupImplTest.java @@ -28,7 +28,7 @@ void customOperationalLimitsGroupTest() { boolean[] updated = new boolean[1]; network.addListener(new DefaultNetworkListener() { @Override - public void onUpdate(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { + public void onUpdate(Identifiable identifiable, String attribute, String variantId, Object oldValue, Object newValue) { assertEquals("NHV1", identifiable.getId()); assertEquals("limits_CURRENT", attribute); assertNull(((OperationalLimitsGroupImpl.OperationalLimitsInfo) oldValue).value()); diff --git a/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/TestAbstractVoltageLevel.java b/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/TestAbstractTopologyModel.java similarity index 80% rename from iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/TestAbstractVoltageLevel.java rename to iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/TestAbstractTopologyModel.java index 224cb563ff4..fd35ac2a281 100644 --- a/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/TestAbstractVoltageLevel.java +++ b/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/TestAbstractTopologyModel.java @@ -22,12 +22,12 @@ /** * @author Lucas Leblow {@literal } */ -class TestAbstractVoltageLevel { +class TestAbstractTopologyModel { @Test void testLoadNodeIndexLimit() throws IOException { - assertEquals(1000, AbstractVoltageLevel.NODE_INDEX_LIMIT); - assertEquals(1000, AbstractVoltageLevel.loadNodeIndexLimit(PlatformConfig.defaultConfig())); + assertEquals(1000, AbstractTopologyModel.NODE_INDEX_LIMIT); + assertEquals(1000, AbstractTopologyModel.loadNodeIndexLimit(PlatformConfig.defaultConfig())); try (FileSystem fileSystem = Jimfs.newFileSystem(Configuration.unix())) { @@ -35,7 +35,7 @@ void testLoadNodeIndexLimit() throws IOException { MapModuleConfig moduleConfig = platformConfig.createModuleConfig("iidm"); moduleConfig.setStringProperty("node-index-limit", "5"); - assertEquals(5, AbstractVoltageLevel.loadNodeIndexLimit(platformConfig)); + assertEquals(5, AbstractTopologyModel.loadNodeIndexLimit(platformConfig)); } } } diff --git a/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/tck/NetworkEventTest.java b/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/tck/NetworkEventTest.java new file mode 100644 index 00000000000..9d1ef809712 --- /dev/null +++ b/iidm/iidm-impl/src/test/java/com/powsybl/iidm/network/impl/tck/NetworkEventTest.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2024, 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.iidm.network.impl.tck; + +import com.powsybl.iidm.network.tck.AbstractNetworkEventTest; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public class NetworkEventTest extends AbstractNetworkEventTest { +} diff --git a/iidm/iidm-modification/src/main/java/com/powsybl/iidm/modification/scalable/ProportionalScalable.java b/iidm/iidm-modification/src/main/java/com/powsybl/iidm/modification/scalable/ProportionalScalable.java index 1bcf3f975ee..51219254fbc 100644 --- a/iidm/iidm-modification/src/main/java/com/powsybl/iidm/modification/scalable/ProportionalScalable.java +++ b/iidm/iidm-modification/src/main/java/com/powsybl/iidm/modification/scalable/ProportionalScalable.java @@ -256,9 +256,23 @@ private double scaleIteration(Network n, double asked, ScalingParameters paramet for (ScalablePercentage scalablePercentage : scalablePercentageList) { Scalable s = scalablePercentage.getScalable(); double iterationPercentage = scalablePercentage.getIterationPercentage(); + if (iterationPercentage == 0.0) { + // no need to go further + continue; + } double askedOnScalable = iterationPercentage / 100 * asked; double doneOnScalable = s.scale(n, askedOnScalable, parameters); - if (Math.abs(doneOnScalable - askedOnScalable) > EPSILON) { + + // check if scalable reached limit + double scalableMin = s.minimumValue(n, parameters.getScalingConvention()); + double scalableMax = s.maximumValue(n, parameters.getScalingConvention()); + double scalableP = s.getSteadyStatePower(n, asked, parameters.getScalingConvention()); + boolean saturated = asked > 0 ? + Math.abs(scalableMax - scalableP) < EPSILON / 100 : + Math.abs(scalableMin - scalableP) < EPSILON / 100; + if (doneOnScalable == 0 || saturated) { + // If didn't move now (tested by a perfect zero equality), it won't move in subsequent iterations for sure. + // If reached saturation, can exclude right now to avoid earlier another iteration. scalablePercentage.setIterationPercentage(0); } done += doneOnScalable; diff --git a/iidm/iidm-modification/src/test/java/com/powsybl/iidm/modification/scalable/ProportionalScalableTest.java b/iidm/iidm-modification/src/test/java/com/powsybl/iidm/modification/scalable/ProportionalScalableTest.java index 5c83d0f4dff..701f7d94941 100644 --- a/iidm/iidm-modification/src/test/java/com/powsybl/iidm/modification/scalable/ProportionalScalableTest.java +++ b/iidm/iidm-modification/src/test/java/com/powsybl/iidm/modification/scalable/ProportionalScalableTest.java @@ -691,4 +691,87 @@ void testDisableInjections() { assertEquals(50.0, network.getDanglingLine("dl1").getP0(), 1e-5); reset(); } + + @Test + void testSmallPercentageAndAskingEpsilonMoreThanAvailable() { + Load load1 = network.getLoad("l1"); + Load load2 = network.getLoad("l2"); + load1.setP0(100. - 1e-5); + load2.setP0(1e-5); + ProportionalScalable proportionalScalable = Scalable.proportional(List.of(load1, load2), PROPORTIONAL_TO_P0); + double volumeAsked = -100. - 0.01; // only -100 can be achieved due to load scalable 0 MW min limit + ScalingParameters scalingParametersProportional = new ScalingParameters(Scalable.ScalingConvention.LOAD, + true, false, RESPECT_OF_VOLUME_ASKED, true, DELTA_P); + double variationDone = proportionalScalable.scale(network, volumeAsked, scalingParametersProportional); + assertEquals(-100., variationDone, 1e-5); + assertEquals(0.0, load1.getP0()); // a perfect 0. + assertEquals(0.0, load2.getP0()); // a perfect 0. + } + + @Test + void testSmallPercentageOnDiscardedScalable() { + Load load1 = network.getLoad("l1"); + Load load2 = network.getLoad("l2"); + Load load3 = network.getLoad("l3"); + load1.setP0(100.); + load2.setP0(100.); + load3.setP0(100.); + Scalable scalable1 = Scalable.onLoad(load1.getId()); + Scalable scalable2 = Scalable.onLoad(load2.getId()); + Scalable scalable3 = Scalable.onLoad(load3.getId()); + ProportionalScalable proportionalScalable = Scalable.proportional(List.of(100 - 2e-5, 1e-5, 1e-5), List.of(scalable1, scalable2, scalable3)); + ScalingParameters scalingParametersProportional = new ScalingParameters(Scalable.ScalingConvention.LOAD, + true, false, RESPECT_OF_VOLUME_ASKED, true, DELTA_P); + scalingParametersProportional.setIgnoredInjectionIds(Set.of("l2", "l3")); + double volumeAsked = -100.15; // 100 MW should be done by load1 alone and nothing by ignored load2 and load3 + double variationDone = proportionalScalable.scale(network, volumeAsked, scalingParametersProportional); + assertEquals(-100., variationDone, 1e-5); + assertEquals(0.0, load1.getP0()); // a perfect 0. + assertEquals(100.0, load2.getP0()); // load 2 should not move + assertEquals(100.0, load3.getP0()); // load 3 should not move + } + + @Test + void testSmallPercentageReNormalized() { + Load load1 = network.getLoad("l1"); + Load load2 = network.getLoad("l2"); + Load load3 = network.getLoad("l3"); + load1.setP0(100.); + load2.setP0(100.); + load3.setP0(100.); + Scalable scalable1 = Scalable.onLoad(load1.getId(), 99., Double.MAX_VALUE); + Scalable scalable2 = Scalable.onLoad(load2.getId()); + Scalable scalable3 = Scalable.onLoad(load3.getId()); + ProportionalScalable proportionalScalable = Scalable.proportional(List.of(100 - 2e-5, 1e-5, 1e-5), List.of(scalable1, scalable2, scalable3)); + double volumeAsked = -100; + ScalingParameters scalingParametersProportional = new ScalingParameters(Scalable.ScalingConvention.LOAD, + true, false, RESPECT_OF_VOLUME_ASKED, true, DELTA_P); + double variationDone = proportionalScalable.scale(network, volumeAsked, scalingParametersProportional); + assertEquals(-100., variationDone, 1e-5); + assertEquals(99.0, load1.getP0(), 1e-5); // at limit + assertEquals(50.5, load2.getP0()); + assertEquals(50.5, load3.getP0()); + } + + @Test + void testSmallPercentageReNormalized2() { + Load load1 = network.getLoad("l1"); + Load load2 = network.getLoad("l2"); + Load load3 = network.getLoad("l3"); + load1.setP0(0.); + load2.setP0(100.); + load3.setP0(100.); + Scalable scalable1 = Scalable.onLoad(load1.getId(), 99., Double.MAX_VALUE); + Scalable scalable2 = Scalable.onLoad(load2.getId()); + Scalable scalable3 = Scalable.onLoad(load3.getId()); + ProportionalScalable proportionalScalable = Scalable.proportional(List.of(100 - 2e-5, 1e-5, 1e-5), List.of(scalable1, scalable2, scalable3)); + double volumeAsked = -100; + ScalingParameters scalingParametersProportional = new ScalingParameters(Scalable.ScalingConvention.LOAD, + true, false, RESPECT_OF_VOLUME_ASKED, true, DELTA_P); + double variationDone = proportionalScalable.scale(network, volumeAsked, scalingParametersProportional); + assertEquals(-100., variationDone, 1e-5); + assertEquals(0.0, load1.getP0()); + assertEquals(50., load2.getP0()); + assertEquals(50., load3.getP0()); + } } diff --git a/iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/OverloadManagementSystemSerDe.java b/iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/OverloadManagementSystemSerDe.java index c0daff70056..0b3310ac8ce 100644 --- a/iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/OverloadManagementSystemSerDe.java +++ b/iidm/iidm-serde/src/main/java/com/powsybl/iidm/serde/OverloadManagementSystemSerDe.java @@ -83,6 +83,8 @@ private void writeTrippingCommonAttributes(OverloadManagementSystem.Tripping tri String nameOrKey = tripping.getNameOrKey(); if (nameOrKey != null && !nameOrKey.equals(tripping.getKey())) { context.getWriter().writeStringAttribute("name", nameOrKey); + } else { + context.getWriter().writeStringAttribute("name", null); } context.getWriter().writeDoubleAttribute("currentLimit", tripping.getCurrentLimit()); context.getWriter().writeBooleanAttribute("openAction", tripping.isOpenAction()); diff --git a/iidm/iidm-serde/src/test/java/com/powsybl/iidm/serde/OverloadManagementSystemSerDeTest.java b/iidm/iidm-serde/src/test/java/com/powsybl/iidm/serde/OverloadManagementSystemSerDeTest.java index 325cfff4321..eef92de0751 100644 --- a/iidm/iidm-serde/src/test/java/com/powsybl/iidm/serde/OverloadManagementSystemSerDeTest.java +++ b/iidm/iidm-serde/src/test/java/com/powsybl/iidm/serde/OverloadManagementSystemSerDeTest.java @@ -216,6 +216,12 @@ private static Network createNetwork() { .setOpenAction(true) .setSwitchToOperateId("S1_400_LINE_2_BREAKER") .add() + .newSwitchTripping() + .setKey("trippingWithNoName") + .setCurrentLimit(800) + .setOpenAction(true) + .setSwitchToOperateId("S1_400_LINE_2_BREAKER") + .add() .add(); // Create an overload management system monitoring "LINE_1" with a tripping on "LINE_2". diff --git a/iidm/iidm-serde/src/test/resources/V1_13/overloadManagementSystemRoundTripRef.xml b/iidm/iidm-serde/src/test/resources/V1_13/overloadManagementSystemRoundTripRef.xml index e3fa457c5c2..f347392486a 100644 --- a/iidm/iidm-serde/src/test/resources/V1_13/overloadManagementSystemRoundTripRef.xml +++ b/iidm/iidm-serde/src/test/resources/V1_13/overloadManagementSystemRoundTripRef.xml @@ -36,6 +36,7 @@ + diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractConnectionNotificationTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractConnectionNotificationTest.java index 2c0dc1a2292..9b7c1937d45 100644 --- a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractConnectionNotificationTest.java +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractConnectionNotificationTest.java @@ -7,14 +7,12 @@ */ package com.powsybl.iidm.network.tck; -import com.powsybl.iidm.network.DefaultNetworkListener; -import com.powsybl.iidm.network.Identifiable; -import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.NetworkEventRecorder; +import com.powsybl.iidm.network.events.UpdateNetworkEvent; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import com.powsybl.iidm.network.test.FourSubstationsNodeBreakerFactory; import org.junit.jupiter.api.Test; -import java.util.ArrayList; import java.util.List; import static org.junit.jupiter.api.Assertions.*; @@ -24,107 +22,79 @@ */ public abstract class AbstractConnectionNotificationTest { - record Event(String id, String attribute, String variantId, Object oldValue, Object newValue) { - } - - static class EventsRecorder extends DefaultNetworkListener { - - private final List events = new ArrayList<>(); - - public EventsRecorder(Network network) { - network.addListener(this); - } - - @Override - public void onUpdate(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { - events.add(new Event(identifiable.getId(), attribute, null, oldValue, newValue)); - } - - @Override - public void onUpdate(Identifiable identifiable, String attribute, String variantId, Object oldValue, Object newValue) { - events.add(new Event(identifiable.getId(), attribute, variantId, oldValue, newValue)); - } - - List getEvents() { - return events; - } - - void clear() { - events.clear(); - } - } - @Test public void busBreakerTest() { var network = EurostagTutorialExample1Factory.create(); - EventsRecorder eventsRecorder = new EventsRecorder(network); + NetworkEventRecorder eventRecorder = new NetworkEventRecorder(); + network.addListener(eventRecorder); var l1 = network.getLine("NHV1_NHV2_1"); assertTrue(l1.getTerminal1().disconnect()); assertEquals(List.of( - new Event("NHV1_NHV2_1", "beginDisconnect", "InitialState", false, null), - new Event("NHV1_NHV2_1", "connected1", "InitialState", true, false), - new Event("NHV1_NHV2_1", "endDisconnect", "InitialState", null, true)), - eventsRecorder.getEvents()); + new UpdateNetworkEvent("NHV1_NHV2_1", "beginDisconnect", "InitialState", false, null), + new UpdateNetworkEvent("NHV1_NHV2_1", "connected1", "InitialState", true, false), + new UpdateNetworkEvent("NHV1_NHV2_1", "endDisconnect", "InitialState", null, true)), + eventRecorder.getEvents()); // try with an already disconnected terminal - eventsRecorder.clear(); + eventRecorder.reset(); assertFalse(l1.getTerminal1().disconnect()); assertEquals(List.of( - new Event("NHV1_NHV2_1", "beginDisconnect", "InitialState", true, null), - new Event("NHV1_NHV2_1", "endDisconnect", "InitialState", null, true)), - eventsRecorder.getEvents()); + new UpdateNetworkEvent("NHV1_NHV2_1", "beginDisconnect", "InitialState", true, null), + new UpdateNetworkEvent("NHV1_NHV2_1", "endDisconnect", "InitialState", null, true)), + eventRecorder.getEvents()); - eventsRecorder.clear(); + eventRecorder.reset(); assertTrue(l1.getTerminal1().connect()); assertEquals(List.of( - new Event("NHV1_NHV2_1", "beginConnect", "InitialState", false, null), - new Event("NHV1_NHV2_1", "connected1", "InitialState", false, true), - new Event("NHV1_NHV2_1", "endConnect", "InitialState", null, true)), - eventsRecorder.getEvents()); + new UpdateNetworkEvent("NHV1_NHV2_1", "beginConnect", "InitialState", false, null), + new UpdateNetworkEvent("NHV1_NHV2_1", "connected1", "InitialState", false, true), + new UpdateNetworkEvent("NHV1_NHV2_1", "endConnect", "InitialState", null, true)), + eventRecorder.getEvents()); // try with an already connected terminal - eventsRecorder.clear(); + eventRecorder.reset(); assertFalse(l1.getTerminal1().connect()); // no action has been done assertEquals(List.of( - new Event("NHV1_NHV2_1", "beginConnect", "InitialState", true, null), - new Event("NHV1_NHV2_1", "endConnect", "InitialState", null, true)), - eventsRecorder.getEvents()); + new UpdateNetworkEvent("NHV1_NHV2_1", "beginConnect", "InitialState", true, null), + new UpdateNetworkEvent("NHV1_NHV2_1", "endConnect", "InitialState", null, true)), + eventRecorder.getEvents()); } @Test public void nodeBreakerTest() { var network = FourSubstationsNodeBreakerFactory.create(); - EventsRecorder eventsRecorder = new EventsRecorder(network); + NetworkEventRecorder eventRecorder = new NetworkEventRecorder(); + network.addListener(eventRecorder); var l1 = network.getLine("LINE_S2S3"); assertTrue(l1.getTerminal1().disconnect()); assertEquals(List.of( - new Event("LINE_S2S3", "beginDisconnect", "InitialState", false, null), - new Event("S2VL1_LINES2S3_BREAKER", "open", "InitialState", false, true), - new Event("LINE_S2S3", "endDisconnect", "InitialState", null, true)), - eventsRecorder.getEvents()); + new UpdateNetworkEvent("LINE_S2S3", "beginDisconnect", "InitialState", false, null), + new UpdateNetworkEvent("S2VL1_LINES2S3_BREAKER", "open", "InitialState", false, true), + new UpdateNetworkEvent("LINE_S2S3", "endDisconnect", "InitialState", null, true)), + eventRecorder.getEvents()); - eventsRecorder.clear(); + eventRecorder.reset(); assertFalse(l1.getTerminal1().disconnect()); assertEquals(List.of( - new Event("LINE_S2S3", "beginDisconnect", "InitialState", true, null), - new Event("LINE_S2S3", "endDisconnect", "InitialState", null, true)), - eventsRecorder.getEvents()); + new UpdateNetworkEvent("LINE_S2S3", "beginDisconnect", "InitialState", true, null), + new UpdateNetworkEvent("LINE_S2S3", "endDisconnect", "InitialState", null, true)), + eventRecorder.getEvents()); - eventsRecorder.clear(); + eventRecorder.reset(); assertTrue(l1.getTerminal1().connect()); assertEquals(List.of( - new Event("LINE_S2S3", "beginConnect", "InitialState", false, null), - new Event("S2VL1_LINES2S3_BREAKER", "open", "InitialState", true, false), - new Event("LINE_S2S3", "endConnect", "InitialState", null, true)), - eventsRecorder.getEvents()); + new UpdateNetworkEvent("LINE_S2S3", "beginConnect", "InitialState", false, null), + new UpdateNetworkEvent("S2VL1_LINES2S3_BREAKER", "open", "InitialState", true, false), + new UpdateNetworkEvent("LINE_S2S3", "endConnect", "InitialState", null, true)), + eventRecorder.getEvents()); - eventsRecorder.clear(); + eventRecorder.reset(); assertFalse(l1.getTerminal1().connect()); assertEquals(List.of( - new Event("LINE_S2S3", "beginConnect", "InitialState", true, null), - new Event("LINE_S2S3", "endConnect", "InitialState", null, true)), - eventsRecorder.getEvents()); + new UpdateNetworkEvent("LINE_S2S3", "beginConnect", "InitialState", true, null), + new UpdateNetworkEvent("LINE_S2S3", "endConnect", "InitialState", null, true)), + eventRecorder.getEvents()); } } diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractLineTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractLineTest.java index 1e9873332fa..ee02a53a38d 100644 --- a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractLineTest.java +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractLineTest.java @@ -329,9 +329,7 @@ public void testMove2Nb() { public void testChangesNotification() { // Changes listener NetworkListener exceptionListener = mock(DefaultNetworkListener.class); - doThrow(new UnsupportedOperationException()).when(exceptionListener).onUpdate(any(), anyString(), any(), any()); - doThrow(new UnsupportedOperationException()).when(exceptionListener).onUpdate(any(), any(), anyString(), any(), - any()); + doThrow(new UnsupportedOperationException()).when(exceptionListener).onUpdate(any(), anyString(), anyString(), any(), any()); NetworkListener mockedListener = mock(DefaultNetworkListener.class); // Add observer changes to current network @@ -369,12 +367,12 @@ public void testChangesNotification() { // Change values that not depend on the variant acLine.setR(1.5); - verify(mockedListener, times(1)).onUpdate(acLine, "r", 1.0, 1.5); + verify(mockedListener, times(1)).onUpdate(acLine, "r", null, 1.0, 1.5); // Simulate exception for onUpdate calls doThrow(new PowsyblException()) .when(mockedListener) - .onUpdate(any(Line.class), anyString(), anyDouble(), anyDouble()); + .onUpdate(any(Line.class), anyString(), anyString(), anyDouble(), anyDouble()); // Change P1 value try { acLine.getTerminal1().setP(1.1); diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractLoadTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractLoadTest.java index 810808a7e9b..ac48f2a2542 100644 --- a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractLoadTest.java +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractLoadTest.java @@ -307,7 +307,7 @@ public void setNameTest() { assertTrue(load.getOptionalName().isEmpty()); load.setName("FOO"); assertEquals("FOO", load.getOptionalName().orElseThrow()); - Mockito.verify(mockedListener, Mockito.times(1)).onUpdate(load, "name", null, "FOO"); + Mockito.verify(mockedListener, Mockito.times(1)).onUpdate(load, "name", null, null, "FOO"); } @Test diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractMoveConnectableNotifTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractMoveConnectableNotifTest.java index f365f9b4e8d..5d1546b98c4 100644 --- a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractMoveConnectableNotifTest.java +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractMoveConnectableNotifTest.java @@ -27,7 +27,7 @@ public void nodeBreakerTest() { MutableObject obj = new MutableObject<>(); network.addListener(new DefaultNetworkListener() { @Override - public void onUpdate(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { + public void onUpdate(Identifiable identifiable, String attribute, String variantId, Object oldValue, Object newValue) { obj.setValue(newValue); } }); @@ -47,7 +47,7 @@ public void busBreakerTest() { MutableObject obj = new MutableObject<>(); network.addListener(new DefaultNetworkListener() { @Override - public void onUpdate(Identifiable identifiable, String attribute, Object oldValue, Object newValue) { + public void onUpdate(Identifiable identifiable, String attribute, String variantId, Object oldValue, Object newValue) { obj.setValue(newValue); } }); diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractNetworkEventTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractNetworkEventTest.java new file mode 100644 index 00000000000..8a23147b6c3 --- /dev/null +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractNetworkEventTest.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) 2024, 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.iidm.network.tck; + +import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.NetworkEventRecorder; +import com.powsybl.iidm.network.VariantManagerConstants; +import com.powsybl.iidm.network.events.*; +import com.powsybl.iidm.network.extensions.ActivePowerControl; +import com.powsybl.iidm.network.extensions.ActivePowerControlAdder; +import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; +import org.junit.jupiter.api.Test; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * @author Geoffroy Jamgotchian {@literal } + */ +public abstract class AbstractNetworkEventTest { + + @Test + void testNotif() { + Network network = EurostagTutorialExample1Factory.create(); + NetworkEventRecorder eventRecorder = new NetworkEventRecorder(); + network.addListener(eventRecorder); + + var load2 = network.getVoltageLevel("VLLOAD").newLoad() + .setId("LOAD2") + .setBus("NLOAD") + .setP0(0) + .setQ0(0) + .add(); + assertEquals(List.of(new CreationNetworkEvent("LOAD2")), + eventRecorder.getEvents()); + + eventRecorder.reset(); + load2.setP0(0.1); + assertEquals(List.of(new UpdateNetworkEvent("LOAD2", "p0", "InitialState", 0.0, 0.1)), + eventRecorder.getEvents()); + + eventRecorder.reset(); + load2.remove(); + assertEquals(List.of(new RemovalNetworkEvent("LOAD2", false), + new RemovalNetworkEvent("LOAD2", true)), + eventRecorder.getEvents()); + + eventRecorder.reset(); + var gen = network.getGenerator("GEN"); + ActivePowerControl apc = (ActivePowerControl) gen.newExtension(ActivePowerControlAdder.class) + .withDroop(1) + .withParticipate(true) + .add(); + assertEquals(List.of(new ExtensionCreationNetworkEvent("GEN", "activePowerControl")), + eventRecorder.getEvents()); + + eventRecorder.reset(); + apc.setParticipate(false); + assertEquals(List.of(new ExtensionUpdateNetworkEvent("GEN", "activePowerControl", "participate", "InitialState", true, false)), + eventRecorder.getEvents()); + + eventRecorder.reset(); + gen.removeExtension(ActivePowerControl.class); + assertEquals(List.of(new ExtensionRemovalNetworkEvent("GEN", "activePowerControl", false), + new ExtensionRemovalNetworkEvent("GEN", "activePowerControl", true)), + eventRecorder.getEvents()); + + eventRecorder.reset(); + gen.setProperty("p1", "v1"); + assertEquals(List.of(new PropertiesUpdateNetworkEvent("GEN", "properties[p1]", PropertiesUpdateNetworkEvent.PropertyUpdateType.ADDED, null, "v1")), + eventRecorder.getEvents()); + + eventRecorder.reset(); + gen.setProperty("p1", "v2"); + assertEquals(List.of(new PropertiesUpdateNetworkEvent("GEN", "properties[p1]", PropertiesUpdateNetworkEvent.PropertyUpdateType.REPLACED, "v1", "v2")), + eventRecorder.getEvents()); + + eventRecorder.reset(); + gen.removeProperty("p1"); + assertEquals(List.of(new PropertiesUpdateNetworkEvent("GEN", "properties[p1]", PropertiesUpdateNetworkEvent.PropertyUpdateType.REMOVED, "v2", null)), + eventRecorder.getEvents()); + + eventRecorder.reset(); + network.getVariantManager().cloneVariant(VariantManagerConstants.INITIAL_VARIANT_ID, "new_variant"); + assertEquals(List.of(new VariantNetworkEvent("InitialState", "new_variant", VariantNetworkEvent.VariantEventType.CREATED)), + eventRecorder.getEvents()); + + eventRecorder.reset(); + network.getVariantManager().cloneVariant(VariantManagerConstants.INITIAL_VARIANT_ID, "new_variant", true); + assertEquals(List.of(new VariantNetworkEvent("InitialState", "new_variant", VariantNetworkEvent.VariantEventType.OVERWRITTEN)), + eventRecorder.getEvents()); + + eventRecorder.reset(); + network.getVariantManager().removeVariant("new_variant"); + assertEquals(List.of(new VariantNetworkEvent("new_variant", null, VariantNetworkEvent.VariantEventType.REMOVED)), + eventRecorder.getEvents()); + } +} diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractNetworkTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractNetworkTest.java index 95381cad32d..495c43a9fd9 100644 --- a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractNetworkTest.java +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractNetworkTest.java @@ -177,8 +177,8 @@ public void testNetwork1() { // Changes listener NetworkListener exceptionListener = mock(DefaultNetworkListener.class); - doThrow(new UnsupportedOperationException()).when(exceptionListener).onElementAdded(any(), anyString(), any()); - doThrow(new UnsupportedOperationException()).when(exceptionListener).onElementReplaced(any(), anyString(), + doThrow(new UnsupportedOperationException()).when(exceptionListener).onPropertyAdded(any(), anyString(), any()); + doThrow(new UnsupportedOperationException()).when(exceptionListener).onPropertyReplaced(any(), anyString(), any(), any()); NetworkListener mockedListener = mock(DefaultNetworkListener.class); @@ -206,12 +206,12 @@ public void testNetwork1() { // Check notification done verify(mockedListener, times(1)) - .onElementAdded(busCalc, "properties[" + key + "]", value); + .onPropertyAdded(busCalc, "properties[" + key + "]", value); // Check no notification on same property String value2 = "ValueTest2"; busCalc.setProperty(key, value2); verify(mockedListener, times(1)) - .onElementReplaced(busCalc, "properties[" + key + "]", value, value2); + .onPropertyReplaced(busCalc, "properties[" + key + "]", value, value2); // Check no notification on same property busCalc.setProperty(key, value2); verifyNoMoreInteractions(mockedListener); @@ -687,4 +687,20 @@ public void testPermanentLimitOnUnselectedOperationalLimitsGroup() { assertTrue(Double.isNaN(currentLimits.getPermanentLimit())); assertEquals(ValidationLevel.EQUIPMENT, network.getValidationLevel()); } + + @Test + void testSetMinimumAcceptableValidationLevelOnInvalidatedNetwork() { + Network network = Network.create("test", "iidm"); + network.setMinimumAcceptableValidationLevel(ValidationLevel.EQUIPMENT); + VoltageLevel vl = network.newSubstation().setId("s1").add() + .newVoltageLevel().setId("vl1").setNominalV(100).setTopologyKind(TopologyKind.NODE_BREAKER).add(); + Load l1 = vl.newLoad().setId("l1").setNode(0).add(); + assertEquals(ValidationLevel.EQUIPMENT, network.getValidationLevel()); + + l1.setP0(10.0); + l1.setQ0(1.0); + + network.setMinimumAcceptableValidationLevel(ValidationLevel.STEADY_STATE_HYPOTHESIS); + assertEquals(ValidationLevel.STEADY_STATE_HYPOTHESIS, network.getValidationLevel()); + } } diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractSubstationTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractSubstationTest.java index 15f6aa8ea9b..1f29fc50018 100644 --- a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractSubstationTest.java +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractSubstationTest.java @@ -58,7 +58,7 @@ public void baseTests() { // Create mocked network listeners NetworkListener exceptionListener = mock(DefaultNetworkListener.class); - doThrow(new UnsupportedOperationException()).when(exceptionListener).onElementAdded(any(), anyString(), any()); + doThrow(new UnsupportedOperationException()).when(exceptionListener).onUpdate(any(), anyString(), anyString(), any(), any()); NetworkListener mockedListener = mock(DefaultNetworkListener.class); // Test without listeners registered substation.addGeographicalTag("no listeners"); @@ -71,7 +71,7 @@ public void baseTests() { substation.addGeographicalTag("test"); // Check notification done verify(mockedListener, times(1)) - .onElementAdded(any(Substation.class), anyString(), anyString()); + .onUpdate(any(Substation.class), anyString(), isNull(), any(), any()); // Remove observer network.removeListener(mockedListener); diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractTapChangerTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractTapChangerTest.java index 29beeffd7a4..5f73b06b4c7 100644 --- a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractTapChangerTest.java +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractTapChangerTest.java @@ -164,7 +164,7 @@ public void baseTestsPhaseTapChanger() { currentStep.setB(5.0); currentStep.setAlpha(6.0); currentStep.setRho(7.0); - verify(mockedListener, times(6)).onUpdate(any(Identifiable.class), anyString(), any(), any()); + verify(mockedListener, times(6)).onUpdate(any(Identifiable.class), anyString(), nullable(String.class), any(), any()); // Remove observer network.removeListener(mockedListener); // Cancel modification diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractTieLineTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractTieLineTest.java index cd0abf8c776..25c0f440935 100644 --- a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractTieLineTest.java +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/AbstractTieLineTest.java @@ -139,7 +139,7 @@ public void testTieLineAdder() { danglingLine2.setX(x + 1); danglingLine2.setG(hl2g1 + hl1g2 + 2); danglingLine2.setB(hl2b1 + hl2b2 + 2); - verify(mockedListener, times(8)).onUpdate(any(DanglingLine.class), anyString(), any(), any()); + verify(mockedListener, times(8)).onUpdate(any(DanglingLine.class), anyString(), nullable(String.class), any(), any()); // Remove observer network.removeListener(mockedListener); // Cancel changes on dangling lines diff --git a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/extensions/AbstractSecondaryVoltageControlTest.java b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/extensions/AbstractSecondaryVoltageControlTest.java index 16fe38f65a3..ee5d8fa3ab4 100644 --- a/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/extensions/AbstractSecondaryVoltageControlTest.java +++ b/iidm/iidm-tck/src/test/java/com/powsybl/iidm/network/tck/extensions/AbstractSecondaryVoltageControlTest.java @@ -7,10 +7,11 @@ */ package com.powsybl.iidm.network.tck.extensions; -import com.powsybl.commons.extensions.Extension; -import com.powsybl.iidm.network.DefaultNetworkListener; -import com.powsybl.iidm.network.Identifiable; import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.NetworkEventRecorder; +import com.powsybl.iidm.network.events.ExtensionCreationNetworkEvent; +import com.powsybl.iidm.network.events.ExtensionRemovalNetworkEvent; +import com.powsybl.iidm.network.events.ExtensionUpdateNetworkEvent; import com.powsybl.iidm.network.extensions.*; import com.powsybl.iidm.network.test.EurostagTutorialExample1Factory; import org.junit.jupiter.api.BeforeEach; @@ -72,80 +73,38 @@ public void test() throws IOException { @Test public void pilotPointTargetVoltageNotificationTest() { - boolean[] updated = new boolean[1]; - network.addListener(new DefaultNetworkListener() { - @Override - public void onExtensionUpdate(Extension extendable, String attribute, Object oldValue, Object newValue) { - assertInstanceOf(SecondaryVoltageControl.class, extendable); - assertEquals("pilotPointTargetV", attribute); - assertEquals(new PilotPoint.TargetVoltageEvent("z1", 15d), oldValue); - assertEquals(new PilotPoint.TargetVoltageEvent("z1", 16d), newValue); - updated[0] = true; - } - }); + NetworkEventRecorder eventRecorder = new NetworkEventRecorder(); + network.addListener(eventRecorder); ControlZone controlZone = control.getControlZones().get(0); - assertFalse(updated[0]); controlZone.getPilotPoint().setTargetV(16); - assertTrue(updated[0]); + assertEquals(List.of(new ExtensionUpdateNetworkEvent("sim1", "secondaryVoltageControl", "pilotPointTargetV", null, + new PilotPoint.TargetVoltageEvent("z1", 15d), new PilotPoint.TargetVoltageEvent("z1", 16d))), + eventRecorder.getEvents()); } @Test public void controlUnitParticipateNotificationTest() { - boolean[] updated = new boolean[1]; - network.addListener(new DefaultNetworkListener() { - @Override - public void onExtensionUpdate(Extension extendable, String attribute, Object oldValue, Object newValue) { - assertInstanceOf(SecondaryVoltageControl.class, extendable); - assertEquals("controlUnitParticipate", attribute); - assertEquals(new ControlUnit.ParticipateEvent("z1", "GEN", false), oldValue); - assertEquals(new ControlUnit.ParticipateEvent("z1", "GEN", true), newValue); - updated[0] = true; - } - }); + NetworkEventRecorder eventRecorder = new NetworkEventRecorder(); + network.addListener(eventRecorder); ControlZone controlZone = control.getControlZones().get(0); ControlUnit controlUnit = controlZone.getControlUnits().get(0); - assertFalse(updated[0]); controlUnit.setParticipate(true); - assertTrue(updated[0]); + assertEquals(List.of(new ExtensionUpdateNetworkEvent("sim1", "secondaryVoltageControl", "controlUnitParticipate", null, + new ControlUnit.ParticipateEvent("z1", "GEN", false), new ControlUnit.ParticipateEvent("z1", "GEN", true))), + eventRecorder.getEvents()); } @Test public void extensionRemovalAndCreationNotificationTest() { - boolean[] removedBefore = new boolean[1]; - boolean[] removedAfter = new boolean[1]; - boolean[] created = new boolean[1]; - network.addListener(new DefaultNetworkListener() { - @Override - public void onExtensionCreation(Extension extension) { - assertInstanceOf(SecondaryVoltageControl.class, extension); - SecondaryVoltageControl svc = (SecondaryVoltageControl) extension; - assertEquals(1, svc.getControlZones().size()); - assertEquals("z2", svc.getControlZones().get(0).getName()); - created[0] = true; - } + NetworkEventRecorder eventRecorder = new NetworkEventRecorder(); + network.addListener(eventRecorder); - @Override - public void onExtensionBeforeRemoval(Extension extension) { - assertInstanceOf(SecondaryVoltageControl.class, extension); - removedBefore[0] = true; - } - - @Override - public void onExtensionAfterRemoval(Identifiable identifiable, String extensionName) { - assertInstanceOf(Network.class, identifiable); - assertEquals("sim1", identifiable.getId()); - assertEquals("secondaryVoltageControl", extensionName); - removedAfter[0] = true; - } - }); - - assertFalse(created[0]); - assertFalse(removedBefore[0]); - assertFalse(removedAfter[0]); network.removeExtension(SecondaryVoltageControl.class); - assertFalse(created[0]); - assertTrue(removedBefore[0]); - assertTrue(removedAfter[0]); + assertEquals(List.of(new ExtensionRemovalNetworkEvent("sim1", "secondaryVoltageControl", false), + new ExtensionRemovalNetworkEvent("sim1", "secondaryVoltageControl", true)), + eventRecorder.getEvents()); + + eventRecorder.reset(); control = network.newExtension(SecondaryVoltageControlAdder.class) .newControlZone() .withName("z2") @@ -158,6 +117,7 @@ public void onExtensionAfterRemoval(Identifiable identifiable, String extensi .add() .add() .add(); - assertTrue(created[0]); + assertEquals(List.of(new ExtensionCreationNetworkEvent("sim1", "secondaryVoltageControl")), + eventRecorder.getEvents()); } } diff --git a/itools-packager/README.md b/itools-packager/README.md index bfcdd975dc4..b2b5f08831c 100644 --- a/itools-packager/README.md +++ b/itools-packager/README.md @@ -39,6 +39,7 @@ Here is how to configure itools package Maven plugin in your project powsybl powsybl-x-y-x + zip 8G 2 @@ -68,6 +69,7 @@ Here is how to configure itools package Maven plugin in your project - packageName is optional, project final name is used as default value. - archiveName is optional, packageName is used as default value. +- packageType is optional, "zip" is the default value. It can be either zip or tgz. - javaXmx, mpiTasks and mpiHosts are used to generate itools.conf, are all optional and default values are respectively 8G, 2 and localhost. - additional binaries, libraries and configurations file can be added to the package using optional copyToBin, copyToLib and copyToEtc tags. - all of the jars with compile and runtime scope will be included in the package diff --git a/itools-packager/pom.xml b/itools-packager/pom.xml index f003cbe19db..cb554c17b3f 100644 --- a/itools-packager/pom.xml +++ b/itools-packager/pom.xml @@ -67,6 +67,34 @@ ${maven.plugin.annotations.version} provided + + + org.apache.maven.plugin-testing + maven-plugin-testing-harness + ${maven.plugin.testing.harness.version} + test + + + org.junit.vintage + junit-vintage-engine + test + + + org.slf4j + log4j-over-slf4j + test + + + org.slf4j + slf4j-simple + test + + + org.apache.maven + maven-compat + ${maven.compat} + test + diff --git a/itools-packager/src/main/java/com/powsybl/itools/ItoolsPackagerMojo.java b/itools-packager/src/main/java/com/powsybl/itools/ItoolsPackagerMojo.java index f9e0962f989..d56348fb95c 100644 --- a/itools-packager/src/main/java/com/powsybl/itools/ItoolsPackagerMojo.java +++ b/itools-packager/src/main/java/com/powsybl/itools/ItoolsPackagerMojo.java @@ -7,8 +7,11 @@ */ package com.powsybl.itools; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; +import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugins.annotations.Mojo; @@ -64,6 +67,9 @@ public void setFiles(File[] files) { } } + @Parameter(defaultValue = "zip") + private String packageType; + @Parameter private CopyTo copyToBin; @@ -73,7 +79,8 @@ public void setFiles(File[] files) { @Parameter private CopyTo copyToEtc; - private static void zip(Path dir, Path baseDir, Path zipFilePath) throws IOException { + private void zip(Path dir, Path baseDir, Path zipFilePath) throws IOException { + getLog().info("Zip package"); try (ZipArchiveOutputStream zos = new ZipArchiveOutputStream(Files.newOutputStream(zipFilePath))) { Files.walkFileTree(dir, new SimpleFileVisitor() { @Override @@ -100,6 +107,38 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th } } + private void targz(Path dir, Path baseDir, Path zipFilePath) throws IOException { + getLog().info("Targz package"); + try (TarArchiveOutputStream zos = + new TarArchiveOutputStream(new GzipCompressorOutputStream(Files.newOutputStream(zipFilePath)))) { + zos.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX); // allow long file paths + zos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX); // allow large numbers (for instance a big GID) + Files.walkFileTree(dir, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + TarArchiveEntry entry = new TarArchiveEntry(file.toFile(), baseDir.relativize(file).toString()); + if (Files.isExecutable(file)) { + entry.setMode(0100770); + } else { + entry.setMode(0100660); + } + zos.putArchiveEntry(entry); + Files.copy(file, zos); + zos.closeArchiveEntry(); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + zos.putArchiveEntry(new TarArchiveEntry(baseDir.relativize(dir).toString() + "/")); + zos.closeArchiveEntry(); + return FileVisitResult.CONTINUE; + } + }); + } + + } + private void copyFiles(CopyTo copyTo, Path destDir) { if (copyTo != null) { for (File file : copyTo.getFiles()) { @@ -179,9 +218,14 @@ public void execute() { Files.createDirectories(libDir); copyFiles(copyToLib, libDir); - getLog().info("Zip package"); String archiveNameNotNull = archiveName != null ? archiveName : packageNameNotNull; - zip(packageDir, targetDir, targetDir.resolve(archiveNameNotNull + ".zip")); + if (packageType.equalsIgnoreCase("zip")) { + zip(packageDir, targetDir, targetDir.resolve(archiveNameNotNull + ".zip")); + } else if (packageType.equalsIgnoreCase("tgz")) { + targz(packageDir, targetDir, targetDir.resolve(archiveNameNotNull + ".tgz")); + } else { + throw new IllegalArgumentException("Unknown filetype '" + packageType + "': should be either zip or tgz"); + } } catch (IOException e) { throw new UncheckedIOException(e); } diff --git a/itools-packager/src/test/java/com/powsybl/itools/ItoolsPackagerMojoTest.java b/itools-packager/src/test/java/com/powsybl/itools/ItoolsPackagerMojoTest.java new file mode 100644 index 00000000000..245544a7583 --- /dev/null +++ b/itools-packager/src/test/java/com/powsybl/itools/ItoolsPackagerMojoTest.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) 2024, Coreso SA (https://www.coreso.eu/) and TSCNET Services GmbH (https://www.tscnet.eu/) + * 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.itools; + +import org.apache.commons.io.FileUtils; +import org.apache.maven.execution.DefaultMavenExecutionRequest; +import org.apache.maven.execution.MavenExecutionRequest; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.plugin.MojoExecution; +import org.apache.maven.plugin.testing.AbstractMojoTestCase; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectBuilder; +import org.apache.maven.project.ProjectBuildingRequest; +import org.codehaus.plexus.configuration.DefaultPlexusConfiguration; +import org.codehaus.plexus.configuration.PlexusConfiguration; +import org.eclipse.aether.DefaultRepositorySystemSession; + +import java.io.File; + +/** + * @author Damien Jeandemange {@literal } + */ +public class ItoolsPackagerMojoTest extends AbstractMojoTestCase { + + private static final File BASEDIR = new File("src/test/resources/test-maven-project/"); + private static final File POM_XML = new File(BASEDIR, "pom.xml"); + private static final File TARGET = new File(BASEDIR, "target"); + public static final String DEFAULT_PACKAGE_NAME = "itools-packager-test-project-1.0.0-SNAPSHOT"; + + ItoolsPackagerMojo mojo; + PlexusConfiguration configuration; + + @Override + protected void setUp() + throws Exception { + // required + super.setUp(); + MavenProject project = readMavenProject(); + MavenSession session = newMavenSession(project); + MojoExecution execution = newMojoExecution("package-zip"); + mojo = (ItoolsPackagerMojo) lookupConfiguredMojo(session, execution); + configuration = new DefaultPlexusConfiguration("configuration"); + } + + @Override + protected void tearDown() + throws Exception { + // required + super.tearDown(); + FileUtils.deleteDirectory(TARGET); // cleanup + } + + protected MavenProject readMavenProject() throws Exception { + MavenExecutionRequest request = new DefaultMavenExecutionRequest(); + request.setBaseDirectory(BASEDIR); + ProjectBuildingRequest projectBuildingRequest = request.getProjectBuildingRequest(); + projectBuildingRequest.setRepositorySession(new DefaultRepositorySystemSession()); + MavenProject project = lookup(ProjectBuilder.class).build(POM_XML, projectBuildingRequest).getProject(); + assertNotNull(project); + return project; + } + + public void testDefaultConfiguration() throws Exception { + super.configureMojo(mojo, configuration); + assertNotNull(mojo); + mojo.execute(); + assertTrue(new File(TARGET, DEFAULT_PACKAGE_NAME + ".zip").exists()); + } + + public void testPackageTypeTgz() throws Exception { + configuration.addChild("packageType", "tgz"); + super.configureMojo(mojo, configuration); + assertNotNull(mojo); + mojo.execute(); + assertTrue(new File(TARGET, DEFAULT_PACKAGE_NAME + ".tgz").exists()); + } +} diff --git a/itools-packager/src/test/resources/test-maven-project/pom.xml b/itools-packager/src/test/resources/test-maven-project/pom.xml new file mode 100644 index 00000000000..f543d09b336 --- /dev/null +++ b/itools-packager/src/test/resources/test-maven-project/pom.xml @@ -0,0 +1,36 @@ + + + + 4.0.0 + + pom + com.powsybl + itools-packager-test-project + 1.0.0-SNAPSHOT + + + + + powsybl-itools-packager-maven-plugin + + + package + + package-zip + + + + + + + + diff --git a/loadflow/loadflow-api/src/main/java/com/powsybl/loadflow/LoadFlowParameters.java b/loadflow/loadflow-api/src/main/java/com/powsybl/loadflow/LoadFlowParameters.java index b45d1a00577..d1a8f04518a 100644 --- a/loadflow/loadflow-api/src/main/java/com/powsybl/loadflow/LoadFlowParameters.java +++ b/loadflow/loadflow-api/src/main/java/com/powsybl/loadflow/LoadFlowParameters.java @@ -129,27 +129,31 @@ protected static void load(LoadFlowParameters parameters, PlatformConfig platfor Objects.requireNonNull(parameters); Objects.requireNonNull(platformConfig); + // Only the parameters present in platformConfig will be updated and no default value will be set for the absent parameters + // (unlike what is done for the other parameters classes). + // This is needed for the LoadFlowDefaultParametersLoader mechanism to work (else the default values defined + // by the loader will be overwritten by the hardcoded ones). platformConfig.getOptionalModuleConfig("load-flow-default-parameters") .ifPresent(config -> { - parameters.setVoltageInitMode(config.getEnumProperty("voltageInitMode", VoltageInitMode.class, DEFAULT_VOLTAGE_INIT_MODE)); - parameters.setTransformerVoltageControlOn(config.getBooleanProperty("transformerVoltageControlOn", DEFAULT_TRANSFORMER_VOLTAGE_CONTROL_ON)); - parameters.setUseReactiveLimits(!config.getBooleanProperty("noGeneratorReactiveLimits", !DEFAULT_USE_REACTIVE_LIMITS)); // overwritten by reactiveLimits - parameters.setUseReactiveLimits(config.getBooleanProperty("useReactiveLimits", DEFAULT_USE_REACTIVE_LIMITS)); - parameters.setPhaseShifterRegulationOn(config.getBooleanProperty("phaseShifterRegulationOn", DEFAULT_PHASE_SHIFTER_REGULATION_ON)); - // keep old tag name "specificCompatibility" for compatibility - parameters.setTwtSplitShuntAdmittance(config.getBooleanProperty("twtSplitShuntAdmittance", config.getBooleanProperty("specificCompatibility", DEFAULT_TWT_SPLIT_SHUNT_ADMITTANCE))); - parameters.setShuntCompensatorVoltageControlOn(config.getBooleanProperty("shuntCompensatorVoltageControlOn", - config.getOptionalBooleanProperty("simulShunt").orElse(DEFAULT_SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON))); - parameters.setReadSlackBus(config.getBooleanProperty("readSlackBus", DEFAULT_READ_SLACK_BUS)); - parameters.setWriteSlackBus(config.getBooleanProperty("writeSlackBus", DEFAULT_WRITE_SLACK_BUS)); - parameters.setDc(config.getBooleanProperty("dc", DEFAULT_DC)); - parameters.setDistributedSlack(config.getBooleanProperty("distributedSlack", DEFAULT_DISTRIBUTED_SLACK)); - parameters.setBalanceType(config.getEnumProperty("balanceType", BalanceType.class, DEFAULT_BALANCE_TYPE)); - parameters.setDcUseTransformerRatio(config.getBooleanProperty("dcUseTransformerRatio", DEFAULT_DC_USE_TRANSFORMER_RATIO_DEFAULT)); - parameters.setCountriesToBalance(config.getEnumSetProperty("countriesToBalance", Country.class, DEFAULT_COUNTRIES_TO_BALANCE)); - parameters.setConnectedComponentMode(config.getEnumProperty("connectedComponentMode", ConnectedComponentMode.class, DEFAULT_CONNECTED_COMPONENT_MODE)); - parameters.setHvdcAcEmulation(config.getBooleanProperty("hvdcAcEmulation", DEFAULT_HVDC_AC_EMULATION_ON)); - parameters.setDcPowerFactor(config.getDoubleProperty("dcPowerFactor", DEFAULT_DC_POWER_FACTOR)); + config.getOptionalEnumProperty("voltageInitMode", VoltageInitMode.class).ifPresent(parameters::setVoltageInitMode); + config.getOptionalBooleanProperty("transformerVoltageControlOn").ifPresent(parameters::setTransformerVoltageControlOn); + config.getOptionalBooleanProperty("useReactiveLimits").ifPresentOrElse(parameters::setUseReactiveLimits, + () -> config.getOptionalBooleanProperty("noGeneratorReactiveLimits").ifPresent(value -> parameters.setUseReactiveLimits(!value))); + config.getOptionalBooleanProperty("phaseShifterRegulationOn").ifPresent(parameters::setPhaseShifterRegulationOn); + config.getOptionalBooleanProperty("twtSplitShuntAdmittance").ifPresentOrElse(parameters::setTwtSplitShuntAdmittance, + () -> config.getOptionalBooleanProperty("specificCompatibility").ifPresent(parameters::setTwtSplitShuntAdmittance)); + config.getOptionalBooleanProperty("shuntCompensatorVoltageControlOn").ifPresentOrElse(parameters::setShuntCompensatorVoltageControlOn, + () -> config.getOptionalBooleanProperty("simulShunt").ifPresent(parameters::setShuntCompensatorVoltageControlOn)); + config.getOptionalBooleanProperty("readSlackBus").ifPresent(parameters::setReadSlackBus); + config.getOptionalBooleanProperty("writeSlackBus").ifPresent(parameters::setWriteSlackBus); + config.getOptionalBooleanProperty("dc").ifPresent(parameters::setDc); + config.getOptionalBooleanProperty("distributedSlack").ifPresent(parameters::setDistributedSlack); + config.getOptionalEnumProperty("balanceType", BalanceType.class).ifPresent(parameters::setBalanceType); + config.getOptionalBooleanProperty("dcUseTranformerRatio").ifPresent(parameters::setDcUseTransformerRatio); + config.getOptionalEnumSetProperty("contriesToBalance", Country.class).ifPresent(parameters::setCountriesToBalance); + config.getOptionalEnumProperty("connectedComponentMode", ConnectedComponentMode.class).ifPresent(parameters::setConnectedComponentMode); + config.getOptionalBooleanProperty("hvdcAcEmulation").ifPresent(parameters::setHvdcAcEmulation); + config.getOptionalDoubleProperty("dcPowerFactor").ifPresent(parameters::setDcPowerFactor); }); } diff --git a/loadflow/loadflow-api/src/test/java/com/powsybl/loadflow/LoadFlowDefaultParametersLoaderTest.java b/loadflow/loadflow-api/src/test/java/com/powsybl/loadflow/LoadFlowDefaultParametersLoaderTest.java index 5ed88b0332e..cef8c937f46 100644 --- a/loadflow/loadflow-api/src/test/java/com/powsybl/loadflow/LoadFlowDefaultParametersLoaderTest.java +++ b/loadflow/loadflow-api/src/test/java/com/powsybl/loadflow/LoadFlowDefaultParametersLoaderTest.java @@ -7,13 +7,20 @@ */ package com.powsybl.loadflow; +import com.google.common.jimfs.Configuration; +import com.google.common.jimfs.Jimfs; +import com.powsybl.commons.config.InMemoryPlatformConfig; +import com.powsybl.commons.config.MapModuleConfig; import com.powsybl.commons.extensions.Extension; import com.powsybl.loadflow.json.JsonLoadFlowParametersTest; import org.junit.jupiter.api.Test; +import java.nio.file.FileSystem; import java.util.List; +import static com.powsybl.loadflow.LoadFlowParameters.load; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; /** * @author Hugo Kulesza {@literal } @@ -26,6 +33,8 @@ void testLoadParametersFromClassPath() { LoadFlowParameters parameters = new LoadFlowParameters(List.of(loader)); + assertFalse(parameters.isUseReactiveLimits()); + assertEquals(LoadFlowParameters.VoltageInitMode.DC_VALUES, parameters.getVoltageInitMode()); List> extensions = parameters.getExtensions().stream().toList(); assertEquals(1, extensions.size()); JsonLoadFlowParametersTest.DummyExtension dummyExtension = (JsonLoadFlowParametersTest.DummyExtension) extensions.get(0); @@ -41,4 +50,19 @@ void testConflictBetweenDefaultParametersLoader() { List> extensions = parameters.getExtensions().stream().toList(); assertEquals(0, extensions.size()); } + + @Test + void testCorrectLoadingOrder() { + FileSystem fileSystem = Jimfs.newFileSystem(Configuration.unix()); + InMemoryPlatformConfig platformConfig = new InMemoryPlatformConfig(fileSystem); + MapModuleConfig moduleConfig = platformConfig.createModuleConfig("load-flow-default-parameters"); + moduleConfig.setStringProperty("voltageInitMode", "PREVIOUS_VALUES"); + + LoadFlowDefaultParametersLoaderMock loader = new LoadFlowDefaultParametersLoaderMock("test"); + + LoadFlowParameters parameters = new LoadFlowParameters(List.of(loader)); + load(parameters, platformConfig); + assertFalse(parameters.isUseReactiveLimits()); + assertEquals(LoadFlowParameters.VoltageInitMode.PREVIOUS_VALUES, parameters.getVoltageInitMode()); + } } diff --git a/loadflow/loadflow-api/src/test/java/com/powsybl/loadflow/LoadFlowParametersTest.java b/loadflow/loadflow-api/src/test/java/com/powsybl/loadflow/LoadFlowParametersTest.java index 89d04696490..7b15480dc95 100644 --- a/loadflow/loadflow-api/src/test/java/com/powsybl/loadflow/LoadFlowParametersTest.java +++ b/loadflow/loadflow-api/src/test/java/com/powsybl/loadflow/LoadFlowParametersTest.java @@ -129,7 +129,7 @@ void checkConfig() { LoadFlowParameters parameters = new LoadFlowParameters(); LoadFlowParameters.load(parameters, platformConfig); checkValues(parameters, voltageInitMode, transformerVoltageControlOn, - noGeneratorReactiveLimits, phaseShifterRegulationOn, twtSplitShuntAdmittance, simulShunt, readSlackBus, writeSlackBus, + !noGeneratorReactiveLimits, phaseShifterRegulationOn, twtSplitShuntAdmittance, simulShunt, readSlackBus, writeSlackBus, dc, distributedSlack, balanceType, dcUseTransformerRatio, countriesToBalance, computedConnectedComponent, hvdcAcEmulation); } diff --git a/loadflow/loadflow-api/src/test/resources/LoadFlowParametersUpdate.json b/loadflow/loadflow-api/src/test/resources/LoadFlowParametersUpdate.json index b9c68573f9d..0fd96481654 100644 --- a/loadflow/loadflow-api/src/test/resources/LoadFlowParametersUpdate.json +++ b/loadflow/loadflow-api/src/test/resources/LoadFlowParametersUpdate.json @@ -1,4 +1,7 @@ { + "version": "1.9", + "voltageInitMode" : "DC_VALUES", + "useReactiveLimits" : false, "extensions": { "dummy-extension": { "parameterDouble": 5, diff --git a/math/src/main/java/com/powsybl/math/graph/UndirectedGraph.java b/math/src/main/java/com/powsybl/math/graph/UndirectedGraph.java index faf5534b916..077d6cf3f1d 100644 --- a/math/src/main/java/com/powsybl/math/graph/UndirectedGraph.java +++ b/math/src/main/java/com/powsybl/math/graph/UndirectedGraph.java @@ -36,20 +36,31 @@ public interface UndirectedGraph { */ int addVertex(); + /** + * Create a new vertex and notify the {@link UndirectedGraphListener}s. + * + * @param notify notify the {@link UndirectedGraphListener}s if true. + * @return the index of the new vertex. + */ + int addVertex(boolean notify); + /** * If the specified vertex does not exist or is null, create it and notify the {@link UndirectedGraphListener} */ - default void addVertexIfNotPresent(int v) { - throw new UnsupportedOperationException(); - } + void addVertexIfNotPresent(int v); + + /** + * If the specified vertex does not exist or is null, create it and notify the {@link UndirectedGraphListener} + * + * @param notify notify the {@link UndirectedGraphListener}s if true. + */ + void addVertexIfNotPresent(int v, boolean notify); /** * Check if a specified vertex exists. * This method throws a {@link com.powsybl.commons.PowsyblException} if the vertex index is invalid (negative). */ - default boolean vertexExists(int v) { - throw new UnsupportedOperationException(); - } + boolean vertexExists(int v); /** * Remove the specified vertex and notify the {@link UndirectedGraphListener}s. @@ -60,6 +71,16 @@ default boolean vertexExists(int v) { */ V removeVertex(int v); + /** + * Remove the specified vertex and notify the {@link UndirectedGraphListener}s. + * This method throws a {@link com.powsybl.commons.PowsyblException} if the vertex doesn't exist or if an edge is connected to this vertex. + * + * @param v the vertex index to remove. + * @param notify notify the {@link UndirectedGraphListener}s if true. + * @return the value attached to the vertex. + */ + V removeVertex(int v, boolean notify); + /** * Return the number of non-null vertices. * As the contiguity of vertices is not mandatory, the number of vertices can be less than the highest vertex index. @@ -79,6 +100,18 @@ default boolean vertexExists(int v) { */ int addEdge(int v1, int v2, E obj); + /** + * Create an edge between the two specified vertices and notify the {@link UndirectedGraphListener}s. + * This method throws a {@link com.powsybl.commons.PowsyblException} if one of the vertices doesn't exist. + * + * @param v1 the first end of the edge. + * @param v2 the second end of the edge. + * @param obj the value attached to the edge. + * @param notify notify the {@link UndirectedGraphListener}s if true. + * @return the index of the new edge. + */ + int addEdge(int v1, int v2, E obj, boolean notify); + /** * Remove the specified edge and notify the {@link UndirectedGraphListener}s. * This method thows a {@link com.powsybl.commons.PowsyblException} if the edge doesn't exist. @@ -88,11 +121,28 @@ default boolean vertexExists(int v) { */ E removeEdge(int e); + /** + * Remove the specified edge and notify the {@link UndirectedGraphListener}s. + * This method thows a {@link com.powsybl.commons.PowsyblException} if the edge doesn't exist. + * + * @param e the edge index to remove. + * @param notify notify the {@link UndirectedGraphListener}s if true. + * @return the value attached to the edge. + */ + E removeEdge(int e, boolean notify); + /** * Remove all the edges and notify the {@link UndirectedGraphListener}s. */ void removeAllEdges(); + /** + * Remove all the edges and notify the {@link UndirectedGraphListener}s. + * + * @param notify notify the {@link UndirectedGraphListener}s if true. + */ + void removeAllEdges(boolean notify); + /** * Return the number of edges. * @@ -147,7 +197,7 @@ default boolean vertexExists(int v) { V getVertexObject(int v); /** - * Set the value attached to the specified vertex. + * Set the value attached to the specified vertex and notify the {@link UndirectedGraphListener}s. * This method throws a {@link com.powsybl.commons.PowsyblException} if the vertex doesn't exist. * * @param v the vertex index. @@ -155,6 +205,16 @@ default boolean vertexExists(int v) { */ void setVertexObject(int v, V obj); + /** + * Set the value attached to the specified vertex and notify the {@link UndirectedGraphListener}s. + * This method throws a {@link com.powsybl.commons.PowsyblException} if the vertex doesn't exist. + * + * @param v the vertex index. + * @param obj the value to attach to the vertex. + * @param notify notify the {@link UndirectedGraphListener}s if true. + */ + void setVertexObject(int v, V obj, boolean notify); + /** * Return the index of the first vertex that the specified edge is connected to. * This method throws a {@link com.powsybl.commons.PowsyblException} if the edge doesn't exist. @@ -210,11 +270,19 @@ default boolean vertexExists(int v) { int getEdgeVertex2(int e); /** - * Remove all the vertices of this graph. + * Remove all the vertices of this graph and notify the {@link UndirectedGraphListener}s. * This method throws a {@link com.powsybl.commons.PowsyblException} if edges exist. */ void removeAllVertices(); + /** + * Remove all the vertices of this graph and notify the {@link UndirectedGraphListener}s. + * This method throws a {@link com.powsybl.commons.PowsyblException} if edges exist. + * + * @param notify notify the {@link UndirectedGraphListener}s if true. + */ + void removeAllVertices(boolean notify); + /** * Return an {@link Iterable} to iterate over the values attached to the edges. * @@ -330,7 +398,16 @@ default boolean vertexExists(int v) { void print(PrintStream out, Function vertexToString, Function edgeToString); /** - * Remove from the vertices which are not connected to any edge, and which have no associated object. + * Remove from the vertices which are not connected to any edge, and which have no associated object + * and notify the {@link UndirectedGraphListener}s. */ void removeIsolatedVertices(); + + /** + * Remove from the vertices which are not connected to any edge, and which have no associated object + * and notify the {@link UndirectedGraphListener}s. + * + * @param notify notify the {@link UndirectedGraphListener}s if true. + */ + void removeIsolatedVertices(boolean notify); } diff --git a/math/src/main/java/com/powsybl/math/graph/UndirectedGraphImpl.java b/math/src/main/java/com/powsybl/math/graph/UndirectedGraphImpl.java index e998b1c78e0..9d504362ff5 100644 --- a/math/src/main/java/com/powsybl/math/graph/UndirectedGraphImpl.java +++ b/math/src/main/java/com/powsybl/math/graph/UndirectedGraphImpl.java @@ -129,8 +129,12 @@ private void checkEdge(int e) { } } - @Override public int addVertex() { + return addVertex(true); + } + + @Override + public int addVertex(boolean notify) { int v; if (availableVertices.isEmpty()) { v = vertices.size(); @@ -141,12 +145,19 @@ public int addVertex() { vertices.set(v, new Vertex<>()); } invalidateAdjacencyList(); - notifyVertexAdded(v); + if (notify) { + notifyVertexAdded(v); + } return v; } @Override public void addVertexIfNotPresent(int v) { + addVertexIfNotPresent(v, true); + } + + @Override + public void addVertexIfNotPresent(int v, boolean notify) { if (v < 0) { throw new PowsyblException("Invalid vertex " + v); } @@ -158,7 +169,9 @@ public void addVertexIfNotPresent(int v) { vertices.set(v, new Vertex<>()); availableVertices.remove(v); invalidateAdjacencyList(); - notifyVertexAdded(v); + if (notify) { + notifyVertexAdded(v); + } } } else { for (int i = vertices.size(); i < v; i++) { @@ -167,7 +180,9 @@ public void addVertexIfNotPresent(int v) { } vertices.add(new Vertex<>()); invalidateAdjacencyList(); - notifyVertexAdded(v); + if (notify) { + notifyVertexAdded(v); + } } } @@ -179,7 +194,7 @@ public boolean vertexExists(int v) { return v < vertices.size() && vertices.get(v) != null; } - private V removeVertexInternal(int v) { + private V removeVertexInternal(int v, boolean notify) { V obj = vertices.get(v).getObject(); if (v == vertices.size() - 1) { vertices.remove(v); @@ -188,19 +203,26 @@ private V removeVertexInternal(int v) { vertices.set(v, null); availableVertices.add(v); } - notifyVertexRemoved(v, obj); + if (notify) { + notifyVertexRemoved(v, obj); + } return obj; } @Override public V removeVertex(int v) { + return removeVertex(v, true); + } + + @Override + public V removeVertex(int v, boolean notify) { checkVertex(v); for (Edge e : edges) { if (e != null && (e.getV1() == v || e.getV2() == v)) { throw new PowsyblException("An edge is connected to vertex " + v); } } - V obj = removeVertexInternal(v); + V obj = removeVertexInternal(v, notify); invalidateAdjacencyList(); return obj; } @@ -222,17 +244,29 @@ public int getVertexCount() { @Override public void removeAllVertices() { + removeAllVertices(true); + } + + @Override + public void removeAllVertices(boolean notify) { if (!edges.isEmpty()) { throw new PowsyblException("Cannot remove all vertices because there is still some edges in the graph"); } vertices.clear(); availableVertices.clear(); invalidateAdjacencyList(); - notifyAllVerticesRemoved(); + if (notify) { + notifyAllVerticesRemoved(); + } } @Override public int addEdge(int v1, int v2, E obj) { + return addEdge(v1, v2, obj, true); + } + + @Override + public int addEdge(int v1, int v2, E obj, boolean notify) { checkVertex(v1); checkVertex(v2); int e; @@ -245,39 +279,59 @@ public int addEdge(int v1, int v2, E obj) { edges.set(e, edge); } invalidateAdjacencyList(); - notifyEdgeAdded(e, obj); + if (notify) { + notifyEdgeAdded(e, obj); + } return e; } - private E removeEdgeInternal(int e) { + private E removeEdgeInternal(int e, boolean notify) { E obj = edges.get(e).getObject(); - notifyEdgeBeforeRemoval(e, obj); + if (notify) { + notifyEdgeBeforeRemoval(e, obj); + } if (e == edges.size() - 1) { edges.remove(e); } else { edges.set(e, null); removedEdges.add(e); } - notifyEdgeRemoved(e, obj); + if (notify) { + notifyEdgeRemoved(e, obj); + } return obj; } @Override public E removeEdge(int e) { + return removeEdge(e, true); + } + + @Override + public E removeEdge(int e, boolean notify) { checkEdge(e); - E obj = removeEdgeInternal(e); + E obj = removeEdgeInternal(e, notify); invalidateAdjacencyList(); return obj; } @Override public void removeAllEdges() { + removeAllEdges(true); + } + + @Override + public void removeAllEdges(boolean notify) { Collection allEdges = edges.stream().filter(Objects::nonNull).map(Edge::getObject).collect(Collectors.toList()); - notifyAllEdgesBeforeRemoval(allEdges); + if (notify) { + notifyAllEdgesBeforeRemoval(allEdges); + } edges.clear(); removedEdges.clear(); invalidateAdjacencyList(); - notifyAllEdgesRemoved(allEdges); + if (notify) { + notifyAllEdgesRemoved(allEdges); + } } @Override @@ -332,9 +386,16 @@ public V getVertexObject(int v) { @Override public void setVertexObject(int v, V obj) { + setVertexObject(v, obj, true); + } + + @Override + public void setVertexObject(int v, V obj, boolean notify) { checkVertex(v); vertices.get(v).setObject(obj); - notifyVertexObjectSet(v, obj); + if (notify) { + notifyVertexObjectSet(v, obj); + } } @Override @@ -718,25 +779,24 @@ public void print(PrintStream out, Function vertexToString, Function< } } - public void removeIsolatedVertices(int v, TIntArrayList[] adjacencyList) { - + private void removeIsolatedVertices(int v, TIntArrayList[] adjacencyList, boolean notify) { Vertex vertex = vertices.get(v); if (vertex != null && vertex.getObject() == null) { TIntArrayList adjacentEdges = adjacencyList[v]; if (adjacentEdges.isEmpty()) { - removeVertexInternal(v); + removeVertexInternal(v, notify); adjacencyList[v] = null; if (!adjacentEdges.isEmpty()) { int e = adjacentEdges.getQuick(0); - removeDanglingEdgeAndPropagate(e, v, adjacencyList); + removeDanglingEdgeAndPropagate(e, v, adjacencyList, notify); } } } } - private void removeDanglingEdgeAndPropagate(int edgeToRemove, int vFrom, TIntArrayList[] adjacencyList) { + private void removeDanglingEdgeAndPropagate(int edgeToRemove, int vFrom, TIntArrayList[] adjacencyList, boolean notify) { Edge edge = edges.get(edgeToRemove); int v1 = edge.getV1(); int v2 = edge.getV2(); @@ -745,7 +805,7 @@ private void removeDanglingEdgeAndPropagate(int edgeToRemove, int vFrom, TIntArr // updating adjacency list of vFrom & vTo is not done here, as: // - vFrom adjacency list has been set to null when vertex vFrom has been removed // - vTo adjacency list is updated hereafter - removeEdgeInternal(edgeToRemove); + removeEdgeInternal(edgeToRemove, notify); Vertex vertex = vertices.get(vTo); TIntArrayList adjacentEdges = adjacencyList[vTo]; @@ -758,7 +818,7 @@ private void removeDanglingEdgeAndPropagate(int edgeToRemove, int vFrom, TIntArr // propagate: we know that one of the neighbours (vFrom) of this vertex has been removed, hence: // - if only one adjacent edge, this is a newly isolated vertex // - if only two adjacent edges, this is a newly dangling vertex - removeVertexInternal(vTo); + removeVertexInternal(vTo, notify); adjacencyList[vTo] = null; // find the other edge to remove if dangling vertex @@ -766,16 +826,21 @@ private void removeDanglingEdgeAndPropagate(int edgeToRemove, int vFrom, TIntArr int otherEdgeToRemove = adjacentEdges.getQuick(0) == edgeToRemove ? adjacentEdges.getQuick(1) : adjacentEdges.getQuick(0); - removeDanglingEdgeAndPropagate(otherEdgeToRemove, vTo, adjacencyList); + removeDanglingEdgeAndPropagate(otherEdgeToRemove, vTo, adjacencyList, notify); } } @Override public void removeIsolatedVertices() { + removeIsolatedVertices(true); + } + + @Override + public void removeIsolatedVertices(boolean notify) { TIntArrayList[] adjacencyList = getAdjacencyList(); for (int v = 0; v < vertices.size(); v++) { - removeIsolatedVertices(v, adjacencyList); + removeIsolatedVertices(v, adjacencyList, notify); } } } diff --git a/math/src/test/java/com/powsybl/math/graph/UndirectedGraphImplTest.java b/math/src/test/java/com/powsybl/math/graph/UndirectedGraphImplTest.java index 43af43db8a5..998534feb17 100644 --- a/math/src/test/java/com/powsybl/math/graph/UndirectedGraphImplTest.java +++ b/math/src/test/java/com/powsybl/math/graph/UndirectedGraphImplTest.java @@ -172,6 +172,14 @@ void testAddEdge() { assertEquals(1, graph.getEdgeVertex2(e)); } + @Test + void testVertexNotFoundWhenAddingEdge() { + graph.addVertex(); + graph.addVertex(); + var e = assertThrows(PowsyblException.class, () -> graph.addEdge(0, 2, null)); + assertEquals("Vertex 2 not found", e.getMessage()); + } + @Test void testRemoveEdge() { graph.addVertex(); @@ -227,6 +235,12 @@ void testGetEdges() { assertArrayEquals(new int[]{0, 1}, graph.getEdges()); } + @Test + void testEdgeNotFound() { + var e = assertThrows(PowsyblException.class, () -> graph.getEdgeObject(0)); + assertEquals("Edge 0 not found", e.getMessage()); + } + @Test void testGetEdgesFromVertex() { graph.addVertex(); @@ -398,6 +412,24 @@ void testAddListener() { Mockito.verify(listener2, Mockito.atLeastOnce()).vertexAdded(Mockito.anyInt()); } + @Test + void testAddListenerButDisableNotification() { + UndirectedGraphListener listener = Mockito.mock(UndirectedGraphListener.class); + graph.addListener(listener); + Mockito.verify(listener, Mockito.never()).vertexAdded(Mockito.anyInt()); + int v1 = graph.addVertex(false); + int v2 = graph.addVertex(false); + Mockito.verify(listener, Mockito.never()).vertexAdded(Mockito.anyInt()); + int e = graph.addEdge(v1, v2, "test", false); + Mockito.verify(listener, Mockito.never()).edgeAdded(Mockito.anyInt(), Mockito.any()); + graph.removeEdge(e, false); + Mockito.verify(listener, Mockito.never()).edgeRemoved(Mockito.anyInt(), Mockito.any()); + graph.removeVertex(v1, false); + Mockito.verify(listener, Mockito.never()).vertexRemoved(Mockito.anyInt(), Mockito.any()); + graph.removeAllVertices(false); + Mockito.verify(listener, Mockito.never()).allVerticesRemoved(); + } + @Test void testRemoveListener() { UndirectedGraphListener listener1 = Mockito.mock(UndirectedGraphListener.class); diff --git a/pom.xml b/pom.xml index fa348543fdb..5ed3b8d8695 100644 --- a/pom.xml +++ b/pom.xml @@ -123,8 +123,10 @@ 1.3.0 5.10.2 1.5.6 + 3.9.9 3.8.5 3.13.0 + 3.3.0 0.5.15 5.12.0 2.5.0 @@ -926,6 +928,12 @@ ${junit-jupiter.version} test + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + org.assertj assertj-core