|
16 | 16 | import com.powsybl.flow_decomposition.xnec_provider.XnecProviderInterconnection; |
17 | 17 | import com.powsybl.flow_decomposition.xnec_provider.XnecProviderUnion; |
18 | 18 | import com.powsybl.glsk.commons.ZonalData; |
19 | | -import com.powsybl.glsk.commons.ZonalDataImpl; |
20 | 19 | import com.powsybl.glsk.cse.CseGlskDocument; |
21 | 20 | import com.powsybl.iidm.modification.scalable.Scalable; |
22 | 21 | import com.powsybl.iidm.network.Network; |
|
35 | 34 | import java.time.ZoneOffset; |
36 | 35 | import java.util.*; |
37 | 36 |
|
38 | | -import static org.junit.jupiter.api.Assertions.assertEquals; |
39 | | -import static org.junit.jupiter.api.Assertions.assertThrows; |
| 37 | +import static org.junit.jupiter.api.Assertions.*; |
40 | 38 |
|
41 | 39 | /** |
42 | 40 | * @author Hugo Schindler {@literal <hugo.schindler at rte-france.com>} |
@@ -242,11 +240,18 @@ void testSameNetwork16NodesWithDisconnectedLine() { |
242 | 240 | @Test |
243 | 241 | void testDifferentNetwork() { |
244 | 242 | Network referenceNetwork = TestUtils.importNetwork("TestCase16Nodes/TestCase16Nodes.uct"); |
245 | | - Network marketBasedNetwork = TestUtils.importNetwork("operational_conditions_aligners/pst/NETWORK_PST_FLOW_WITH_COUNTRIES_NON_NEUTRAL.uct"); |
246 | | - XnecProvider xnecProvider = new XnecProviderInterconnection(); |
247 | | - TrmAlgorithm trmAlgorithm = setUp(CracFactory.findDefault().create("crac"), new ZonalDataImpl<>(Collections.emptyMap())); |
248 | | - TrmException exception = assertThrows(TrmException.class, () -> trmAlgorithm.computeUncertainties(referenceNetwork, marketBasedNetwork, xnecProvider, null)); |
249 | | - assertEquals("Market-based network doesn't contain the following network elements: [BBE1AA1 FFR5AA1 1, BBE2AA1 FFR3AA1 1, BBE4AA1 FFR5AA1 1, DDE2AA1 NNL3AA1 1, FFR2AA1 DDE3AA1 1, FFR4AA1 DDE1AA1 1, FFR4AA1 DDE4AA1 1, NNL2AA1 BBE3AA1 1].", exception.getMessage()); |
| 243 | + Network marketBasedNetwork = TestUtils.importNetwork("TestCase16Nodes/TestCase16Nodes.uct"); |
| 244 | + CseGlskDocument cseGlskDocument = CseGlskDocument.importGlsk(getClass().getResourceAsStream("TestCase16Nodes/glsk_proportional_16nodes.xml"), false, true); |
| 245 | + marketBasedNetwork.getLine("BBE1AA1 FFR5AA1 1").remove(); |
| 246 | + ZonalData<SensitivityVariableSet> zonalGlsks = cseGlskDocument.getZonalGlsks(referenceNetwork); |
| 247 | + ZonalData<Scalable> localMarketZonalScalable = cseGlskDocument.getZonalScalable(marketBasedNetwork); |
| 248 | + XnecProviderByIds xnecProviderByIds = XnecProviderByIds.builder() |
| 249 | + .addNetworkElementsOnBasecase(Set.of("BBE1AA1 FFR5AA1 1")) |
| 250 | + .build(); |
| 251 | + XnecProvider xnecProvider = new XnecProviderUnion(List.of(xnecProviderByIds, new XnecProviderInterconnection())); |
| 252 | + TrmAlgorithm trmAlgorithm = setUp(CracFactory.findDefault().create("crac"), localMarketZonalScalable); |
| 253 | + TrmResults trmResults = trmAlgorithm.computeUncertainties(referenceNetwork, marketBasedNetwork, xnecProvider, zonalGlsks); |
| 254 | + assertNull(trmResults.getUncertaintiesMap().get("BBE1AA1 FFR5AA1 1")); |
250 | 255 | } |
251 | 256 |
|
252 | 257 | @Test |
|
0 commit comments