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

Modify isRemedialActionAvailable to use a FlowResult #875

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static boolean isAnyMarginNegative(FlowResult flowResult, Set<FlowCnec> f
* For automatonState, the remedial action is available if and only if the usage method is "FORCED".
* For other states, the remedial action is available if and only if the usage method is "AVAILABLE".
*/
public static boolean isRemedialActionAvailable(RemedialAction<?> remedialAction, State state, PrePerimeterResult prePerimeterResult, Set<FlowCnec> flowCnecs, Network network, RaoParameters raoParameters) {
public static boolean isRemedialActionAvailable(RemedialAction<?> remedialAction, State state, FlowResult prePerimeterResult, Set<FlowCnec> flowCnecs, Network network, RaoParameters raoParameters) {
Set<UsageRule> usageRules = remedialAction.getUsageRules();
if (usageRules.isEmpty()) {
OpenRaoLoggerProvider.BUSINESS_WARNS.warn(format("The remedial action %s has no usage rule and therefore will not be available.", remedialAction.getName()));
Expand Down Expand Up @@ -165,7 +165,7 @@ public static boolean isRemedialActionAvailable(RemedialAction<?> remedialAction
* Returns a set of usageMethods corresponding to a remedialAction.
* It filters out every OnFlowConstraint(InCountry) that is not applicable due to positive margins.
*/
private static Set<UsageMethod> getAllUsageMethods(Set<UsageRule> usageRules, RemedialAction<?> remedialAction, State state, PrePerimeterResult prePerimeterResult, Set<FlowCnec> flowCnecs, Network network, RaoParameters raoParameters) {
private static Set<UsageMethod> getAllUsageMethods(Set<UsageRule> usageRules, RemedialAction<?> remedialAction, State state, FlowResult prePerimeterResult, Set<FlowCnec> flowCnecs, Network network, RaoParameters raoParameters) {
return usageRules.stream()
.filter(ur -> ur instanceof OnContingencyState || ur instanceof OnInstant
|| (ur instanceof OnFlowConstraint || ur instanceof OnFlowConstraintInCountry)
Expand Down
Loading