Extend Post contingency result with a list of moved phaseShifters#3907
Extend Post contingency result with a list of moved phaseShifters#3907RiadBRD wants to merge 2 commits into
Conversation
…r that have been moved Signed-off-by: Riad Benradi <riad.benradi_externe@rte-france.com>
Signed-off-by: Riad Benradi <riad.benradi_externe@rte-france.com>
|
| public class PhaseShifterResultsExtension extends AbstractExtension<PostContingencyResult> implements Extension<PostContingencyResult> { | ||
|
|
||
| // Conventionnellement, les noms d'extension sont en minuscules et séparés par des tirets | ||
| public static final String NAME = "phase-shifter-results"; |
There was a problem hiding this comment.
In Powsybl, it seems that extension name are in camel case : phaseShifterResults
| /** | ||
| * @author Riad BENRADI {@literal <riad.benradi_externe@ at rte-france.com>} | ||
| */ | ||
| public class PhaseShifterResultsExtension extends AbstractExtension<PostContingencyResult> implements Extension<PostContingencyResult> { |
There was a problem hiding this comment.
I am not sure this is necessary to implement the interface Extension here (already done in AbstractExtension)
| * @author Mathieu Bague {@literal <mathieu.bague at rte-france.com>} | ||
| */ | ||
| public class PostContingencyResult extends AbstractContingencyResult { | ||
| public class PostContingencyResult extends AbstractContingencyResult implements Extendable<PostContingencyResult> { |
There was a problem hiding this comment.
A little bit broader than the scope of this PR: but I would suggest to make AbstractContingencyResult implement Extendable (so that PreContingencyResult can be extendable also, in case we need details about the simulation of pre contingency state)
| this.movedPhaseShifterIds = Objects.requireNonNull(movedPhaseShifterIds, "Moved phase shifter IDs cannot be null"); | ||
| } | ||
|
|
||
| public List<String> getMovedPhaseShifterIds() { |
There was a problem hiding this comment.
Suggestion, what about creating a subclass PhaseShifterResult (without an s)
public class MovedPhaseShifterResult {
private final String transformerId;
private final int initialTap;
private final int newTap;
}
And storing a Map<String, MovedPhaseShifterResult> in this extension
(See NetworkResult and its use of BranchResult for a similar use case)
This is a suggestion, but not sure of its relevance


Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
feature
What is the new behavior (if this is a feature change)?
add a list of all phaseShifters that have been moved after a loadflow into the post contingency results
Does this PR introduce a breaking change or deprecate an API?