-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fast switch position modification #705
Conversation
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
import java.util.stream.Collectors; | ||
|
||
/** | ||
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com> | ||
*/ | ||
public class AcLoadFlowFromCache { | ||
|
||
private static final int MAX_PLAUSIBLE_SWITCHES_TO_RETAIN = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be configurable? Calculated with a heuristic from network size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@annetill any idea of the algorithm to defined this max plausible: a % of the network branch ? but maybe that will be too low for small networks ? or min(percent * branch.size(), 10) or something like this?
# Conflicts: # pom.xml
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
# Conflicts: # src/main/java/com/powsybl/openloadflow/NetworkCache.java # src/test/java/com/powsybl/openloadflow/ac/AcLoadFlowWithCachingTest.java
Kudos, SonarCloud Quality Gate passed! |
Wait, I have to solve the configurable param issue |
@annetill If you don't mind I prefer to postpone this feature to next release |
…lection (#762) Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@@ -159,6 +160,23 @@ private boolean onShuntUpdate(ShuntCompensator shunt, String attribute) { | |||
}); | |||
} | |||
|
|||
private boolean onSwitchOpen(String switchId, boolean open) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method name should be more generic as you support open or close.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to onSwitchUpdate
# Conflicts: # src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java # src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java # src/test/resources/debug-parameters.json
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
@@ -900,6 +918,8 @@ public OpenLoadFlowParameters update(Map<String, String> properties) { | |||
.ifPresent(prop -> this.setMostMeshedSlackBusSelectorMaxNominalVoltagePercentile(Double.parseDouble(prop))); | |||
Optional.ofNullable(properties.get(SLACK_BUS_COUNTRY_FILTER_PARAM_NAME)) | |||
.ifPresent(prop -> this.setSlackBusCountryFilter(parseStringListProp(prop).stream().map(Country::valueOf).collect(Collectors.toSet()))); | |||
Optional.ofNullable(properties.get(ACTIONABLE_SWITCHES_IDS_PARAM_NAME)) | |||
.ifPresent(prop -> this.setActionableSwitchesIds(new HashSet<>(parseStringListProp(prop)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Map -> 42 too, better no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you need a more technical review than mine? Functionally the PR is great, and we need to have a first feed back of our users to be sure that it is the good design with swicthes ids as parameters.
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
SonarCloud Quality Gate failed. |
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com> Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restNo
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature
What is the new behavior (if this is a feature change)?
When network caching is enabled, we can now open or close a switch in fast mode (so reusing most of previous internal data structure) if it has been previously been tagged as retained.
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)