Skip to content

Comments

Force global 2P#1294

Merged
bqth29 merged 27 commits intomainfrom
disable_non_global_2p
Aug 28, 2025
Merged

Force global 2P#1294
bqth29 merged 27 commits intomainfrom
disable_non_global_2p

Conversation

@phiedw
Copy link
Collaborator

@phiedw phiedw commented Mar 5, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?

Fixes #1422
fix in Leaf:getRaLimitationParameters : in 2P global optimization, we didn't take into account the already applied topological actions, leading to erroneous ra limits.

What kind of change does this PR introduce?

Code cleaning

What is the current behavior?

We allow to run a non global opt 2P (where we only reoptimize preventive remedial actions). This requires us to disable many actions (including preventive) for various reasons linking curative optimization to preventive. It also complicates the results structure a lot. And it gives worst results for little performance gain.

What is the new behavior (if this is a feature change)?
We now force global opt 2P, reoptimizing preventive actions and curative PSTs.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Users will have to remove the "re-optimize-curative-range-actions" field from parameters.

Other information:

Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
@phiedw phiedw added cleaning breaking-change Changes could break users' code labels Mar 5, 2025
bqth29 added 2 commits June 23, 2025 17:13
# Conflicts:
#	ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/result/impl/PreventiveAndCurativesRaoResultImpl.java
#	tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_13_1.json
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
# Conflicts:
#	ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SecondPreventiveRaoParameters.java
#	ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withOLFParams.json
@bqth29 bqth29 changed the title [WIP] Force global 2P Force global 2P Jul 9, 2025
bqth29 and others added 16 commits July 9, 2025 11:57
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
…P is global

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
@Godelaine Godelaine added the PR: waiting-for-review This PR is waiting to be reviewed label Jul 22, 2025
} else {
return firstCraoResult.isActivated(networkAction);
}
return secondPraoResult.isActivated(networkAction);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem quite coherent with getActivatedNetworkActions below anymore
In isActivated we systematically determine whether a NA was applied or not from the second RAO result whereas getActivatedNetworkActions always relies on the first
I suggest that we also update getActivatedNetworkActions so it uses second RAO results too

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and same for getActivatedNetworkActionsPerState

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more generally I wonder if the first RAO result is useful (except for curative NA) since everything is re-optimized in 2P

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's useful for getRangeActions() : "Some range actions can be excluded from first CRAO (for example if they are only available after a constraint) but re-optimised in second PRAO".
On network actions : this is a curative result, during second preventive no curative network actions are reoptimized, that's why we look in firstCraoResult

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Godelaine and others added 5 commits August 19, 2025 11:29
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
…rao/searchtreerao/searchtree/algorithms/Leaf.java

Co-authored-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Godelaine <87479798+Godelaine@users.noreply.github.com>
…rao/searchtreerao/result/impl/PreventiveAndCurativesRaoResultImplTest.java

Co-authored-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Godelaine <87479798+Godelaine@users.noreply.github.com>
…rao/searchtreerao/result/impl/PreventiveAndCurativesRaoResultImplTest.java

Co-authored-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Godelaine <87479798+Godelaine@users.noreply.github.com>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
79.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@bqth29 bqth29 merged commit 9d70db8 into main Aug 28, 2025
21 checks passed
@terriervik terriervik modified the milestone: OpenRAO 7.0.0 Oct 7, 2025
phiedw added a commit that referenced this pull request Oct 13, 2025
* force global 2P

Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>

* fix after merge

Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>

* bump parameters to v3.2 and add changelog

Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>

* fix tests

Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>

* add comments to getRaLimitationParameters

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* adapt 20.2.2 by using topo CRA to ensure CRA is kept in 2P now that 2P is global

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* clean/ adapt US20_1

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* fix merge

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* delete re-optimize everywhere

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* update parameter files

* update values far from ref

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* fix values

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* add UT to improve sonar

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* checkstyle

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* improve sonar

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* fix test

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* more sonar

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* PR changes

Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>

* Update ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/Leaf.java

Co-authored-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Godelaine <87479798+Godelaine@users.noreply.github.com>

* Update ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/result/impl/PreventiveAndCurativesRaoResultImplTest.java

Co-authored-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Godelaine <87479798+Godelaine@users.noreply.github.com>

* Update ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/result/impl/PreventiveAndCurativesRaoResultImplTest.java

Co-authored-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Godelaine <87479798+Godelaine@users.noreply.github.com>

---------

Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Signed-off-by: Godelaine <87479798+Godelaine@users.noreply.github.com>
Co-authored-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Co-authored-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
Co-authored-by: Godelaine <87479798+Godelaine@users.noreply.github.com>
@phiedw phiedw deleted the disable_non_global_2p branch October 30, 2025 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Changes could break users' code PR: waiting-for-review This PR is waiting to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Force re-optimization of CRAs in Second Preventive RAO

4 participants