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

Cleaning/intertemporal features cleaner #1289

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bqth29
Copy link
Collaborator

@bqth29 bqth29 commented Feb 25, 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)

Does this PR already have an issue describing the problem?

What kind of change does this PR introduce?

Does this PR introduce a new Powsybl Action implying to be implemented in simulators or pypowsybl?

  • Yes, the corresponding issue is here
  • No

What is the current behavior?

What is the new behavior (if this is a feature change)?

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)

Other information:

bqth29 and others added 7 commits February 20, 2025 14:44
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: CHEN Roxane <roxane.chen@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: CHEN Roxane <roxane.chen@rte-france.com>
…cleaner' into cleaning/intertemporal-features-cleaner
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
/**
* @author Thomas Bouquet {@literal <thomas.bouquet at rte-france.com>}
* @author Roxane Chen {@literal <roxane.chen at rte-france.com>}
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

MaxCostEvaluatorResult seems obsolete. AbstractStateWiseCostEvaluatorResult needs to be merged with SumCostEvaluator or adapted to be abstract with SumMaxPerTimestamp

LinearOptimizationResult linearOptimizationResults = optimizeLinearRemedialActions(raoInput, prePerimeterResults, raoParameters, getPreventiveTopologicalActions(raoInput.getRaoInputs().map(RaoInput::getCrac), topologicalOptimizationResults));
// 4. Build objective function and initial result
ObjectiveFunction objectiveFunction = buildGlobalObjectiveFunction(raoInput.getRaoInputs().map(RaoInput::getCrac), new GlobalFlowResult(prePerimeterResults.map(PrePerimeterResult::getFlowResult)), raoParameters);
TemporalData<NetworkActionsResult> preventiveTopologicalActions = getPreventiveNetworkActions(topologicalOptimizationResults, raoInput.getRaoInputs().map(RaoInput::getCrac));
Copy link
Collaborator

Choose a reason for hiding this comment

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

use getPreventiveTopologicalActions

// 5. Merge topological and linear result
// 5. Create and iteratively solve MIP to find optimal range actions' set-points
OpenRaoLoggerProvider.TECHNICAL_LOGS.info("[MARMOT] ----- Global range actions optimization [start]");
LinearOptimizationResult linearOptimizationResults = optimizeLinearRemedialActions(raoInput, prePerimeterResults, raoParameters, getPreventiveTopologicalActions(raoInput.getRaoInputs().map(RaoInput::getCrac), topologicalOptimizationResults), objectiveFunction);
Copy link
Collaborator

Choose a reason for hiding this comment

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

use preventiveTopologicalActions

@@ -70,4 +70,8 @@ public Map<PstRangeAction, Integer> getOptimizedTapsOnState(State state) {
public int getTapVariation(PstRangeAction pstRangeAction, State state) {
return MarmotUtils.getDataFromState(rangeActionActivationPerTimestamp, state).getTapVariation(pstRangeAction, state);
}

public TemporalData<RangeActionActivationResult> getRangeActionActivationPerTimestamp() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

where is this used ?

}

@Test
public void testEvaluator() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add comments detailing expected results

@@ -27,14 +27,15 @@
import java.util.Set;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
Copy link
Collaborator

Choose a reason for hiding this comment

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

add asserts on cost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants