Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump powsybl-core 4.4.0-RC1 #358

Merged
merged 5 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<junit-jupiter.version>5.5.2</junit-jupiter.version>
<slf4jtoys.version>1.6.2</slf4jtoys.version>

<powsybl-core.version>4.3.1</powsybl-core.version>
<powsybl-core.version>4.4.0-RC1</powsybl-core.version>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ public Optional<List<LfNetwork>> load(Object network, LfNetworkParameters parame

static boolean participateToSlackDistribution(LfNetworkParameters parameters, Bus b) {
return parameters.getCountriesToBalance().isEmpty()
|| b.getVoltageLevel().getSubstation().getCountry()
|| b.getVoltageLevel().getSubstation().flatMap(Substation::getCountry)
.map(country -> parameters.getCountriesToBalance().contains(country))
.orElse(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package com.powsybl.openloadflow.util;

import com.powsybl.iidm.network.*;
import com.powsybl.math.graph.TraverseResult;

import java.util.HashSet;
import java.util.Set;
Expand All @@ -30,21 +31,21 @@ public NodeBreakerTraverser(Set<Switch> switchesToOpen, int initNode,
}

@Override
public boolean traverse(int nodeBefore, Switch sw, int nodeAfter) {
public TraverseResult traverse(int nodeBefore, Switch sw, int nodeAfter) {
if (sw != null) {
if (sw.isOpen()) {
return false;
return TraverseResult.TERMINATE_PATH;
}

if (nodeBefore == initNode && traverserStopsAtOtherStartEdges(sw, initNode)) {
// Switch is just after contingency and traverser stops at other start edges
if (isOpenable(sw)) {
// The traverser can stop now and no need to retain current switch
return false;
return TraverseResult.TERMINATE_PATH;
}
if (traverserWouldStopAfter(sw, nodeAfter)) {
// As the traverser would stop just after, it can stop now (without retaining current switch)
return false;
return TraverseResult.TERMINATE_PATH;
}
}

Expand All @@ -54,21 +55,21 @@ public boolean traverse(int nodeBefore, Switch sw, int nodeAfter) {
if (traverserWouldStopAfter(sw, nodeAfter)) {
// Continuing traversing might lead in some cases to more retained switches, but in practice the
// switches after are often opened and sometimes followed by an end node
return true;
return TraverseResult.CONTINUE;
}
if (isEquivalentToStopAfterSwitch(sw, nodeAfter)) {
// Retaining the switch is equivalent to stop at the node after if the node after the switch is an end node (e.g. load or generator)
sw.getVoltageLevel().getNodeBreakerView().getOptionalTerminal(nodeAfter).ifPresent(traversedTerminals::add);
return false;
return TraverseResult.TERMINATE_PATH;
}
switchesToOpen.add(sw);
return false;
return TraverseResult.TERMINATE_PATH;
}
}

// The traverser continues, hence nodeAfter is traversed
nodeBreakerView.getOptionalTerminal(nodeAfter).ifPresent(traversedTerminals::add);
return true;
return TraverseResult.CONTINUE;
}

private static boolean isEquivalentToStopAfterSwitch(Switch sw, int nodeAfter) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/debug-network.xiidm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_5" id="test" caseDate="2021-04-25T13:47:34.697+02:00" forecastDistance="0" sourceFormat="code">
<iidm:network xmlns:iidm="http://www.powsybl.org/schema/iidm/1_6" id="test" caseDate="2021-04-25T13:47:34.697+02:00" forecastDistance="0" sourceFormat="code">
<iidm:substation id="b1_s" country="FR">
<iidm:voltageLevel id="b1_vl" nominalV="1.0" topologyKind="BUS_BREAKER">
<iidm:busBreakerTopology>
Expand Down