-
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
Refactor objective function evaluators API and add cost-wise Search-Tree #1186
Conversation
@phiedw what do you think about including the min margin overload in virtual cost? |
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.
I feel that you haven't finished this, let me know when you do
...java/com/powsybl/openrao/data/cracio/json/deserializers/PstRangeActionArrayDeserializer.java
Outdated
Show resolved
Hide resolved
...rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ObjectiveFunctionParameters.java
Outdated
Show resolved
Hide resolved
...owsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/FunctionalCostEvaluator.java
Outdated
Show resolved
Hide resolved
This PR only focuses on costly network actions, range actions will come in another PR later |
...c-io-json/src/main/java/com/powsybl/openrao/data/cracio/json/JsonSerializationConstants.java
Outdated
Show resolved
Hide resolved
...bl/openrao/searchtreerao/commons/objectivefunctionevaluator/RemedialActionCostEvaluator.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/powsybl/openrao/searchtreerao/result/impl/AutomatonPerimeterResultImpl.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/powsybl/openrao/searchtreerao/result/impl/AutomatonPerimeterResultImpl.java
Outdated
Show resolved
Hide resolved
.../java/com/powsybl/openrao/searchtreerao/result/impl/PreventiveAndCurativesRaoResultImpl.java
Show resolved
Hide resolved
...src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java
Outdated
Show resolved
Hide resolved
...java/com/powsybl/openrao/data/cracio/json/deserializers/StandardRangeActionDeserializer.java
Outdated
Show resolved
Hide resolved
...java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysis.java
Outdated
Show resolved
Hide resolved
...va/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/EvaluatorsUtils.java
Outdated
Show resolved
Hide resolved
.../com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java
Outdated
Show resolved
Hide resolved
.../com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java
Outdated
Show resolved
Hide resolved
.../com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/OverloadEvaluator.java
Outdated
Show resolved
Hide resolved
...bl/openrao/searchtreerao/commons/objectivefunctionevaluator/RemedialActionCostEvaluator.java
Outdated
Show resolved
Hide resolved
...bl/openrao/searchtreerao/commons/objectivefunctionevaluator/RemedialActionCostEvaluator.java
Outdated
Show resolved
Hide resolved
...bl/openrao/searchtreerao/commons/objectivefunctionevaluator/RemedialActionCostEvaluator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Peter Mitri <peter.mitri@rte-france.com> Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
…se of violation (#1154) * Round angle value with more decimals in case of violation Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * linter Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Create static method computeNumberOfRelevantDecimals in SweCneUtil Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Sonar Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Export flow as double Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Round double flow value with relevant decimals Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * define rounding noise as class constant Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Move decimals computation to commons Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Round flows, angles and voltages more properly in RaoResult Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Round flows, angles and voltages more properly in RaoResult Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Mutualize rounding using margin value Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * use default decimals in decimals computing Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * use default decimals in decimals computing Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * add docstring Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * simplify angle margin computation Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * round flow value in logs Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * round swe cne export values with 1 default decimal Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * round swe cne export values with 1 default decimal Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * rollback to bigdecimals in rounding tests Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * adapt logging Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com> * MR comments Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com> * generate getters for MonitoringResult Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com> * add cucumber step Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com> * MR comments 2 Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com> --------- Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com> Co-authored-by: Godelaine de Montmorillon <godelaine.demontmorillon@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: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@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: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
* Generify CSA CRAC Creation Parameters Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Add curative instants in parameters Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Create curative instants from crac creation parameters Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * add TODO Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Merge main Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> * Replace list of pair by map Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> --------- Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com> Co-authored-by: benrejebmoh <48012306+benrejebmoh@users.noreply.github.com> Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
# Conflicts: # data/crac/crac-io/crac-io-json/src/main/resources/schemas/network-action/network-action-v1.8.json # data/crac/crac-io/crac-io-json/src/main/resources/schemas/network-action/network-action-v2.5.json # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoLogger.java
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
...search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/FlowCnecSorting.java
Outdated
Show resolved
Hide resolved
...m/powsybl/openrao/searchtreerao/commons/costevaluatorresult/AbsoluteCostEvaluatorResult.java
Show resolved
Hide resolved
.../openrao/searchtreerao/commons/costevaluatorresult/AbstractStateWiseCostEvaluatorResult.java
Outdated
Show resolved
Hide resolved
.../openrao/searchtreerao/commons/costevaluatorresult/AbstractStateWiseCostEvaluatorResult.java
Outdated
Show resolved
Hide resolved
.../openrao/searchtreerao/commons/costevaluatorresult/AbstractStateWiseCostEvaluatorResult.java
Outdated
Show resolved
Hide resolved
...com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MinMarginEvaluator.java
Outdated
Show resolved
Hide resolved
...bl/openrao/searchtreerao/commons/objectivefunctionevaluator/MinMarginViolationEvaluator.java
Show resolved
Hide resolved
...ybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluator.java
Show resolved
Hide resolved
...openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluator.java
Outdated
Show resolved
Hide resolved
...ybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluator.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
.../openrao/searchtreerao/commons/costevaluatorresult/AbstractStateWiseCostEvaluatorResult.java
Outdated
Show resolved
Hide resolved
...bl/openrao/searchtreerao/commons/objectivefunctionevaluator/MinMarginViolationEvaluator.java
Show resolved
Hide resolved
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
# Conflicts: # data/crac/crac-impl/src/main/java/com/powsybl/openrao/data/crac/impl/AbstractStandardRangeActionAdder.java # data/crac/crac-impl/src/test/java/com/powsybl/openrao/data/crac/impl/CounterTradeRangeActionAdderImplTest.java # data/crac/crac-impl/src/test/java/com/powsybl/openrao/data/crac/impl/HvdcRangeActionAdderImplTest.java # data/crac/crac-impl/src/test/java/com/powsybl/openrao/data/crac/impl/InjectionRangeActionAdderImplTest.java # data/crac/crac-impl/src/test/java/com/powsybl/openrao/data/crac/impl/PstRangeActionAdderImplTest.java # data/crac/crac-impl/src/test/java/com/powsybl/openrao/data/crac/impl/utils/ExhaustiveCracCreation.java # data/crac/crac-io/crac-io-json/src/main/java/com/powsybl/openrao/data/crac/io/json/JsonSerializationConstants.java # data/crac/crac-io/crac-io-json/src/main/java/com/powsybl/openrao/data/crac/io/json/serializers/NetworkActionSerializer.java # data/crac/crac-io/crac-io-json/src/main/java/com/powsybl/openrao/data/crac/io/json/serializers/PstRangeActionSerializer.java # data/crac/crac-io/crac-io-json/src/main/java/com/powsybl/openrao/data/crac/io/json/serializers/StandardRangeActionSerializer.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysis.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoLogger.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/CostEvaluator.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluator.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MinMarginEvaluator.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluator.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunctionResultImpl.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/SensitivityFailureOvercostEvaluator.java # ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MinMarginEvaluatorTest.java # ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunctionTest.java # ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/SensitivityFailureOvercostEvaluatorTest.java # ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/result/impl/RangeActionActivationResultImplTest.java
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
# Conflicts: # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/SensitivityFailureOvercostEvaluator.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/result/impl/AutomatonPerimeterResultImpl.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/result/impl/CurativeWithSecondPraoResult.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/result/impl/IteratingLinearOptimizationResultImpl.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/result/impl/OptimizationResultImpl.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/result/impl/PrePerimeterSensitivityResultImpl.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/result/impl/PreventiveAndCurativesRaoResultImpl.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/result/impl/SkippedOptimizationResultImpl.java # ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/result/impl/OptimizationResultImplTest.java # ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/result/impl/PreventiveAndCurativesRaoResultImplTest.java
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
# Conflicts: # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java # ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/result/impl/PreventiveAndCurativesRaoResultImpl.java # ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimizationTest.java
Signed-off-by: Thomas Bouquet <thomas.bouquet@rte-france.com>
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
Fixes #1053
What kind of change does this PR introduce?
Refactoring of objective function evaluators and results
Previously,
ObjectiveFunctionResultImpl
was a non final object that had its ObjectiveFunction as an attribute so it could be recomputed when contingencies need to be filtered out (in case curative perimeters fail for instance). This was quite ambiguous for a result object that should only hold immutable data.In the new version, the results are decomposed based on the states and can be filtered in case contingencies need to be excluded.
Finally, the objective function builder was becoming useless with this refactoring and was thus replaced by creators as follows:
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?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Other information: