Skip to content

Commit

Permalink
wip complexity
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
  • Loading branch information
flo-dup committed Jun 24, 2024
1 parent 20110e9 commit 0284c1f
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ private static Map<String, LineGeoData> fixLines(Map<String, List<List<Coordinat

int linesWithOneConnectedSet = 0;
int linesWithTwoOrMoreConnectedSets = 0;

int oneConnectedSetDiscarded = 0;
int twoOrMoreConnectedSetsDiscarded = 0;

Expand Down Expand Up @@ -171,15 +170,15 @@ private static Map<String, LineGeoData> fixLines(Map<String, List<List<Coordinat
linesWithTwoOrMoreConnectedSets++;
List<List<Coordinate>> coordinatesComponents = fillMultipleConnectedSetsCoordinatesList(connectedSets, graph);

if (coordinatesComponents.size() != connectedSets.size()) {
if (coordinatesComponents.size() == connectedSets.size()) {
List<Coordinate> aggregatedCoordinates = aggregateCoordinates(coordinatesComponents);
Pair<String, String> substations = substationOrder(stringSubstationGeoDataMap, lineId, aggregatedCoordinates);
LineGeoData line = new LineGeoData(lineId, FileValidator.COUNTRY_FR, FileValidator.COUNTRY_FR, substations.getLeft(), substations.getRight(), aggregatedCoordinates);
lines.put(lineId, line);
} else {
twoOrMoreConnectedSetsDiscarded++;
continue;
}

List<Coordinate> aggregatedCoordinates = aggregateCoordinates(coordinatesComponents);
Pair<String, String> substations = substationOrder(stringSubstationGeoDataMap, lineId, aggregatedCoordinates);
LineGeoData line = new LineGeoData(lineId, FileValidator.COUNTRY_FR, FileValidator.COUNTRY_FR, substations.getLeft(), substations.getRight(), aggregatedCoordinates);
lines.put(lineId, line);
}
}
}
Expand Down

0 comments on commit 0284c1f

Please sign in to comment.