Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
333c39c
UCTE mapping for one line
Sebasss-h Apr 16, 2025
0a77289
Create MappingResults.java
Sebasss-h Apr 17, 2025
1acfea4
Check style
Sebasss-h Apr 17, 2025
c709850
Fix
Sebasss-h Apr 17, 2025
b5fad73
Test Multi Lines ?
Sebasss-h Apr 18, 2025
4089718
Test Multi Lines
Sebasss-h Apr 22, 2025
a7b822a
Test Multi Lines elementName
Sebasss-h Apr 24, 2025
470379c
Refactor UcteMappingTest for improved readability and logic.
OpenSuze Apr 24, 2025
2eac7d6
Handle null values for elementName in UcteMapping.
OpenSuze Apr 24, 2025
8ffa76c
Test Line Switch Position
Sebasss-h Apr 24, 2025
4b74b1c
Merge remote-tracking branch 'origin/ucteMapping' into ucteMapping
Sebasss-h Apr 24, 2025
e398128
Test Weird Cases (missing line)
Sebasss-h Apr 25, 2025
9bf4a5e
TieLines and Duplicate Values
Sebasss-h May 6, 2025
399bba1
Correction UCTEMapping
Sebasss-h May 6, 2025
b249e63
Refactoring 1 UcteMapping
Sebasss-h May 7, 2025
e1f6b01
Add importNetworkInPc and searching bugs
Sebasss-h May 12, 2025
836f2e5
Solving and detecting problems UcteMappingTest
Sebasss-h May 13, 2025
fb4c94d
Solving and detecting problems UcteMappingTest
Sebasss-h May 14, 2025
6e2496b
Solving and detecting problems testRealNetwork
Sebasss-h May 14, 2025
2c302bc
Adding isFictitious filter
Sebasss-h May 14, 2025
2138b81
UcteMapping mapNetworks2
Sebasss-h May 22, 2025
cd70139
UcteMapping mapNetworks2
Sebasss-h May 22, 2025
1759760
Merge branch 'main' into ucteMapping
Sebasss-h May 22, 2025
5667b91
UcteMapping line "clean"
Sebasss-h May 23, 2025
81d3026
Removing impact Trm algorithm
Sebasss-h May 23, 2025
1dead70
Put private package visibility ucte mapping
Sebasss-h May 23, 2025
6dc9252
Fix country filtering incorrect implementation
Sebasss-h May 23, 2025
c2c40f4
Improve readability of the code and overall performance
Sebasss-h May 23, 2025
845b1ff
Improve return statements
Sebasss-h May 23, 2025
49b1791
DuplicateCheck method
Sebasss-h May 27, 2025
1255c30
DuplicateCheck method in mapNetworks
Sebasss-h May 27, 2025
44fdc6b
Refactor Uctemapping function
Sebasss-h Jun 4, 2025
5a1848e
UcteMapper function and fix-tests
Sebasss-h Jun 5, 2025
a8caada
Fix tests and update code comments
Sebasss-h Jun 6, 2025
5fe88bf
Implement UCteMapper in TrmAlgorithm and identify bug in test
Sebasss-h Jun 13, 2025
40137a1
Fix TrmAlgorithm
Sebasss-h Jun 13, 2025
739e123
rollback file modifications
murgeyseb Jun 16, 2025
c422bf8
rollback file modifications
murgeyseb Jun 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@
<groupId>com.powsybl</groupId>
<artifactId>open-rao-crac-io-commons</artifactId>
<version>${powsybl.rao.version}</version>
<scope>test</scope>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add the default scope and move this dependency into its section (in alphabetical order: line 83 I think) ?

</dependency>
<dependency>
<groupId>com.powsybl</groupId>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rte_france/trm_algorithm/TrmAlgorithm.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ public TrmResults computeUncertainties(Network referenceNetwork, Network marketB

operationalConditionAligner.align(referenceNetwork, marketBasedNetwork);
Map<String, Double> marketBasedFlows = flowExtractor.extract(marketBasedNetwork, referenceNetworkElementIds);
Map<String, ZonalPtdfAndFlow> referencePdtfAndFlow = zonalSensitivityComputer.run(referenceNetwork, referenceNetworkElementIds, referenceZonalGlsks);
Map<String, ZonalPtdfAndFlow> referencePtdfAndFlow = zonalSensitivityComputer.run(referenceNetwork, referenceNetworkElementIds, referenceZonalGlsks);
LOGGER.info("Computing uncertainties");
Map<String, UncertaintyResult> uncertaintiesMap = referencePdtfAndFlow.entrySet().stream().collect(Collectors.toMap(
Map<String, UncertaintyResult> uncertaintiesMap = referencePtdfAndFlow.entrySet().stream().collect(Collectors.toMap(
Map.Entry::getKey,
entry -> {
Branch<?> referenceBranch = referenceNetwork.getBranch(entry.getKey());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.rte_france.trm_algorithm.id_mapping;
Comment thread
Sebasss-h marked this conversation as resolved.

public class IdMappingNotFoundException extends RuntimeException {
Comment thread
Sebasss-h marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package com.rte_france.trm_algorithm.id_mapping;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class IdentifiableMapp {
Comment thread
Sebasss-h marked this conversation as resolved.
Outdated
private final Map<String, String> mappingFromMarketBasedToReference;
private final Map<String, String> mappingFromReferenceToMarketBased;
private static final Logger LOGGER = LoggerFactory.getLogger(IdentifiableMapp.class);

IdentifiableMapp(Map<String, String> mappingFromMarketBasedToReference, Map<String, String> mappingFromReferenceToMarketBased) {
this.mappingFromMarketBasedToReference = mappingFromMarketBasedToReference;
this.mappingFromReferenceToMarketBased = mappingFromReferenceToMarketBased;
}

public String idInReference(String s) {
return mappingFromMarketBasedToReference.computeIfAbsent(s, idInMarket -> {
throw new IdMappingNotFoundException();
});
}

public String idInMarketBased(String s) {
return mappingFromReferenceToMarketBased.computeIfAbsent(s, idInReference -> {
throw new IdMappingNotFoundException();
});
}

public static class IdentifiableMappBuilder {
Comment thread
Sebasss-h marked this conversation as resolved.
Outdated
Map<String, String> mappingFromMarketBasedToReference = new HashMap<>();
Map<String, String> mappingFromReferenceToMarketBased = new HashMap<>();
List<String> invalidatedInMarketBased = new ArrayList<>();
List<String> invalidatedInReference = new ArrayList<>();

IdentifiableMapp build() {
return new IdentifiableMapp(mappingFromMarketBasedToReference, mappingFromReferenceToMarketBased);
}

public void addMappingOrInvalidateDuplicates(String idMarketBased, String idReference) {
if (invalidatedInMarketBased.contains(idMarketBased)) {
LOGGER.error("Replicated branches found for: {} in reference", idMarketBased);
return;
}
if (invalidatedInReference.contains(idReference)) {
LOGGER.error("Replicated branches found for: {} in marketBased", idReference);
return;
}

if (mappingFromMarketBasedToReference.containsKey(idMarketBased) && mappingFromMarketBasedToReference.get(idMarketBased) != idReference) {
String previousReference = mappingFromMarketBasedToReference.get(idMarketBased);
mappingFromMarketBasedToReference.remove(idMarketBased);
mappingFromReferenceToMarketBased.remove(idReference);
invalidatedInMarketBased.add(idMarketBased);
invalidatedInReference.add(idReference);
invalidatedInReference.add(previousReference);
return;
}

if (mappingFromReferenceToMarketBased.containsKey(idReference) && mappingFromReferenceToMarketBased.get(idReference) != idMarketBased) {
String previousMarketBased = mappingFromReferenceToMarketBased.get(idReference);
mappingFromMarketBasedToReference.remove(idMarketBased);
mappingFromReferenceToMarketBased.remove(idReference);
invalidatedInMarketBased.add(idMarketBased);
invalidatedInMarketBased.add(previousMarketBased);
invalidatedInReference.add(idReference);
return;
}

mappingFromReferenceToMarketBased.put(idReference, idMarketBased);
mappingFromMarketBasedToReference.put(idMarketBased, idReference);
}
}
}
Original file line number Diff line number Diff line change
@@ -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.rte_france.trm_algorithm.id_mapping;

/**
* @author Sebastian Huaraca {@literal <sebastian.huaracalapa at rte-france.com>}
*/

public record MappingResults(String lineFromMarketBasedNetwork, String lineFromReferenceNetwork, boolean mappingFound) {
Comment thread
Sebasss-h marked this conversation as resolved.
Outdated

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* Copyright (c) 2024, RTE (http://www.rte-france.com)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this copyright be 2025 (same for all new classes in this PR)?

(@murgeyseb I don't know the correct policy)

* 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.rte_france.trm_algorithm.id_mapping;

import com.powsybl.iidm.network.*;
import com.powsybl.openrao.data.crac.io.commons.ucte.UcteMatchingResult;
import com.powsybl.openrao.data.crac.io.commons.ucte.UcteNetworkAnalyzer;
import com.powsybl.openrao.data.crac.io.commons.ucte.UcteNetworkAnalyzerProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;

/**
* @author Sebastian Huaraca {@literal <sebastian.huaracalapa at rte-france.com>}
*/

public final class UcteMapping {
Comment thread
Sebasss-h marked this conversation as resolved.
Outdated
private static final Logger LOGGER = LoggerFactory.getLogger(UcteMapping.class);
private static final UcteNetworkAnalyzerProperties UCTE_NETWORK_ANALYZER_PROPERTIES = new UcteNetworkAnalyzerProperties(UcteNetworkAnalyzerProperties.BusIdMatchPolicy.REPLACE_8TH_CHARACTER_WITH_WILDCARD);

public static IdentifiableMapp mapNetworks(Network networkReference, Network networkMarketBased) {
IdentifiableMapp.IdentifiableMappBuilder builder = new IdentifiableMapp.IdentifiableMappBuilder();
UcteNetworkAnalyzer analyser = new UcteNetworkAnalyzer(networkReference, UCTE_NETWORK_ANALYZER_PROPERTIES);
networkMarketBased.getBranchStream().forEach(branch -> mapNetworks(analyser, builder, networkMarketBased, branch));
return builder.build();
}

static IdentifiableMapp mapNetworks(Network networkReference, Network networkMarketBased, Country... filtersCountries) {
Comment thread
Sebasss-h marked this conversation as resolved.
Outdated
IdentifiableMapp.IdentifiableMappBuilder builder = new IdentifiableMapp.IdentifiableMappBuilder();
UcteNetworkAnalyzer analyser = new UcteNetworkAnalyzer(networkReference, UCTE_NETWORK_ANALYZER_PROPERTIES);
networkMarketBased.getBranchStream()
.filter(branch -> isBranchConnectedToAnyGivenCountry(branch, filtersCountries))
.forEach(line -> mapNetworks(analyser, builder, networkMarketBased, line));
return builder.build();
}

private static boolean isBranchConnectedToAnyGivenCountry(Branch branch, Country... countries) {
return Arrays.stream(countries).anyMatch(country -> isBranchConnectedToCountry(branch, country));
}

private static boolean isBranchConnectedToCountry(Branch branch, Country country) {
Optional<Country> country1 = branch.getTerminal1().getVoltageLevel()
.getSubstation().flatMap(Substation::getCountry);
Optional<Country> country2 = branch.getTerminal2().getVoltageLevel()
.getSubstation().flatMap(Substation::getCountry);
return country1.isPresent() && country1.get().equals(country) ||
country2.isPresent() && country2.get().equals(country);
}

private static void mapNetworks(UcteNetworkAnalyzer analyser, IdentifiableMapp.IdentifiableMappBuilder builder, Network networkMarketBased, Branch branch) {
String voltageLevelSide1 = getVoltageLevelSide1(branch.getId());
String voltageLevelSide2 = getVoltageLevelSide2(branch.getId());
String orderCode = getOrderCode(branch.getId());
Optional<String> optionalElementName = Optional.ofNullable(networkMarketBased.getBranch(branch.getId()).getProperty("elementName"));
UcteMatchingResult resultOrderCode = analyser.findTopologicalElement(voltageLevelSide1, voltageLevelSide2, orderCode);
if (resultOrderCode.getStatus() == UcteMatchingResult.MatchStatus.SINGLE_MATCH) {
builder.addMappingOrInvalidateDuplicates(branch.getId(), resultOrderCode.getIidmIdentifiable().getId());
}
if (optionalElementName.isPresent()) {
UcteMatchingResult resultElementName = analyser.findTopologicalElement(voltageLevelSide1, voltageLevelSide2, networkMarketBased.getBranch(branch.getId()).getProperty("elementName"));
if (resultElementName.getStatus() == UcteMatchingResult.MatchStatus.SINGLE_MATCH) {
builder.addMappingOrInvalidateDuplicates(branch.getId(), resultElementName.getIidmIdentifiable().getId());
}
}
}

private static String getOrderCode(String id) {
return id.substring(18);
}

private static String getVoltageLevelSide2(String id) {
return id.substring(9, 16);
}

private static String getVoltageLevelSide1(String id) {
return id.substring(0, 7);
}

//Utility class
private UcteMapping() {
}
}
1 change: 0 additions & 1 deletion src/test/java/com/rte_france/trm_algorithm/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import com.rte_france.trm_algorithm.operational_conditions_aligners.exchange_and_net_position.EmptyNetPosition;
import com.rte_france.trm_algorithm.operational_conditions_aligners.exchange_and_net_position.ExchangeAndNetPositionInterface;
import com.rte_france.trm_algorithm.operational_conditions_aligners.exchange_and_net_position.NetPositionInterface;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should revert this modification, because it is the only one in this file

import java.nio.file.Paths;
import java.util.Collections;
import java.util.Map;
Expand Down
12 changes: 12 additions & 0 deletions src/test/java/com/rte_france/trm_algorithm/TrmAlgorithmTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,4 +367,16 @@ void testReferenceNetworkSubpartOfMarketBasedNetwork() {
assertEquals(1260.669, result.get("NNL2AA1 BBE3AA1 1").getUncertainty(), EPSILON);
assertEquals(1260.669, result.get("DDE2AA1 NNL3AA1 1").getUncertainty(), EPSILON);
}

@Test
void testUcteMapping() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new method does not test anything (in particular because no change was made in TrmAlgorithm.java (except fixing a typo)).
You should remove this code (but save it somewhere on your computer), and then open a new PR which aims at connecting this UCTE mapping feature to the TrmAlgorithm class. And then reuse this method (and add an assertTrue or assertEquals to it) to test that the connection is made correctly.

Network referenceNetwork = TestUtils.importNetwork("TestCase12Nodes/NETWORK_TEST_IN_REFERENCE.uct");
Network marketBasedNetwork = TestUtils.importNetwork("TestCase12Nodes/NETWORK_TEST_IN_MARKET.uct");
ZonalData<SensitivityVariableSet> zonalGlsks = TrmUtils.getAutoGlsk(referenceNetwork);
ZonalData<Scalable> localMarketZonalScalable = TrmUtils.getAutoScalable(marketBasedNetwork);
XnecProvider xnecProvider = new XnecProviderInterconnection();
TrmAlgorithm trmAlgorithm = setUp(CracFactory.findDefault().create("crac"), localMarketZonalScalable);
TrmResults trmResults = trmAlgorithm.computeUncertainties(referenceNetwork, marketBasedNetwork, xnecProvider, zonalGlsks);
Map<String, UncertaintyResult> result = trmResults.getUncertaintiesMap();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* 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.rte_france.trm_algorithm.id_mapping;

import com.powsybl.iidm.network.Country;
import com.powsybl.iidm.network.Network;
import com.rte_france.trm_algorithm.TestUtils;
import org.junit.jupiter.api.Test;

import java.util.List;

import static org.junit.jupiter.api.Assertions.*;

/**
* @author Sebastian Huaraca {@literal <sebastian.huaracalapa at rte-france.com>}
*/

public class UcteMappingTest {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A general comment on this test class: could you please describe (in comments) what you precisely test in each method?
In particular, I am curious to see written which test method checks the following functionalities:
A/ same substation code (first 7 characters) for side 1 and for side 2 + same order code
B/ same substation code (first 7 characters) for side 1 and for side 2, both sides are inverted between the files + same order code
C/ A and B, but with different order code and same element name
D/ Line from network 1 missing in network 2
E/ Line from network 1 pointing at several elements from network 2
F/ others, if I forgot something :)

@Test
void testMultiLines() {
// Given
Network networkReference = TestUtils.importNetwork("TestCase12Nodes/TestCase12Nodes_NewId.uct");
Network networkMarketBased = TestUtils.importNetwork("TestCase12Nodes/TestCase12Nodes.uct");
// When
IdentifiableMapp mappingResults = UcteMapping.mapNetworks(networkReference, networkMarketBased);
assertEquals("BBE1AA1 BBE2AA1 1", mappingResults.idInMarketBased("BBE1AA12 BBE2AA11 1"));
assertEquals("DDE1AA1 DDE2AA1 1", mappingResults.idInMarketBased("DDE1AA1 DDE2AA1 1"));
assertEquals("NNL2AA1 BBE3AA1 1", mappingResults.idInReference("NNL2AA1 BBE3AA1 1"));
assertEquals("BBE2AA11 BBE3AA1 1", mappingResults.idInReference("BBE2AA1 BBE3AA1 1"));
assertThrows(IdMappingNotFoundException.class, () -> mappingResults.idInReference("NON EXISTING ID"));
}

@Test
void testMultiLinesList() {
//Given
Network networkReference = TestUtils.importNetwork("TestCase12Nodes/20170322_1844_SN3_FR2.uct");
Network networkMarketBased = TestUtils.importNetwork("TestCase12Nodes/20170322_1844_SN3_FR2_NewId.uct");
//When
IdentifiableMapp mappingResults = UcteMapping.mapNetworks(networkReference, networkMarketBased);
//Then
List<MappingResults> expectedMappingResults = List.of(
new MappingResults("FFNHV111 FFNHV211 1", "FFNHV111 FFNHV211 1", true),
new MappingResults("FFNHV111 FFNHV211 2", "FFNHV111 FFNHV211 2", true),
new MappingResults("FFNHV211 FFNHV311 1", "FFNHV211 FFNHV311 1", true),
new MappingResults("FFNGEN71 FFNHV111 1", "FFNGEN71 FFNHV111 1", true),
new MappingResults("FFNHV211 FFNLOA31 L", "FFNHV211 FFNLOA31 L", true));
//assertEquals(expectedMappingResults, mappingResults.mappingResults());
Comment thread
Sebasss-h marked this conversation as resolved.
Outdated
}

@Test
void testLineSwitchPosition() {
//Given
Network networkReference = TestUtils.importNetwork("TestCase12Nodes/20170322_1844_SN3_FR2.uct");
Network networkMarketBased = TestUtils.importNetwork("TestCase12Nodes/20170322_1844_SN3_FR2_NewPosition.uct");
//When
IdentifiableMapp mappingResults = UcteMapping.mapNetworks(networkReference, networkMarketBased);
//Then
List<MappingResults> expectedMappingResults = List.of(
new MappingResults("FFNHV211 FFNHV111 1", "FFNHV111 FFNHV211 1", true),
new MappingResults("FFNHV111 FFNHV211 2", "FFNHV111 FFNHV211 2", true),
new MappingResults("FFNHV311 FFNHV211 1", "FFNHV211 FFNHV311 1", true),
new MappingResults("FFNGEN71 FFNHV111 1", "FFNGEN71 FFNHV111 1", true),
new MappingResults("FFNHV211 FFNLOA31 L", "FFNHV211 FFNLOA31 L", true));
//assertEquals(expectedMappingResults, mappingResults.mappingResults());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add an assertSomething at the end of this method, otherwise it is not a test.

}

@Test
void testRemoveLines() {
//Given
Network networkReference = TestUtils.importNetwork("TestCase12Nodes/20170322_1844_SN3_FR2.uct");
Network networkMarketBased = TestUtils.importNetwork("TestCase12Nodes/20170322_1844_SN3_FR2_NewPosition.uct");
networkReference.getLine("FFNHV111 FFNHV211 2").remove();
networkMarketBased.getLine("FFNHV311 FFNHV211 1").remove();
//When
IdentifiableMapp mappingResults = UcteMapping.mapNetworks(networkReference, networkMarketBased);
//Then
assertEquals("FFNHV211 FFNHV111 1", mappingResults.idInMarketBased("FFNHV111 FFNHV211 1"));
assertEquals("FFNGEN71 FFNHV111 1", mappingResults.idInReference("FFNGEN71 FFNHV111 1"));
assertThrows(IdMappingNotFoundException.class, () -> mappingResults.idInReference("FFNHV111 FFNHV211 2"));
}

@Test
void testDuplicateValues() {
//Given
Network networkReference = TestUtils.importNetwork("TestCase12Nodes/20170322_1844_SN3_FR2_Repetitive.uct");
Network networkMarketBased = TestUtils.importNetwork("TestCase12Nodes/20170322_1844_SN3_FR2_NewDuplicate.uct");
//When
IdentifiableMapp mappingResults = UcteMapping.mapNetworks(networkReference, networkMarketBased);
//Then
assertEquals("FFNHV311 FFNHV211 1", mappingResults.idInMarketBased("FFNHV211 FFNHV311 1"));
assertEquals("FFNHV211 FFNLOA31 L", mappingResults.idInReference("FFNHV211 FFNLOA31 L"));
assertThrows(IdMappingNotFoundException.class, () -> mappingResults.idInMarketBased("FFNHV111 FFNHV211 1"));
}

@Test
void testRealNetwork() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be deleted.

//Given
Network networkReference = Network.read("/home/huaracaseb/Bureau/Pruebas/Reference/2023_1/20230101_0330_SN7_UX0.uct");
Network networkMarketBased = Network.read("/home/huaracaseb/Bureau/Pruebas/MarketBased/2023_01/20230101_0330_FO7_UX1.uct");
//When
IdentifiableMapp mappingResults = UcteMapping.mapNetworks(networkReference, networkMarketBased, Country.FR, Country.CH, Country.AT, Country.SI, Country.IT);
}

@Test
void testNewMappingMap() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test to this method (assertSomething), or delete it.

//Given
Network networkReference = TestUtils.importNetwork("TestCase12Nodes/NETWORK_TEST_IN_REFERENCE.uct");
Network networkMarketBased = TestUtils.importNetwork("TestCase12Nodes/NETWORK_TEST_IN_MARKET.uct");
//When
IdentifiableMapp mappingResults = UcteMapping.mapNetworks(networkReference, networkMarketBased, Country.IT, Country.FR, Country.SI, Country.CH, Country.AT);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
##C 2007.05.01
Informations : 20170322_1844_SN3_FR2.uct
Date of situation : 2017/03/22 18:44
Copyright (c) 2017, RTE
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/.
##N
##ZFR
FFNGEN71 FNGEN__ GEN- 0 2 24.000 0.00000 0.00000 -800.00 0.00000 9999.00 -9999.0 999.000 -999.00
FFNHV111 FNHV1__ HV1- 0 0 0.00000 0.00000 0.00000 0.00000
FFNHV211 FNHV2__ HV2- 0 0 0.00000 0.00000 0.00000 0.00000
FFNHV311 FNHV3__ HV3- 0 3 400.00 0.00000 0.00000 0.00000 0.00000 9999.00 -9999.0 9999.00 -9999.0
FFNLOA31 FNLOAD_ OAD- 0 0 600.000 400.000 0.00000 0.00000
##L
FFNHV111 FFNHV211 1 0 3.0035 32.995 385.9970 1519 NHV1 -NHV
FFNHV111 FFNHV211 2 0 3.0035 32.995 385.9970 1519 NHV3 -NHV
FFNHV211 FFNHV311 1 0 3.0035 32.995 385.9970 1519 NHV2 -NHV
##T
FFNGEN71 FFNHV111 1 0 24.00 400.0 1300. 0.0010 0.0500 0.000000 0.0000 9999 NGEN -NHV
FFNHV211 FFNLOA31 L 0 400.0 158.0 1000. 0.3360 15.997 -5.48435 1.2500 9999 NHV2 -NLO
##R
FFNHV211 FFNLOA31 L 1.000 10 0
Loading
Loading