diff --git a/data/result-exporter/core-cne-exporter/src/test/java/com/powsybl/openrao/data/corecneexporter/CoreCneCnecsCreatorTest.java b/data/result-exporter/core-cne-exporter/src/test/java/com/powsybl/openrao/data/corecneexporter/CoreCneCnecsCreatorTest.java index 34829e7bd1..837e4385a4 100644 --- a/data/result-exporter/core-cne-exporter/src/test/java/com/powsybl/openrao/data/corecneexporter/CoreCneCnecsCreatorTest.java +++ b/data/result-exporter/core-cne-exporter/src/test/java/com/powsybl/openrao/data/corecneexporter/CoreCneCnecsCreatorTest.java @@ -171,7 +171,7 @@ void testExportTwoPreventiveCnecs() { mockCnecResult(cnec2, 800, -200, -999999999, .2); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneCnecsCreator cneCnecsCreator = new CoreCneCnecsCreator(cneHelper, new MockCracCreationContext(crac)); @@ -223,7 +223,7 @@ void testExportPreventivePureMnec() { mockCnecResult(cnec1, 80, 20, 200, .1); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneCnecsCreator cneCnecsCreator = new CoreCneCnecsCreator(cneHelper, new MockCracCreationContext(crac)); @@ -261,7 +261,7 @@ void testExportPreventiveCnecAndMnec() { mockCnecResult(cnec1, 80, 20, 200, .1); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneCnecsCreator cneCnecsCreator = new CoreCneCnecsCreator(cneHelper, new MockCracCreationContext(crac)); @@ -338,7 +338,7 @@ void testCurativeCnecs() { mockCnecResult(cnecOutage, 85, 25, 205, .1); mockCnecResult(cnecCur, 85, 28, 208, .1); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); when(raoResult.getActivatedNetworkActionsDuringState(crac.getState(cnecCur.getState().getContingency().orElseThrow(), curativeInstant))).thenReturn(Set.of(Mockito.mock(NetworkAction.class))); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneCnecsCreator cneCnecsCreator = new CoreCneCnecsCreator(cneHelper, new MockCracCreationContext(crac)); @@ -391,7 +391,7 @@ void testWithLoopFlow() { mockCnecResult(cnec1, 80, 20, 200, .1); Mockito.when(raoResult.getLoopFlow(any(), eq(cnec1), eq(TwoSides.TWO), eq(Unit.MEGAWATT))).thenReturn(123.); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneCnecsCreator cneCnecsCreator = new CoreCneCnecsCreator(cneHelper, new MockCracCreationContext(crac)); diff --git a/data/result-exporter/core-cne-exporter/src/test/java/com/powsybl/openrao/data/corecneexporter/CoreCneRemedialActionsCreatorTest.java b/data/result-exporter/core-cne-exporter/src/test/java/com/powsybl/openrao/data/corecneexporter/CoreCneRemedialActionsCreatorTest.java index 66dad848c9..5ed327f844 100644 --- a/data/result-exporter/core-cne-exporter/src/test/java/com/powsybl/openrao/data/corecneexporter/CoreCneRemedialActionsCreatorTest.java +++ b/data/result-exporter/core-cne-exporter/src/test/java/com/powsybl/openrao/data/corecneexporter/CoreCneRemedialActionsCreatorTest.java @@ -116,7 +116,7 @@ void testPstInitialSetpoint() { Mockito.when(raoResult.isActivatedDuringState(crac.getStates().iterator().next(), pstRangeAction)).thenReturn(true); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneRemedialActionsCreator cneRemedialActionsCreator = new CoreCneRemedialActionsCreator(cneHelper, new MockCracCreationContext(crac), new ArrayList<>()); @@ -152,7 +152,7 @@ void testPstInitialSetpointUnused() { Mockito.when(raoResult.isActivatedDuringState(crac.getStates().iterator().next(), pstRangeAction)).thenReturn(false); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneRemedialActionsCreator cneRemedialActionsCreator = new CoreCneRemedialActionsCreator(cneHelper, new MockCracCreationContext(crac), new ArrayList<>()); @@ -174,7 +174,7 @@ void testIgnorePstWithNoUsageRule() { Mockito.when(raoResult.getActivatedRangeActionsDuringState(any())).thenReturn(Set.of(pstRangeAction)); Mockito.when(raoResult.isActivatedDuringState(crac.getStates().iterator().next(), pstRangeAction)).thenReturn(true); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneRemedialActionsCreator cneRemedialActionsCreator = new CoreCneRemedialActionsCreator(cneHelper, new MockCracCreationContext(crac), new ArrayList<>()); @@ -200,7 +200,7 @@ void testPstUsedInPreventive() { Mockito.when(raoResult.getOptimizedTapOnState(crac.getPreventiveState(), pstRangeAction)).thenReturn(16); Mockito.when(raoResult.isActivatedDuringState(crac.getStates().iterator().next(), pstRangeAction)).thenReturn(true); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneRemedialActionsCreator cneRemedialActionsCreator = new CoreCneRemedialActionsCreator(cneHelper, new MockCracCreationContext(crac), cnecsConstraintSeries); @@ -253,7 +253,7 @@ void testPstUsedInCurative() { Mockito.when(raoResult.getOptimizedTapOnState(crac.getState("contingency-id", curativeInstant), pstRangeAction)).thenReturn(16); Mockito.when(raoResult.isActivatedDuringState(crac.getStates().iterator().next(), pstRangeAction)).thenReturn(true); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneRemedialActionsCreator cneRemedialActionsCreator = new CoreCneRemedialActionsCreator(cneHelper, new MockCracCreationContext(crac), cnecsConstraintSeries); @@ -301,7 +301,7 @@ void testIgnoreNetworkActionWithNoUsageRule() { Mockito.when(raoResult.getActivatedNetworkActionsDuringState(any())).thenReturn(Set.of(networkAction)); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneRemedialActionsCreator cneRemedialActionsCreator = new CoreCneRemedialActionsCreator(cneHelper, new MockCracCreationContext(crac), new ArrayList<>()); @@ -321,7 +321,7 @@ void testNetworkActionUsedInPreventive() { Mockito.when(raoResult.getActivatedNetworkActionsDuringState(crac.getPreventiveState())).thenReturn(Set.of(networkAction)); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneRemedialActionsCreator cneRemedialActionsCreator = new CoreCneRemedialActionsCreator(cneHelper, new MockCracCreationContext(crac), cnecsConstraintSeries); @@ -365,7 +365,7 @@ void testNetworkActionUsedInCurative() { Mockito.when(raoResult.getActivatedNetworkActionsDuringState(crac.getState("contingency-id", outageInstant))).thenReturn(new HashSet()); Mockito.when(raoResult.getActivatedNetworkActionsDuringState(crac.getState("contingency-id", curativeInstant))).thenReturn(Set.of(networkAction)); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); CoreCneRemedialActionsCreator cneRemedialActionsCreator = new CoreCneRemedialActionsCreator(cneHelper, new MockCracCreationContext(crac), cnecsConstraintSeries); @@ -411,7 +411,7 @@ void testPstInitialSetpointInverted() { Mockito.when(raoResult.isActivatedDuringState(crac.getStates().iterator().next(), pstRangeAction)).thenReturn(true); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); UcteCracCreationContext cracCreationContext = new MockCracCreationContext(crac); MockCracCreationContext.MockRemedialActionCreationContext raContext = (MockCracCreationContext.MockRemedialActionCreationContext) cracCreationContext.getRemedialActionCreationContexts().get(0); @@ -455,7 +455,7 @@ void testPstUsedInPreventiveInverted() { Mockito.when(raoResult.getOptimizedTapOnState(crac.getPreventiveState(), pstRangeAction)).thenReturn(16); Mockito.when(raoResult.isActivatedDuringState(crac.getStates().iterator().next(), pstRangeAction)).thenReturn(true); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); UcteCracCreationContext cracCreationContext = new MockCracCreationContext(crac); MockCracCreationContext.MockRemedialActionCreationContext raContext = (MockCracCreationContext.MockRemedialActionCreationContext) cracCreationContext.getRemedialActionCreationContexts().get(0); @@ -511,7 +511,7 @@ void testPstUsedInCurativeInverted() { Mockito.when(raoResult.getOptimizedTapOnState(crac.getState("contingency-id", curativeInstant), pstRangeAction)).thenReturn(16); Mockito.when(raoResult.isActivatedDuringState(crac.getState("contingency-id", curativeInstant), pstRangeAction)).thenReturn(true); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); CneHelper cneHelper = new CneHelper(crac, raoResult, raoParameters, exporterParameters); UcteCracCreationContext cracCreationContext = new MockCracCreationContext(crac); MockCracCreationContext.MockRemedialActionCreationContext raContext = (MockCracCreationContext.MockRemedialActionCreationContext) cracCreationContext.getRemedialActionCreationContexts().get(0); diff --git a/distribution/src/main/resources/config.yml b/distribution/src/main/resources/config.yml index 6519739212..ef10652b15 100755 --- a/distribution/src/main/resources/config.yml +++ b/distribution/src/main/resources/config.yml @@ -35,7 +35,7 @@ rao: default: SearchTreeRao rao-parameters: - objective-function: MAX_MIN_MARGIN_IN_MEGAWATT + objective-function: MAX_MIN_MARGIN max-number-of-iterations: 2 pst-penalty-cost: 0.01 pst-sensitivity-threshold : 0.2 diff --git a/docs/castor/linear-problem/max-min-relative-margin-filler.md b/docs/castor/linear-problem/max-min-relative-margin-filler.md index aa4f3917b3..c2432beb78 100644 --- a/docs/castor/linear-problem/max-min-relative-margin-filler.md +++ b/docs/castor/linear-problem/max-min-relative-margin-filler.md @@ -19,9 +19,9 @@ And $PTDF_{zTos}(z1, c)$, the zone-to-slack PTDF of bidding zone $z1$ on CNEC $c ## Used parameters -| Name | Symbol | Details | -|------------------------------------------------------------------------|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [type](/parameters.md#type) | | This filler is only used if the objective function is MAX_MIN_MARGIN_IN_MEGAWATT, or MAX_MIN_MARGIN_IN_AMPERE. This parameter is also used to set the unit (AMPERE/MW) of the objective function | +| Name | Symbol | Details | +|------------------------------------------------------------------------|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [type](/parameters.md#type) | | This filler is only used if the objective function is MAX_MIN_MARGIN | | [ptdf-sum-lower-bound](/parameters.md#ptdf-sum-lower-bound) | $\varepsilon_{PTDF}$ | zToz PTDF sum below this value are lifted to the ptdf-sum-lower-bound, to avoid a bad conditionning of the problem where the value of relative margins are very high.
*Its impact on the accuracy of the problem is insignificant, as high relative margins do not usually define the min. relative margin.* | ## Defined optimization variables diff --git a/docs/output-data/rao-result/steps.md b/docs/output-data/rao-result/steps.md index b5f521cf5d..d0021112e3 100644 --- a/docs/output-data/rao-result/steps.md +++ b/docs/output-data/rao-result/steps.md @@ -1,5 +1,5 @@ This field contains macro information about which steps the [CASTOR RAO](/castor.md#algorithm) executed. -(See also: [Forbidding cost increase](/parameters.md#forbid-cost-increase), [Second preventive RAO parameters](/parameters.md#second-preventive-rao-parameters)) +(See also: [Second preventive RAO parameters](/parameters.md#second-preventive-rao-parameters)) | Value | Did CASTOR run a 1st preventive RAO? | Did CASTOR run a 2nd preventive RAO? | Did the RAO fall back to initial situation? | Did the RAO fall back to 1st preventive RAO result even though a 2nd was run? | |----------------------------------------------------------|--------------------------------------|--------------------------------------|---------------------------------------------|-------------------------------------------------------------------------------| diff --git a/docs/parameters.md b/docs/parameters.md index dfca226a3e..e6ba6c2166 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -21,35 +21,15 @@ These parameters should be always set in the RAO parameters file or object. These parameters (objective-function) configure the remedial action optimisation's objective function. #### type - - **Expected value**: one of the following: - - "MAX_MIN_MARGIN_IN_MEGAWATT" - - "MAX_MIN_MARGIN_IN_AMPERE" - - "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT" - - "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE" -- **Default value**: "MAX_MIN_MARGIN_IN_MEGAWATT" + - "MAX_MIN_MARGIN" + - "MAX_MIN_RELATIVE_MARGIN" +- **Default value**: "MAX_MIN_MARGIN" - **Usage**: this parameter sets the objective function of the RAO. For now, the existing objective function are: - - **MAX_MIN_MARGIN_IN_MEGAWATT**: maximization of the min(margin), where min(margin) is the smallest margin of all - CNECs and the margins are considered in MW. - - **MAX_MIN_MARGIN_IN_AMPERE**: maximization of the min(margin), where min(margin) is the smallest margin of all CNECs - and the margins are considered in A. Note that this objective function is not just a homothety of the previous one, - as CNECs from different voltage levels will not have the same weight in the objective function depending on the unit - considered (MW or A). This objective function only works in AC-load-flow mode (see [sensitivity-parameters](#sensitivity-parameters)). - - **MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT**: same as MAX_MIN_MARGIN_IN_MEGAWATT, but the margins will be relative + - **MAX_MIN_MARGIN**: maximization of the min(margin), where min(margin) is the smallest margin of all + CNECs. + - **MAX_MIN_RELATIVE_MARGIN**: same as MAX_MIN_MARGIN, but the margins will be relative (divided by the absolute sum of PTDFs) when they are positive. - - **MAX_MIN_RELATIVE_MARGIN_IN_AMPERE**: same as MAX_MIN_MARGIN_IN_AMPERE, but the margins will be relative (divided - by the absolute sum of PTDFs) when they are positive. - -#### forbid-cost-increase -- **Expected value**: true/false -- **Default value**: false -- **Usage**: if this parameter is set to true, OpenRAO will post-check the results after optimisation. If the value of - the objective function is worse after optimisation than before optimisation, then it will return the initial - solution (i.e. no PRA and no CRA applied). - This can happen for example if the preventive RAO decreases the margin on a curative CNEC, which cannot be reverted - during curative RAO. - If this parameter is set to false, OpenRAO will return the real result of optimisation, which has a worse result - than the initial situation. #### preventive-stop-criterion - **Expected value**: one of the following: @@ -62,34 +42,13 @@ These parameters (objective-function) configure the remedial action optimisation - **SECURE**: the search-tree will stop as soon as it finds a solution where the minimum margin is positive. *Note: if the best possible minimum margin is negative, both stop criterion will return the same solution.* -#### curative-stop-criterion -- **Expected value**: one of the following: - - "MIN_OBJECTIVE" - - "SECURE" - - "PREVENTIVE_OBJECTIVE" - - "PREVENTIVE_OBJECTIVE_AND_SECURE" -- **Default value**: "MIN_OBJECTIVE" -- **Usage**: stop criterion for the curative RAO search-tree. - - **MIN_OBJECTIVE**: the search-tree will maximize the minimum margin until it converges to a - maximum value, or until another stop criterion has been reached (e.g. [max-curative-search-tree-depth](#max-curative-search-tree-depth)). - - **SECURE**: the search-tree will stop as soon as it finds a solution where the minimum margin is positive. - - **PREVENTIVE_OBJECTIVE**: the search-tree will stop as soon as the preventive RAO's objective value is reached, - and improved by at least ["curative-rao-min-obj-improvement"](#curative-min-obj-improvement). - - **PREVENTIVE_OBJECTIVE_AND_SECURE**: the search-tree will stop as soon as the preventive RAO's objective value is - reached, and improved by at least ["curative-rao-min-obj-improvement"](#curative-min-obj-improvement), and all - margins are positive. - - *The values "PREVENTIVE_OBJECTIVE" and "PREVENTIVE_OBJECTIVE_AND_SECURE" allow you to speed up the curative RAO - without deteriorating the final solution (minimum margin over all perimeters). However, using them means the flow-based - domain is not maximised for all perimeters.* - #### curative-min-obj-improvement - **Expected value**: numeric value, where the unit is that of the objective function - **Default value**: 0 - **Usage**: used as a minimum improvement of the preventive RAO objective value for the curative RAO stop criterion, when it is set to PREVENTIVE_OBJECTIVE or PREVENTIVE_OBJECTIVE_AND_SECURE. -#### optimize-curative-if-preventive-unsecure +#### enforce-curative-security - **Expected value**: true/false - **Default value**: false - **Usage**: if this parameter is set to true, OpenRAO will continue optimizing curative states even if preventive state @@ -325,7 +284,7 @@ These parameters (second-preventive-rao) tune the behaviour of the [second preve during curative RAO - **POSSIBLE_CURATIVE_IMPROVEMENT**: a 2nd preventive RAO is run only if it is possible to improve a curative perimeter, i.e. if the curative RAO stop criterion on at least one contingency is not reached. - This depends on the value of parameter [curative-stop-criterion](#curative-stop-criterion): + This depends on the value of parameter [preventive-stop-criterion](#preventive-stop-criterion): - **SECURE**: 2nd preventive RAO is run if one curative perimeter is not secure after optimisation - **PREVENTIVE_OBJECTIVE**: 2nd preventive RAO is run if one curative perimeter reached an objective function value after optimisation that is worse than the preventive perimeter's (decreased by [curative-min-obj-improvement](#curative-min-obj-improvement)) @@ -583,12 +542,10 @@ Zones are seperated by + or -. { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_RELATIVE_MARGIN", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE", - "optimize-curative-if-preventive-unsecure" : true + "enforce-curative-security" : true }, "range-actions-optimization" : { "max-mip-iterations" : 5, @@ -703,9 +660,8 @@ Zones are seperated by + or -. Based on PowSyBl's [configuration mechanism](inv:powsyblcore:std:doc#user/configuration/index). ~~~yaml rao-objective-function: - type: MAX_MIN_MARGIN_IN_AMPERE + type: MAX_MIN_MARGIN preventive-stop-criterion: SECURE - curative-stop-criterion: SECURE rao-range-actions-optimization: max-mip-iterations: 5 diff --git a/docs/tutorial.md b/docs/tutorial.md index fe5822d206..768fa41d7b 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -293,9 +293,9 @@ loadFlowAndSensitivityParameters.setLoadFlowProvider("OpenLoadFlow"); loadFlowAndSensitivityParameters.setSensitivityWithLoadFlowParameters(sensitivityAnalysisParameters); raoParameters.setLoadFlowAndSensitivityParameters(loadFlowAndSensitivityParameters); -// Ask the RAO to maximize minimum margin in MW, and to stop when network is secure (i.e. when margins are positive) +// Ask the RAO to maximize minimum margin, and to stop when network is secure (i.e. when margins are positive) ObjectiveFunctionParameters objectiveFunctionParameters = new ObjectiveFunctionParameters(); -objectiveFunctionParameters.setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); +objectiveFunctionParameters.setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); objectiveFunctionParameters.setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); objectiveFunctionParameters.setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.SECURE); raoParameters.setObjectiveFunctionParameters(objectiveFunctionParameters); @@ -575,9 +575,9 @@ public class Main { loadFlowAndSensitivityParameters.setSensitivityWithLoadFlowParameters(sensitivityAnalysisParameters); raoParameters.setLoadFlowAndSensitivityParameters(loadFlowAndSensitivityParameters); - // Ask the RAO to maximize minimum margin in MW, and to stop when network is secure (i.e. when margins are positive) + // Ask the RAO to maximize minimum margin, and to stop when network is secure (i.e. when margins are positive) ObjectiveFunctionParameters objectiveFunctionParameters = new ObjectiveFunctionParameters(); - objectiveFunctionParameters.setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); + objectiveFunctionParameters.setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); objectiveFunctionParameters.setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); objectiveFunctionParameters.setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.SECURE); raoParameters.setObjectiveFunctionParameters(objectiveFunctionParameters); diff --git a/python-util/rao_parameter_modification.py b/python-util/rao_parameter_modification.py new file mode 100644 index 0000000000..7eac1717cd --- /dev/null +++ b/python-util/rao_parameter_modification.py @@ -0,0 +1,107 @@ +# Copyright (c) 2024, RTE (http://www.rte-france.com) +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# SPDX-License-Identifier: MPL-2.0 + +import os +import json +from json import JSONDecodeError +import yaml + +current_directory = os.getcwd() + + +tag_by_file_type = {"json": "objective-function", "yaml": "rao-objective-function"} + +def rao_parameters_file(file_path): + # do not work with yaml yet + correct_version = False + score = 0 + if "target" not in file_path and (file_path.endswith(".json") or file_path.endswith(".yml")): + ftype = "json" if file_path.endswith(".json") else "yaml" + with open(os.path.join(dirpath, filename), 'r') as file: + for line in file: + if '"version" : "2.4"' in line or '"version" : "2.5"' in line: + correct_version = True + if tag_by_file_type[ftype] in line: + score += 1 + if "MAX_MIN_MARGIN" in line or "MAX_MIN_RELATIVE_MARGIN" in line: + score += 1 + if correct_version and score >= 2: + return True + return False + +def read_data(file_path) -> tuple[dict, str]: + if file_path.endswith(".json"): + with open(file_path, 'r') as file: + try: + return json.load(file), "json" + except JSONDecodeError as je: + print("in file " + file_path) + raise je + if file_path.endswith(".yml"): + with open(file_path, 'r') as file: + return yaml.safe_load(file), "yaml" # ["rao-parameters"] + +def extract_leading_whitespace(line): + leading_whitespace = "" + for char in line: + if char.isspace(): + leading_whitespace += char + else: + break + return leading_whitespace + +def write_data(new_data, file_path, file_type): + with open(file_path, 'r') as file: + lines = file.readlines() + lines_to_write = [] + inside_obj_fun_to_replace = False + for line in lines: + if tag_by_file_type[file_type] in line and tag_by_file_type[file_type] in new_data: + leading_whitespace = extract_leading_whitespace(line) + inside_obj_fun_to_replace = True + if inside_obj_fun_to_replace and ((file_type == "json" and "}" in line) or (file_type == "yaml" and line == "\n")): + obj_fun_str = f'"{tag_by_file_type[file_type]}" : ' + obj_function_as_str_lines(new_data, file_type) + for new_line in obj_fun_str.splitlines(True): + lines_to_write.append(leading_whitespace + new_line) + inside_obj_fun_to_replace = False + elif not inside_obj_fun_to_replace: + lines_to_write.append(line) + with open(file_path, 'w') as file: + file.writelines(lines_to_write) + + +def obj_function_as_str_lines(new_data, file_type): + if file_type == "json": + return json.dumps(new_data[tag_by_file_type[file_type]], indent=2, separators=(',', ' : ')) + ',\n' + else: + return yaml.dump(new_data[tag_by_file_type[file_type]], default_flow_style=False) + '\n' + + + +def new_rao_param(data: dict, file_path: str, file_type: str) -> dict: + try: + obj_fun = data[tag_by_file_type[file_type]] + if "type" in obj_fun and "MAX_MIN_MARGIN" in obj_fun["type"]: + obj_fun["type"] = "MAX_MIN_MARGIN" + if "type" in obj_fun and "MAX_MIN_RELATIVE_MARGIN" in obj_fun["type"]: + obj_fun["type"] = "MAX_MIN_RELATIVE_MARGIN" + except KeyError as ke: + raise KeyError("in file " + file_path) from ke + data[tag_by_file_type[file_type]] = obj_fun + return data + + + +if __name__ == "__main__": + base_dir = os.path.join(current_directory, "..") + print(base_dir) + for dirpath, dirnames, filenames in os.walk(base_dir): + for filename in filenames: + file_path = os.path.join(dirpath, filename) + if rao_parameters_file(file_path): + data, file_type = read_data(file_path) + new_rao_params = new_rao_param(data, file_path, file_type) + write_data(new_rao_params, file_path, file_type) diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java index 17a65285c0..fa0bcae7af 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java @@ -16,7 +16,7 @@ public final class RaoParametersCommons { private RaoParametersCommons() { } - public static final String RAO_PARAMETERS_VERSION = "2.4"; + public static final String RAO_PARAMETERS_VERSION = "2.5"; // header public static final String VERSION = "version"; @@ -25,11 +25,9 @@ private RaoParametersCommons() { public static final String OBJECTIVE_FUNCTION = "objective-function"; public static final String OBJECTIVE_FUNCTION_SECTION = "rao-objective-function"; public static final String TYPE = "type"; - public static final String FORBID_COST_INCREASE = "forbid-cost-increase"; public static final String CURATIVE_MIN_OBJ_IMPROVEMENT = "curative-min-obj-improvement"; public static final String PREVENTIVE_STOP_CRITERION = "preventive-stop-criterion"; - public static final String CURATIVE_STOP_CRITERION = "curative-stop-criterion"; - public static final String OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE = "optimize-curative-if-preventive-unsecure"; + public static final String ENFORCE_CURATIVE_SECURITY = "enforce-curative-security"; // range actions optimization parameters public static final String RANGE_ACTIONS_OPTIMIZATION = "range-actions-optimization"; diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java index 9a7b51f9d0..34f8a0809d 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java @@ -27,11 +27,9 @@ private JsonObjectiveFunctionParameters() { static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeObjectFieldStart(OBJECTIVE_FUNCTION); jsonGenerator.writeObjectField(TYPE, parameters.getObjectiveFunctionParameters().getType()); - jsonGenerator.writeBooleanField(FORBID_COST_INCREASE, parameters.getObjectiveFunctionParameters().getForbidCostIncrease()); jsonGenerator.writeObjectField(PREVENTIVE_STOP_CRITERION, parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()); - jsonGenerator.writeObjectField(CURATIVE_STOP_CRITERION, parameters.getObjectiveFunctionParameters().getCurativeStopCriterion()); jsonGenerator.writeNumberField(CURATIVE_MIN_OBJ_IMPROVEMENT, parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement()); - jsonGenerator.writeBooleanField(OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE, parameters.getObjectiveFunctionParameters().getOptimizeCurativeIfPreventiveUnsecure()); + jsonGenerator.writeBooleanField(ENFORCE_CURATIVE_SECURITY, parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()); jsonGenerator.writeEndObject(); } @@ -41,23 +39,16 @@ static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) thro case TYPE: raoParameters.getObjectiveFunctionParameters().setType(stringToObjectiveFunction(jsonParser.nextTextValue())); break; - case FORBID_COST_INCREASE: - jsonParser.nextToken(); - raoParameters.getObjectiveFunctionParameters().setForbidCostIncrease(jsonParser.getBooleanValue()); - break; case PREVENTIVE_STOP_CRITERION: raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(stringToPreventiveStopCriterion(jsonParser.nextTextValue())); break; - case CURATIVE_STOP_CRITERION: - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(stringToCurativeStopCriterion(jsonParser.nextTextValue())); - break; case CURATIVE_MIN_OBJ_IMPROVEMENT: jsonParser.nextToken(); raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(jsonParser.getValueAsDouble()); break; - case OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE: + case ENFORCE_CURATIVE_SECURITY: jsonParser.nextToken(); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(jsonParser.getBooleanValue()); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(jsonParser.getBooleanValue()); break; default: throw new OpenRaoException(String.format("Cannot deserialize objective function parameters: unexpected field in %s (%s)", OBJECTIVE_FUNCTION, jsonParser.getCurrentName())); @@ -81,12 +72,4 @@ private static ObjectiveFunctionParameters.PreventiveStopCriterion stringToPreve } } - private static ObjectiveFunctionParameters.CurativeStopCriterion stringToCurativeStopCriterion(String string) { - try { - return ObjectiveFunctionParameters.CurativeStopCriterion.valueOf(string); - } catch (IllegalArgumentException e) { - throw new OpenRaoException(String.format("Unknown curative stop criterion: %s", string)); - } - } - } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ObjectiveFunctionParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ObjectiveFunctionParameters.java index f6d53f1491..2138fded7c 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ObjectiveFunctionParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ObjectiveFunctionParameters.java @@ -7,7 +7,6 @@ package com.powsybl.openrao.raoapi.parameters; -import com.powsybl.openrao.commons.Unit; import com.powsybl.commons.config.PlatformConfig; import java.util.Objects; @@ -21,39 +20,23 @@ */ public class ObjectiveFunctionParameters { // Default values - private static final ObjectiveFunctionType DEFAULT_OBJECTIVE_FUNCTION = ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT; - private static final boolean DEFAULT_FORBID_COST_INCREASE = false; + private static final ObjectiveFunctionType DEFAULT_OBJECTIVE_FUNCTION = ObjectiveFunctionType.MAX_MIN_MARGIN; private static final double DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT = 0; private static final PreventiveStopCriterion DEFAULT_PREVENTIVE_STOP_CRITERION = PreventiveStopCriterion.SECURE; - private static final CurativeStopCriterion DEFAULT_CURATIVE_STOP_CRITERION = CurativeStopCriterion.MIN_OBJECTIVE; - private static final boolean DEFAULT_OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE = false; + private static final boolean DEFAULT_ENFORCE_CURATIVE_SECURITY = false; // Attributes private ObjectiveFunctionType type = DEFAULT_OBJECTIVE_FUNCTION; - private boolean forbidCostIncrease = DEFAULT_FORBID_COST_INCREASE; private double curativeMinObjImprovement = DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT; private PreventiveStopCriterion preventiveStopCriterion = DEFAULT_PREVENTIVE_STOP_CRITERION; - private CurativeStopCriterion curativeStopCriterion = DEFAULT_CURATIVE_STOP_CRITERION; - private boolean optimizeCurativeIfPreventiveUnsecure = DEFAULT_OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE; + private boolean enforceCurativeSecurity = DEFAULT_ENFORCE_CURATIVE_SECURITY; // Enum public enum ObjectiveFunctionType { - MAX_MIN_MARGIN_IN_MEGAWATT(Unit.MEGAWATT), - MAX_MIN_MARGIN_IN_AMPERE(Unit.AMPERE), - MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT(Unit.MEGAWATT), - MAX_MIN_RELATIVE_MARGIN_IN_AMPERE(Unit.AMPERE); - - private final Unit unit; - - ObjectiveFunctionType(Unit unit) { - this.unit = unit; - } - - public Unit getUnit() { - return unit; - } + MAX_MIN_MARGIN, + MAX_MIN_RELATIVE_MARGIN; public boolean relativePositiveMargins() { - return this.equals(MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT) || this.equals(MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); + return this.equals(MAX_MIN_RELATIVE_MARGIN); } } @@ -62,13 +45,6 @@ public enum PreventiveStopCriterion { SECURE } - public enum CurativeStopCriterion { - MIN_OBJECTIVE, // only stop after minimizing objective - SECURE, //stop when objective is strictly negative - PREVENTIVE_OBJECTIVE, // stop when preventive objective is reached, or bested by curativeRaoMinObjImprovement - PREVENTIVE_OBJECTIVE_AND_SECURE // stop when preventive objective is reached or bested by curativeRaoMinObjImprovement, and the situation is secure - } - // Getters and setters public ObjectiveFunctionType getType() { return type; @@ -78,14 +54,6 @@ public void setType(ObjectiveFunctionType type) { this.type = type; } - public boolean getForbidCostIncrease() { - return forbidCostIncrease; - } - - public void setForbidCostIncrease(boolean forbidCostIncrease) { - this.forbidCostIncrease = forbidCostIncrease; - } - public void setPreventiveStopCriterion(PreventiveStopCriterion preventiveStopCriterion) { this.preventiveStopCriterion = preventiveStopCriterion; } @@ -98,20 +66,12 @@ public PreventiveStopCriterion getPreventiveStopCriterion() { return preventiveStopCriterion; } - public CurativeStopCriterion getCurativeStopCriterion() { - return curativeStopCriterion; - } - - public void setCurativeStopCriterion(CurativeStopCriterion curativeStopCriterion) { - this.curativeStopCriterion = curativeStopCriterion; - } - - public boolean getOptimizeCurativeIfPreventiveUnsecure() { - return optimizeCurativeIfPreventiveUnsecure; + public boolean getEnforceCurativeSecurity() { + return enforceCurativeSecurity; } - public void setOptimizeCurativeIfPreventiveUnsecure(boolean optimizeCurativeIfPreventiveUnsecure) { - this.optimizeCurativeIfPreventiveUnsecure = optimizeCurativeIfPreventiveUnsecure; + public void setEnforceCurativeSecurity(boolean enforceCurativeSecurity) { + this.enforceCurativeSecurity = enforceCurativeSecurity; } public static ObjectiveFunctionParameters load(PlatformConfig platformConfig) { @@ -121,13 +81,10 @@ public static ObjectiveFunctionParameters load(PlatformConfig platformConfig) { .ifPresent(config -> { parameters.setType(config.getEnumProperty(TYPE, ObjectiveFunctionType.class, DEFAULT_OBJECTIVE_FUNCTION)); - parameters.setForbidCostIncrease(config.getBooleanProperty(FORBID_COST_INCREASE, DEFAULT_FORBID_COST_INCREASE)); parameters.setCurativeMinObjImprovement(config.getDoubleProperty(CURATIVE_MIN_OBJ_IMPROVEMENT, DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT)); parameters.setPreventiveStopCriterion(config.getEnumProperty(PREVENTIVE_STOP_CRITERION, PreventiveStopCriterion.class, DEFAULT_PREVENTIVE_STOP_CRITERION)); - parameters.setCurativeStopCriterion(config.getEnumProperty(CURATIVE_STOP_CRITERION, CurativeStopCriterion.class, - DEFAULT_CURATIVE_STOP_CRITERION)); - parameters.setOptimizeCurativeIfPreventiveUnsecure(config.getBooleanProperty(OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE, DEFAULT_OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE)); + parameters.setEnforceCurativeSecurity(config.getBooleanProperty(ENFORCE_CURATIVE_SECURITY, DEFAULT_ENFORCE_CURATIVE_SECURITY)); }); return parameters; } diff --git a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/json/JsonRaoParametersTest.java b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/json/JsonRaoParametersTest.java index 0b8df7d4ee..346726d98e 100644 --- a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/json/JsonRaoParametersTest.java +++ b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/json/JsonRaoParametersTest.java @@ -52,12 +52,10 @@ void roundTripDefault() throws IOException { void roundTrip() throws IOException { RaoParameters parameters = new RaoParameters(); // Objective Function parameters - parameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE); - parameters.getObjectiveFunctionParameters().setForbidCostIncrease(true); + parameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE); parameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(983); - parameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + parameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // RangeActionsOptimization parameters parameters.getRangeActionsOptimizationParameters().setMaxMipIterations(30); parameters.getRangeActionsOptimizationParameters().setPstPenaltyCost(10); @@ -177,7 +175,7 @@ void testFailOnOldVersion() { } @ParameterizedTest - @ValueSource(strings = {"LoopFlowError", "PrevStopCriterionError", "CurStopCriterionError", "WrongField"}) + @ValueSource(strings = {"LoopFlowError", "PrevStopCriterionError", "WrongField"}) void importNokTest(String source) { InputStream inputStream = getClass().getResourceAsStream("/RaoParametersWith" + source + "_v2.json"); assertThrows(OpenRaoException.class, () -> JsonRaoParameters.read(inputStream)); diff --git a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java index 21931b9955..b846d4e016 100644 --- a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java +++ b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java @@ -25,6 +25,7 @@ /** * @author Godelaine de Montmorillon {@literal } */ + class RaoParametersConfigTest { private PlatformConfig mockedPlatformConfig; private InMemoryPlatformConfig platformCfg; @@ -40,22 +41,18 @@ public void setUp() { @Test void checkObjectiveFunctionConfig() { MapModuleConfig objectiveFunctionModuleConfig = platformCfg.createModuleConfig("rao-objective-function"); - objectiveFunctionModuleConfig.setStringProperty("type", "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE"); - objectiveFunctionModuleConfig.setStringProperty("forbid-cost-increase", Objects.toString(true)); + objectiveFunctionModuleConfig.setStringProperty("type", "MAX_MIN_RELATIVE_MARGIN"); objectiveFunctionModuleConfig.setStringProperty("curative-min-obj-improvement", Objects.toString(123.0)); objectiveFunctionModuleConfig.setStringProperty("preventive-stop-criterion", "MIN_OBJECTIVE"); - objectiveFunctionModuleConfig.setStringProperty("curative-stop-criterion", "PREVENTIVE_OBJECTIVE"); - objectiveFunctionModuleConfig.setStringProperty("optimize-curative-if-preventive-unsecure", "true"); + objectiveFunctionModuleConfig.setStringProperty("enforce-curative-security", "false"); RaoParameters parameters = new RaoParameters(); RaoParameters.load(parameters, platformCfg); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertTrue(objectiveFunctionParameters.getForbidCostIncrease()); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, objectiveFunctionParameters.getType()); assertEquals(123, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); - assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); - assertTrue(objectiveFunctionParameters.getOptimizeCurativeIfPreventiveUnsecure()); + assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); } @Test @@ -217,13 +214,13 @@ void checkRelativeMarginsConfig() { @Test void checkMultipleConfigs() { MapModuleConfig objectiveFunctionModuleConfig = platformCfg.createModuleConfig("rao-objective-function"); - objectiveFunctionModuleConfig.setStringProperty("type", "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE"); + objectiveFunctionModuleConfig.setStringProperty("type", "MAX_MIN_RELATIVE_MARGIN"); objectiveFunctionModuleConfig.setStringProperty("curative-min-obj-improvement", Objects.toString(123.0)); MapModuleConfig rangeActionsOptimizationModuleConfig = platformCfg.createModuleConfig("rao-range-actions-optimization"); rangeActionsOptimizationModuleConfig.setStringProperty("max-mip-iterations", Objects.toString(32)); RaoParameters parameters = new RaoParameters(); RaoParameters.load(parameters, platformCfg); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, parameters.getObjectiveFunctionParameters().getType()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, parameters.getObjectiveFunctionParameters().getType()); assertEquals(123, parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), 1e-6); assertEquals(32, parameters.getRangeActionsOptimizationParameters().getMaxMipIterations(), 1e-6); assertTrue(Objects.isNull(parameters.getExtension(LoopFlowParametersExtension.class))); diff --git a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConsistencyTest.java b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConsistencyTest.java index 7c8a149e91..863dec5233 100644 --- a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConsistencyTest.java +++ b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConsistencyTest.java @@ -60,10 +60,10 @@ void testSetBoundariesFromMixOfCodes() { @Test void testRelativePositiveMargins() { - assertTrue(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE.relativePositiveMargins()); - assertTrue(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT.relativePositiveMargins()); - assertFalse(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE.relativePositiveMargins()); - assertFalse(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT.relativePositiveMargins()); + assertTrue(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN.relativePositiveMargins()); + assertTrue(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN.relativePositiveMargins()); + assertFalse(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN.relativePositiveMargins()); + assertFalse(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN.relativePositiveMargins()); } @Test diff --git a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersYamlConfigTest.java b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersYamlConfigTest.java index 76d65bb1df..e62d85d517 100644 --- a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersYamlConfigTest.java +++ b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersYamlConfigTest.java @@ -27,6 +27,7 @@ /** * @author Godelaine de Montmorillon {@literal } */ + class RaoParametersYamlConfigTest extends AbstractSerDeTest { static final double DOUBLE_TOLERANCE = 1e-6; @@ -42,11 +43,10 @@ void testConfigWithExtensions() throws IOException { RaoParameters parameters = loadRaoParameters("config_withExtensions"); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertTrue(objectiveFunctionParameters.getForbidCostIncrease()); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, objectiveFunctionParameters.getType()); assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); - assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); + assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); assertEquals(2, rangeActionsOptimizationParameters.getMaxMipIterations(), DOUBLE_TOLERANCE); @@ -125,12 +125,10 @@ void testConfigWithoutExtensions() throws IOException { RaoParameters parameters = loadRaoParameters("config_withoutExtensions"); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertTrue(objectiveFunctionParameters.getForbidCostIncrease()); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, objectiveFunctionParameters.getType()); assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); - assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); - assertTrue(objectiveFunctionParameters.getOptimizeCurativeIfPreventiveUnsecure()); + assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); assertEquals(2, rangeActionsOptimizationParameters.getMaxMipIterations(), DOUBLE_TOLERANCE); @@ -196,11 +194,10 @@ void testConfigWithPartialExtensions() throws IOException { RaoParameters parameters = loadRaoParameters("config_withPartialExtensions"); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertTrue(objectiveFunctionParameters.getForbidCostIncrease()); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT, objectiveFunctionParameters.getType()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, objectiveFunctionParameters.getType()); assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); - assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); + assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); assertEquals(10, rangeActionsOptimizationParameters.getMaxMipIterations(), DOUBLE_TOLERANCE); diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersError_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersError_v2.json index 9955b67d7b..0556eb9a8f 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersError_v2.json @@ -1,4 +1,4 @@ { - "version" : "2.4", + "version" : "2.5", "unknownField" : "abcd" } \ No newline at end of file diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json index 10d4d67ff6..5d4585c416 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json @@ -1,12 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : true, + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE_AND_SECURE", "curative-min-obj-improvement" : 983.0, - "optimize-curative-if-preventive-unsecure" : true + "enforce-curative-security" : true }, "range-actions-optimization" : { "max-mip-iterations" : 30, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithCurStopCriterionError_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithCurStopCriterionError_v2.json deleted file mode 100644 index 8bd4024ebd..0000000000 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithCurStopCriterionError_v2.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "version" : "2.4", - "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "preventive-stop-criterion" : "WRONG", - "curative-stop-criterion" : "MIN_OBJECTIVE", - "curative-min-obj-improvement" : 0.0 - }, - "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } - }, - "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], - "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false - }, - "not-optimized-cnecs" : { - "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false - }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.8", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "extensions" : { - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "FIXED_PTDF", - "constraint-adjustment-coefficient" : 0.0, - "violation-cost" : 0.0, - "countries" : [ ] - } - } -} \ No newline at end of file diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json index d29b7ece76..2bd7a0ba71 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json @@ -1,12 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json index e975ed4642..7b7aae20ce 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json @@ -1,10 +1,8 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json index 567e7d965f..75d2445510 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json @@ -1,10 +1,8 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "WRONG", + "type" : "MAX_MIN_MARGIN", + "preventive-stop-criterion" : "WRONG", "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json index 89455f79eb..76f58cbf05 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json @@ -1,10 +1,8 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withExtensions.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withExtensions.json index 2e6c0f4bb3..0258f49d07 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withExtensions.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withExtensions.json @@ -1,12 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : true, + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE", "curative-min-obj-improvement" : 3.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 2, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withOLFParams.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withOLFParams.json index f450afe21b..adfc91cc74 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withOLFParams.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withOLFParams.json @@ -1,12 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withPartialExtensions.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withPartialExtensions.json index 7e8a506429..30492a4e96 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withPartialExtensions.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withPartialExtensions.json @@ -1,12 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : true, + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE", "curative-min-obj-improvement" : 3.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withoutExtensions.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withoutExtensions.json index d6c813874c..1e7054cc47 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withoutExtensions.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withoutExtensions.json @@ -1,12 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : true, + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE", "curative-min-obj-improvement" : 3.0, - "optimize-curative-if-preventive-unsecure" : true + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 2, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_default_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_default_v2.json index 95ab535aa0..f09cbe49d6 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_default_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_default_v2.json @@ -1,7 +1,7 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json index b2b3294954..84c02c130b 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json @@ -1,8 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_MARGIN", + "preventive-stop-criterion" : "MIN_OBJECTIVE", + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json index 983c2268b4..a73fed8fa7 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json @@ -1,12 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml b/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml index a70ab0d6e9..dfcfc192be 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml @@ -1,8 +1,6 @@ rao-objective-function: - type: MAX_MIN_MARGIN_IN_AMPERE - forbid-cost-increase: true + type: MAX_MIN_MARGIN preventive-stop-criterion: MIN_OBJECTIVE - curative-stop-criterion: PREVENTIVE_OBJECTIVE curative-min-obj-improvement: 3.0 rao-range-actions-optimization: diff --git a/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml b/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml index f29d3217f5..3a37e14d7e 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml @@ -1,7 +1,5 @@ rao-objective-function: - forbid-cost-increase: true preventive-stop-criterion: MIN_OBJECTIVE - curative-stop-criterion: PREVENTIVE_OBJECTIVE curative-min-obj-improvement: 3.0 rao-range-actions-optimization: diff --git a/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml b/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml index fdd410a740..aaba69f650 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml @@ -1,10 +1,8 @@ rao-objective-function: - type: MAX_MIN_MARGIN_IN_AMPERE - forbid-cost-increase: true + type: MAX_MIN_MARGIN preventive-stop-criterion: MIN_OBJECTIVE - curative-stop-criterion: PREVENTIVE_OBJECTIVE curative-min-obj-improvement: 3.0 - optimize-curative-if-preventive-unsecure: true + enforce-curative-security: false rao-range-actions-optimization: max-mip-iterations: 2 diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulator.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulator.java index 3e75182a67..c6604c5bd9 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulator.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulator.java @@ -78,7 +78,7 @@ public final class AutomatonSimulator { public AutomatonSimulator(Crac crac, RaoParameters raoParameters, ToolProvider toolProvider, FlowResult initialFlowResult, PrePerimeterResult prePerimeterSensitivityOutput, Set operatorsNotSharingCras, int numberLoggedElementsDuringRao) { this.crac = crac; this.raoParameters = raoParameters; - this.flowUnit = raoParameters.getObjectiveFunctionParameters().getType().getUnit(); + this.flowUnit = RaoUtil.getObjectiveFunctionUnit(raoParameters); this.toolProvider = toolProvider; this.initialFlowResult = initialFlowResult; this.prePerimeterSensitivityOutput = prePerimeterSensitivityOutput; @@ -94,7 +94,7 @@ public AutomatonSimulator(Crac crac, RaoParameters raoParameters, ToolProvider t AutomatonPerimeterResultImpl simulateAutomatonState(State automatonState, Set curativeStates, Network network, StateTree stateTree, TreeParameters automatonTreeParameters) { TECHNICAL_LOGS.info("Optimizing automaton state {}.", automatonState.getId()); TECHNICAL_LOGS.info("Initial situation:"); - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, prePerimeterSensitivityOutput, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), numberLoggedElementsDuringRao); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, prePerimeterSensitivityOutput, Set.of(automatonState), RaoUtil.getObjectiveFunctionUnit(raoParameters), raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), numberLoggedElementsDuringRao); PrePerimeterSensitivityAnalysis preAutoPstOptimizationSensitivityAnalysis = getPreAutoPerimeterSensitivityAnalysis(automatonState, curativeStates); @@ -262,7 +262,7 @@ TopoAutomatonSimulationResult simulateTopologicalAutomatons(State automatonState if (automatonRangeActionOptimizationSensitivityAnalysisOutput.getSensitivityStatus(automatonState) == ComputationStatus.FAILURE) { return new TopoAutomatonSimulationResult(automatonRangeActionOptimizationSensitivityAnalysisOutput, appliedNetworkActions); } - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, automatonRangeActionOptimizationSensitivityAnalysisOutput, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), numberLoggedElementsDuringRao); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, automatonRangeActionOptimizationSensitivityAnalysisOutput, Set.of(automatonState), RaoUtil.getObjectiveFunctionUnit(raoParameters), raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), numberLoggedElementsDuringRao); } return new TopoAutomatonSimulationResult(automatonRangeActionOptimizationSensitivityAnalysisOutput, appliedNetworkActions); @@ -316,7 +316,7 @@ RangeAutomatonSimulationResult simulateRangeAutomatons(State automatonState, Set if (finalPostAutoResult.getSensitivityStatus(automatonState) == ComputationStatus.FAILURE) { return new RangeAutomatonSimulationResult(finalPostAutoResult, activatedRangeActions, rangeActionsWithSetpoint); } - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, finalPostAutoResult, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), numberLoggedElementsDuringRao); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, finalPostAutoResult, Set.of(automatonState), RaoUtil.getObjectiveFunctionUnit(raoParameters), raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), numberLoggedElementsDuringRao); } return new RangeAutomatonSimulationResult(finalPostAutoResult, activatedRangeActions, rangeActionsWithSetpoint); } @@ -490,7 +490,7 @@ Pair> disableHvdcAngleDroopActi // Finally, run a sensitivity analysis to get sensitivity values in DC set-point mode if needed TECHNICAL_LOGS.info("Running sensitivity analysis after disabling AngleDroopActivePowerControl on HVDC RAs."); PrePerimeterResult result = preAutoPerimeterSensitivityAnalysis.runBasedOnInitialResults(network, crac, initialFlowResult, operatorsNotSharingCras, null); - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, result, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), numberLoggedElementsDuringRao); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, result, Set.of(automatonState), RaoUtil.getObjectiveFunctionUnit(raoParameters), raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), numberLoggedElementsDuringRao); return Pair.of(result, activePowerSetpoints); } @@ -644,7 +644,7 @@ RangeAutomatonSimulationResult shiftRangeActionsUntilFlowCnecsSecure(List run() { BUSINESS_LOGS.info("Preventive perimeter could not be secured; there is no point in optimizing post-contingency perimeters. The RAO will be interrupted here."); mergedRaoResults = new PreventiveAndCurativesRaoResultImpl(crac.getPreventiveState(), initialOutput, preventiveResult, preCurativeSensitivityAnalysisOutput, crac); // log results - RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, preCurativeSensitivityAnalysisOutput, raoParameters.getObjectiveFunctionParameters().getType(), NUMBER_LOGGED_ELEMENTS_END_RAO); + RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, preCurativeSensitivityAnalysisOutput, RaoUtil.getObjectiveFunctionUnit(raoParameters), raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), NUMBER_LOGGED_ELEMENTS_END_RAO); - return postCheckResults(mergedRaoResults, initialOutput, raoParameters.getObjectiveFunctionParameters()); + return postCheckResults(mergedRaoResults, initialOutput, raoParameters); } BUSINESS_LOGS.info("----- Post-contingency perimeters optimization [start]"); @@ -173,16 +173,16 @@ public CompletableFuture run() { // Log final results if (logFinalResultsOutsideOfSecondPreventive) { BUSINESS_LOGS.info("Merging preventive and post-contingency RAO results:"); - RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, stateTree.getBasecaseScenario(), preventiveResult, stateTree.getContingencyScenarios(), postContingencyResults, raoParameters.getObjectiveFunctionParameters().getType(), NUMBER_LOGGED_ELEMENTS_END_RAO); + RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, stateTree.getBasecaseScenario(), preventiveResult, stateTree.getContingencyScenarios(), postContingencyResults, RaoUtil.getObjectiveFunctionUnit(raoParameters), raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), NUMBER_LOGGED_ELEMENTS_END_RAO); } - return postCheckResults(mergedRaoResults, initialOutput, raoParameters.getObjectiveFunctionParameters()); + return postCheckResults(mergedRaoResults, initialOutput, raoParameters); } private boolean shouldStopOptimisationIfPreventiveUnsecure(double preventiveOptimalCost) { return raoParameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE) - && preventiveOptimalCost > 0 - && !raoParameters.getObjectiveFunctionParameters().getOptimizeCurativeIfPreventiveUnsecure(); + && preventiveOptimalCost > 0 + && !raoParameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity(); } /** @@ -202,8 +202,8 @@ private boolean secondPreventiveImprovesResults(RaoResult secondPreventiveRaoRes double secondPreventiveCost = secondPreventiveRaoResults.getCost(curativeInstant); if (secondPreventiveCost > firstPreventiveCost) { BUSINESS_LOGS.info("Second preventive step has increased the overall cost from {} (functional: {}, virtual: {}) to {} (functional: {}, virtual: {}). Falling back to previous solution:", - formatDoubleBasedOnMargin(firstPreventiveCost, -firstPreventiveCost), formatDoubleBasedOnMargin(mergedRaoResults.getFunctionalCost(curativeInstant), -firstPreventiveCost), formatDoubleBasedOnMargin(mergedRaoResults.getVirtualCost(curativeInstant), -firstPreventiveCost), - formatDoubleBasedOnMargin(secondPreventiveCost, -secondPreventiveCost), formatDoubleBasedOnMargin(secondPreventiveRaoResults.getFunctionalCost(curativeInstant), -secondPreventiveCost), formatDoubleBasedOnMargin(secondPreventiveRaoResults.getVirtualCost(curativeInstant), -secondPreventiveCost)); + formatDoubleBasedOnMargin(firstPreventiveCost, -firstPreventiveCost), formatDoubleBasedOnMargin(mergedRaoResults.getFunctionalCost(curativeInstant), -firstPreventiveCost), formatDoubleBasedOnMargin(mergedRaoResults.getVirtualCost(curativeInstant), -firstPreventiveCost), + formatDoubleBasedOnMargin(secondPreventiveCost, -secondPreventiveCost), formatDoubleBasedOnMargin(secondPreventiveRaoResults.getFunctionalCost(curativeInstant), -secondPreventiveCost), formatDoubleBasedOnMargin(secondPreventiveRaoResults.getVirtualCost(curativeInstant), -secondPreventiveCost)); return false; } return true; @@ -212,7 +212,7 @@ private boolean secondPreventiveImprovesResults(RaoResult secondPreventiveRaoRes /** * Return initial result if RAO has increased cost */ - private CompletableFuture postCheckResults(RaoResult raoResult, PrePerimeterResult initialResult, ObjectiveFunctionParameters objectiveFunctionParameters) { + private CompletableFuture postCheckResults(RaoResult raoResult, PrePerimeterResult initialResult, RaoParameters raoParameters) { RaoResult finalRaoResult = raoResult; double initialCost = initialResult.getCost(); @@ -223,12 +223,12 @@ private CompletableFuture postCheckResults(RaoResult raoResult, PrePe double finalFunctionalCost = finalRaoResult.getFunctionalCost(lastInstant); double finalVirtualCost = finalRaoResult.getVirtualCost(lastInstant); - if (objectiveFunctionParameters.getForbidCostIncrease() && finalCost > initialCost) { + if (finalCost > initialCost) { BUSINESS_LOGS.info("RAO has increased the overall cost from {} (functional: {}, virtual: {}) to {} (functional: {}, virtual: {}). Falling back to initial solution:", formatDoubleBasedOnMargin(initialCost, -initialCost), formatDoubleBasedOnMargin(initialFunctionalCost, -initialCost), formatDoubleBasedOnMargin(initialVirtualCost, -initialCost), formatDoubleBasedOnMargin(finalCost, -finalCost), formatDoubleBasedOnMargin(finalFunctionalCost, -finalCost), formatDoubleBasedOnMargin(finalVirtualCost, -finalCost)); // log results - RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, initialResult, objectiveFunctionParameters.getType(), NUMBER_LOGGED_ELEMENTS_END_RAO); + RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, initialResult, RaoUtil.getObjectiveFunctionUnit(raoParameters), raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), NUMBER_LOGGED_ELEMENTS_END_RAO); finalRaoResult = new UnoptimizedRaoResultImpl(initialResult); finalCost = initialCost; finalFunctionalCost = initialFunctionalCost; diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventive.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventive.java index 58fbb2c1bb..5ada60dc63 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventive.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventive.java @@ -21,6 +21,7 @@ import com.powsybl.openrao.raoapi.parameters.SecondPreventiveRaoParameters; import com.powsybl.openrao.searchtreerao.commons.NetworkActionCombination; import com.powsybl.openrao.searchtreerao.commons.RaoLogger; +import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.commons.ToolProvider; import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.ObjectiveFunction; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.*; @@ -95,30 +96,20 @@ boolean shouldRunSecondPreventiveRao(OptimizationResult firstPreventiveResult, C // only compare initial cost with the curative costs return false; } - if (raoParameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE) - && firstPreventiveResult.getCost() > 0) { - // in case of curative optimization even if preventive unsecure (see parameter optimize-curative-if-preventive-unsecure) - // we do not want to run a second preventive that would not be able to fix the situation, to save time - BUSINESS_LOGS.info("First preventive RAO was not able to fix all preventive constraints, second preventive RAO cancelled to save computation time."); - return false; + ObjectiveFunctionParameters.PreventiveStopCriterion preventiveStopCriterion = raoParameters.getObjectiveFunctionParameters().getPreventiveStopCriterion(); + if (preventiveStopCriterion.equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE)) { + if (firstPreventiveResult.getCost() > 0) { + // in case of curative optimization even if preventive unsecure (see parameter enforce-curative-security) + // we do not want to run a second preventive that would not be able to fix the situation, to save time + BUSINESS_LOGS.info("First preventive RAO was not able to fix all preventive constraints, second preventive RAO cancelled to save computation time."); + return false; + } + // Run 2nd preventive RAO if one perimeter of the curative optimization is unsecure + return isAnyResultUnsecure(curativeRaoResults); + } else { // MIN_OBJECTIVE + // Run 2nd preventive RAO if the final result has a worse cost than the preventive perimeter + return isFinalCostWorseThanPreventive(raoParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), firstPreventiveResult, postFirstRaoResult, lastCurativeInstant); } - ObjectiveFunctionParameters.CurativeStopCriterion curativeStopCriterion = raoParameters.getObjectiveFunctionParameters().getCurativeStopCriterion(); - return switch (curativeStopCriterion) { - case MIN_OBJECTIVE -> - // Run 2nd preventive RAO in all cases - true; - case SECURE -> - // Run 2nd preventive RAO if one perimeter of the curative optimization is unsecure - isAnyResultUnsecure(curativeRaoResults); - case PREVENTIVE_OBJECTIVE -> - // Run 2nd preventive RAO if the final result has a worse cost than the preventive perimeter - isFinalCostWorseThanPreventive(raoParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), firstPreventiveResult, postFirstRaoResult, lastCurativeInstant); - case PREVENTIVE_OBJECTIVE_AND_SECURE -> - // Run 2nd preventive RAO if the final result has a worse cost than the preventive perimeter or is unsecure - isAnyResultUnsecure(curativeRaoResults) || isFinalCostWorseThanPreventive(raoParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), firstPreventiveResult, postFirstRaoResult, lastCurativeInstant); - default -> - throw new OpenRaoException(String.format("Unknown curative RAO stop criterion: %s", curativeStopCriterion)); - }; } /** @@ -203,7 +194,7 @@ RaoResult runSecondPreventiveAndAutoRao(CastorContingencyScenarios castorConting newPostContingencyResults.put(state, new CurativeWithSecondPraoResult(state, entry.getValue(), secondPreventiveRaoResult.perimeterResult(), secondPreventiveRaoResult.remedialActionsExcluded(), postCraSensitivityAnalysisOutput)); } } - RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, postCraSensitivityAnalysisOutput, raoParameters.getObjectiveFunctionParameters().getType(), NUMBER_LOGGED_ELEMENTS_END_RAO); + RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, postCraSensitivityAnalysisOutput, RaoUtil.getObjectiveFunctionUnit(raoParameters), raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), NUMBER_LOGGED_ELEMENTS_END_RAO); return new PreventiveAndCurativesRaoResultImpl(stateTree, initialOutput, diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoLogger.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoLogger.java index 6985636af1..baa37c56c9 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoLogger.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoLogger.java @@ -16,7 +16,6 @@ import com.powsybl.openrao.data.cracapi.networkaction.NetworkAction; import com.powsybl.openrao.data.cracapi.rangeaction.PstRangeAction; import com.powsybl.openrao.data.cracapi.rangeaction.RangeAction; -import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.ObjectiveFunction; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.GlobalOptimizationPerimeter; @@ -61,7 +60,8 @@ public static void logSensitivityAnalysisResults(String prefix, RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, sensitivityAnalysisResult, - raoParameters.getObjectiveFunctionParameters().getType(), + RaoUtil.getObjectiveFunctionUnit(raoParameters), + raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), numberOfLoggedLimitingElements); } @@ -88,36 +88,36 @@ public static void logRangeActions(OpenRaoLogger logger, } } - public static void logMostLimitingElementsResults(OpenRaoLogger logger, OptimizationResult optimizationResult, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, int numberOfLoggedElements) { - logMostLimitingElementsResults(logger, optimizationResult, optimizationResult, null, objectiveFunction, numberOfLoggedElements); + public static void logMostLimitingElementsResults(OpenRaoLogger logger, OptimizationResult optimizationResult, Unit unit, boolean relativePositiveMargins, int numberOfLoggedElements) { + logMostLimitingElementsResults(logger, optimizationResult, optimizationResult, null, unit, relativePositiveMargins, numberOfLoggedElements); } - public static void logMostLimitingElementsResults(OpenRaoLogger logger, PrePerimeterResult prePerimeterResult, Set states, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, int numberOfLoggedElements) { - logMostLimitingElementsResults(logger, prePerimeterResult, prePerimeterResult, states, objectiveFunction, numberOfLoggedElements); + public static void logMostLimitingElementsResults(OpenRaoLogger logger, PrePerimeterResult prePerimeterResult, Set states, Unit unit, boolean relativePositiveMargins, int numberOfLoggedElements) { + logMostLimitingElementsResults(logger, prePerimeterResult, prePerimeterResult, states, unit, relativePositiveMargins, numberOfLoggedElements); } - public static void logMostLimitingElementsResults(OpenRaoLogger logger, PrePerimeterResult prePerimeterResult, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, int numberOfLoggedElements) { - logMostLimitingElementsResults(logger, prePerimeterResult, prePerimeterResult, null, objectiveFunction, numberOfLoggedElements); + public static void logMostLimitingElementsResults(OpenRaoLogger logger, PrePerimeterResult prePerimeterResult, Unit unit, boolean relativePositiveMargins, int numberOfLoggedElements) { + logMostLimitingElementsResults(logger, prePerimeterResult, prePerimeterResult, null, unit, relativePositiveMargins, numberOfLoggedElements); } private static void logMostLimitingElementsResults(OpenRaoLogger logger, ObjectiveFunctionResult objectiveFunctionResult, FlowResult flowResult, Set states, - ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit unit, + boolean relativePositiveMargins, int numberOfLoggedElements) { - getMostLimitingElementsResults(objectiveFunctionResult, flowResult, states, objectiveFunction, numberOfLoggedElements) + getMostLimitingElementsResults(objectiveFunctionResult, flowResult, states, unit, relativePositiveMargins, numberOfLoggedElements) .forEach(logger::info); } static List getMostLimitingElementsResults(ObjectiveFunctionResult objectiveFunctionResult, FlowResult flowResult, Set states, - ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit unit, + boolean relativePositiveMargins, int numberOfLoggedElements) { List summary = new ArrayList<>(); - Unit unit = objectiveFunction.getUnit(); - boolean relativePositiveMargins = objectiveFunction.relativePositiveMargins(); List sortedCnecs = getMostLimitingElements(objectiveFunctionResult, states, numberOfLoggedElements); @@ -128,7 +128,7 @@ static List getMostLimitingElementsResults(ObjectiveFunctionResult objec double cnecMargin = relativePositiveMargins ? flowResult.getRelativeMargin(cnec, unit) : flowResult.getMargin(cnec, unit); String isRelativeMargin = (relativePositiveMargins && cnecMargin > 0) ? " relative" : ""; - TwoSides mostConstrainedSide = getMostConstrainedSide(cnec, flowResult, objectiveFunction); + TwoSides mostConstrainedSide = getMostConstrainedSide(cnec, flowResult, unit, relativePositiveMargins); String ptdfIfRelative = (relativePositiveMargins && cnecMargin > 0) ? format(" (PTDF %f)", flowResult.getPtdfZonalSum(cnec, mostConstrainedSide)) : ""; summary.add(String.format(Locale.ENGLISH, "Limiting element #%02d:%s margin = %s %s%s, element %s at state %s, CNEC ID = \"%s\"", i + 1, @@ -145,12 +145,11 @@ static List getMostLimitingElementsResults(ObjectiveFunctionResult objec private static TwoSides getMostConstrainedSide(FlowCnec cnec, FlowResult flowResult, - ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction) { + Unit unit, + boolean relativePositiveMargins) { if (cnec.getMonitoredSides().size() == 1) { return cnec.getMonitoredSides().iterator().next(); } - Unit unit = objectiveFunction.getUnit(); - boolean relativePositiveMargins = objectiveFunction.relativePositiveMargins(); double marginLeft = relativePositiveMargins ? flowResult.getRelativeMargin(cnec, TwoSides.ONE, unit) : flowResult.getMargin(cnec, TwoSides.ONE, unit); double marginRight = relativePositiveMargins ? flowResult.getRelativeMargin(cnec, TwoSides.TWO, unit) : flowResult.getMargin(cnec, TwoSides.TWO, unit); return marginRight < marginLeft ? TwoSides.TWO : TwoSides.ONE; @@ -161,9 +160,10 @@ public static void logMostLimitingElementsResults(OpenRaoLogger logger, OptimizationResult basecaseOptimResult, Set contingencyScenarios, Map contingencyOptimizationResults, - ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit unit, + boolean relativePositiveMargins, int numberOfLoggedElements) { - getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, objectiveFunction, numberOfLoggedElements) + getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, unit, relativePositiveMargins, numberOfLoggedElements) .forEach(logger::info); } @@ -171,11 +171,10 @@ public static List getMostLimitingElementsResults(Perimeter preventivePe OptimizationResult basecaseOptimResult, Set contingencyScenarios, Map contingencyOptimizationResults, - ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit unit, + boolean relativePositiveMargins, int numberOfLoggedElements) { List summary = new ArrayList<>(); - Unit unit = objectiveFunction.getUnit(); - boolean relativePositiveMargins = objectiveFunction.relativePositiveMargins(); Map mostLimitingElementsAndMargins = getMostLimitingElementsAndMargins(basecaseOptimResult, preventivePerimeter.getAllStates(), unit, relativePositiveMargins, numberOfLoggedElements); diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoUtil.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoUtil.java index 7f9ad88987..185558e598 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoUtil.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoUtil.java @@ -52,11 +52,6 @@ public static void initNetwork(Network network, String networkVariantId) { } public static void checkParameters(RaoParameters raoParameters, RaoInput raoInput) { - if (raoParameters.getObjectiveFunctionParameters().getType().getUnit().equals(Unit.AMPERE) - && raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().isDc()) { - throw new OpenRaoException(format("Objective function %s cannot be calculated with a DC default sensitivity engine", raoParameters.getObjectiveFunctionParameters().getType().toString())); - } - if (raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) { if (raoInput.getGlskProvider() == null) { throw new OpenRaoException(format("Objective function %s requires glsks", raoParameters.getObjectiveFunctionParameters().getType())); @@ -165,7 +160,7 @@ private static Set getAllUsageMethods(Set usageRules, Re return usageRules.stream() .filter(ur -> ur instanceof OnContingencyState || ur instanceof OnInstant || (ur instanceof OnFlowConstraintInCountry || ur instanceof OnConstraint onConstraint && onConstraint.getCnec() instanceof FlowCnec) - && isAnyMarginNegative(flowResult, remedialAction.getFlowCnecsConstrainingForOneUsageRule(ur, flowCnecs, network), raoParameters.getObjectiveFunctionParameters().getType().getUnit())) + && isAnyMarginNegative(flowResult, remedialAction.getFlowCnecsConstrainingForOneUsageRule(ur, flowCnecs, network), getObjectiveFunctionUnit(raoParameters))) .map(ur -> ur.getUsageMethod(state)) .collect(Collectors.toSet()); } @@ -212,4 +207,8 @@ public static void applyRemedialActions(Network network, OptimizationResult optR optResult.getActivatedNetworkActions().forEach(networkAction -> networkAction.apply(network)); optResult.getActivatedRangeActions(state).forEach(rangeAction -> rangeAction.apply(network, optResult.getOptimizedSetpoint(rangeAction, state))); } + + public static Unit getObjectiveFunctionUnit(RaoParameters raoParameters) { + return raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().isDc() ? Unit.MEGAWATT : Unit.AMPERE; + } } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java index ce55040e9a..1f4c1ae809 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java @@ -12,6 +12,7 @@ import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; +import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.result.api.*; import org.apache.commons.lang3.tuple.Pair; @@ -78,7 +79,7 @@ public ObjectiveFunction buildForInitialSensitivityComputation(Set flo marginEvaluator = new BasicMarginEvaluator(); } - this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getType().getUnit(), marginEvaluator)); + this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, RaoUtil.getObjectiveFunctionUnit(raoParameters), marginEvaluator)); // sensitivity failure over-cost should be computed on initial sensitivity result too // (this allows the RAO to prefer RAs that can remove sensitivity failures) @@ -108,17 +109,17 @@ public ObjectiveFunction build(Set flowCnecs, if (raoParameters.getNotOptimizedCnecsParameters().getDoNotOptimizeCurativeCnecsForTsosWithoutCras() && !operatorsNotToOptimizeInCurative.isEmpty()) { - this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getType().getUnit(), + this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, RaoUtil.getObjectiveFunctionUnit(raoParameters), new MarginEvaluatorWithMarginDecreaseUnoptimizedCnecs(marginEvaluator, operatorsNotToOptimizeInCurative, prePerimeterFlowResult))); } else { - this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getType().getUnit(), marginEvaluator)); + this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, RaoUtil.getObjectiveFunctionUnit(raoParameters), marginEvaluator)); } // mnec virtual cost evaluator if (raoParameters.hasExtension(MnecParametersExtension.class)) { this.withVirtualCostEvaluator(new MnecViolationCostEvaluator( flowCnecs.stream().filter(Cnec::isMonitored).collect(Collectors.toSet()), - raoParameters.getObjectiveFunctionParameters().getType().getUnit(), + RaoUtil.getObjectiveFunctionUnit(raoParameters), initialFlowResult, raoParameters.getExtension(MnecParametersExtension.class) )); diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java index 300af61bb1..256bbab297 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java @@ -53,27 +53,20 @@ public static TreeParameters buildForAutomatonPerimeter(RaoParameters parameters } public static TreeParameters buildForCurativePerimeter(RaoParameters parameters, Double preventiveOptimizedCost) { - StopCriterion stopCriterion; + StopCriterion stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; double targetObjectiveValue; - switch (parameters.getObjectiveFunctionParameters().getCurativeStopCriterion()) { + switch (parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()) { case MIN_OBJECTIVE: - stopCriterion = StopCriterion.MIN_OBJECTIVE; - targetObjectiveValue = 0.0; + targetObjectiveValue = preventiveOptimizedCost - parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(); + if (parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()) { + targetObjectiveValue = Math.min(targetObjectiveValue, 0); + } break; case SECURE: - stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; targetObjectiveValue = 0.0; break; - case PREVENTIVE_OBJECTIVE: - stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; - targetObjectiveValue = preventiveOptimizedCost - parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(); - break; - case PREVENTIVE_OBJECTIVE_AND_SECURE: - stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; - targetObjectiveValue = Math.min(preventiveOptimizedCost - parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), 0); - break; default: - throw new OpenRaoException("Unknown curative stop criterion: " + parameters.getObjectiveFunctionParameters().getCurativeStopCriterion()); + throw new OpenRaoException("Unknown preventive stop criterion: " + parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()); } RangeActionsOptimizationParameters.RaRangeShrinking raRangeShrinking = parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking(); boolean shouldShrinkRaRange = raRangeShrinking.equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO) || @@ -87,8 +80,7 @@ public static TreeParameters buildForCurativePerimeter(RaoParameters parameters, public static TreeParameters buildForSecondPreventivePerimeter(RaoParameters parameters) { boolean raRangeShrinking = parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking().equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); - if (parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE) - && !parameters.getObjectiveFunctionParameters().getCurativeStopCriterion().equals(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE)) { + if (parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE)) { return new TreeParameters(StopCriterion.AT_TARGET_OBJECTIVE_VALUE, 0.0, // secure parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizer.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizer.java index 28db4217c9..3f6cae07c5 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizer.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizer.java @@ -192,7 +192,7 @@ private static SensitivityComputer createSensitivityComputer(AppliedRemedialActi } else if (parameters.isRaoWithLoopFlowLimitation()) { builder.withCommercialFlowsResults(input.getPreOptimizationFlowResult()); } - if (parameters.getObjectiveFunction().relativePositiveMargins()) { + if (parameters.relativePositiveMargins()) { if (parameters.getMaxMinRelativeMarginParameters().getPtdfApproximation().shouldUpdatePtdfWithPstChange()) { builder.withPtdfsResults(input.getToolProvider().getAbsolutePtdfSumsComputation(), input.getOptimizationPerimeter().getFlowCnecs()); } else { diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblemBuilder.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblemBuilder.java index 9baf225217..7fc5c8a7fc 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblemBuilder.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblemBuilder.java @@ -44,7 +44,7 @@ public LinearProblem buildFromInputsAndParameters(IteratingLinearOptimizerInput .withInitialRangeActionActivationResult(inputs.getRaActivationFromParentLeaf()); // max.min margin, or max.min relative margin - if (parameters.getObjectiveFunction().relativePositiveMargins()) { + if (parameters.relativePositiveMargins()) { this.withProblemFiller(buildMaxMinRelativeMarginFiller()); } else { this.withProblemFiller(buildMaxMinMarginFiller()); @@ -132,7 +132,7 @@ private ProblemFiller buildMaxMinRelativeMarginFiller() { return new MaxMinRelativeMarginFiller( inputs.getOptimizationPerimeter().getOptimizedFlowCnecs(), inputs.getPreOptimizationFlowResult(), - parameters.getObjectiveFunction().getUnit(), + parameters.getObjectiveFunctionUnit(), parameters.getMaxMinRelativeMarginParameters() ); } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/parameters/IteratingLinearOptimizerParameters.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/parameters/IteratingLinearOptimizerParameters.java index 61268601c3..dfbdf8cf01 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/parameters/IteratingLinearOptimizerParameters.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/parameters/IteratingLinearOptimizerParameters.java @@ -9,7 +9,6 @@ import com.powsybl.openrao.commons.OpenRaoException; import com.powsybl.openrao.commons.Unit; -import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; @@ -21,8 +20,8 @@ */ public final class IteratingLinearOptimizerParameters { - private final ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; - + private final Unit objectiveFunctionUnit; + private final boolean relativePositiveMargins; private final RangeActionsOptimizationParameters rangeActionParameters; private final MnecParametersExtension mnecParameters; private final RelativeMarginsParametersExtension maxMinRelativeMarginParameters; @@ -34,7 +33,8 @@ public final class IteratingLinearOptimizerParameters { private final int maxNumberOfIterations; private final boolean raRangeShrinking; - private IteratingLinearOptimizerParameters(ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + private IteratingLinearOptimizerParameters(Unit objectiveFunctionUnit, + boolean relativePositiveMargins, RangeActionsOptimizationParameters rangeActionParameters, MnecParametersExtension mnecParameters, RelativeMarginsParametersExtension maxMinRelativeMarginParameters, @@ -44,7 +44,8 @@ private IteratingLinearOptimizerParameters(ObjectiveFunctionParameters.Objective RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters, int maxNumberOfIterations, boolean raRangeShrinking) { - this.objectiveFunction = objectiveFunction; + this.objectiveFunctionUnit = objectiveFunctionUnit; + this.relativePositiveMargins = relativePositiveMargins; this.rangeActionParameters = rangeActionParameters; this.mnecParameters = mnecParameters; this.maxMinRelativeMarginParameters = maxMinRelativeMarginParameters; @@ -56,21 +57,12 @@ private IteratingLinearOptimizerParameters(ObjectiveFunctionParameters.Objective this.raRangeShrinking = raRangeShrinking; } - public ObjectiveFunctionParameters.ObjectiveFunctionType getObjectiveFunction() { - return objectiveFunction; - } - public Unit getObjectiveFunctionUnit() { - return getObjectiveFunction().getUnit(); - } - - public boolean hasRelativeMargins() { - return getObjectiveFunction().relativePositiveMargins(); + return objectiveFunctionUnit; } - public boolean hasOperatorsNotToOptimize() { - return unoptimizedCnecParameters != null - && !unoptimizedCnecParameters.getOperatorsNotToOptimize().isEmpty(); + public boolean relativePositiveMargins() { + return relativePositiveMargins; } public boolean isRaoWithLoopFlowLimitation() { @@ -123,7 +115,8 @@ public static LinearOptimizerParametersBuilder create() { public static class LinearOptimizerParametersBuilder { - private ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private Unit objectiveFunctionUnit; + private boolean relativePositiveMargins; private RangeActionsOptimizationParameters rangeActionParameters; private MnecParametersExtension mnecParameters; private RelativeMarginsParametersExtension maxMinRelativeMarginParameters; @@ -134,8 +127,13 @@ public static class LinearOptimizerParametersBuilder { private int maxNumberOfIterations; private boolean raRangeShrinking; - public LinearOptimizerParametersBuilder withObjectiveFunction(ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction) { - this.objectiveFunction = objectiveFunction; + public LinearOptimizerParametersBuilder withObjectiveFunctionUnit(Unit objectiveFunctionUnit) { + this.objectiveFunctionUnit = objectiveFunctionUnit; + return this; + } + + public LinearOptimizerParametersBuilder withRelativePositiveMargins(boolean relativePositiveMargins) { + this.relativePositiveMargins = relativePositiveMargins; return this; } @@ -185,12 +183,13 @@ public LinearOptimizerParametersBuilder withRaRangeShrinking(boolean raRangeShri } public IteratingLinearOptimizerParameters build() { - if (objectiveFunction.relativePositiveMargins() && maxMinRelativeMarginParameters == null) { + if (relativePositiveMargins && maxMinRelativeMarginParameters == null) { throw new OpenRaoException("An objective function with relative margins requires parameters on relative margins."); } return new IteratingLinearOptimizerParameters( - objectiveFunction, + objectiveFunctionUnit, + relativePositiveMargins, rangeActionParameters, mnecParameters, maxMinRelativeMarginParameters, diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/Leaf.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/Leaf.java index dda0db8077..abb2b61dad 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/Leaf.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/Leaf.java @@ -208,7 +208,8 @@ void optimize(SearchTreeInput searchTreeInput, SearchTreeParameters parameters) // build parameters IteratingLinearOptimizerParameters linearOptimizerParameters = IteratingLinearOptimizerParameters.create() - .withObjectiveFunction(parameters.getObjectiveFunction()) + .withObjectiveFunctionUnit(parameters.getObjectiveFunctionUnit()) + .withRelativePositiveMargins(parameters.relativePositiveMargins()) .withRangeActionParameters(parameters.getRangeActionParameters()) .withMnecParameters(parameters.getMnecParameters()) .withMaxMinRelativeMarginParameters(parameters.getMaxMinRelativeMarginParameters()) diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTree.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTree.java index 3031a3b816..f0c3f37767 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTree.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTree.java @@ -106,21 +106,21 @@ public CompletableFuture run() { return CompletableFuture.completedFuture(rootLeaf); } else if (stopCriterionReached(rootLeaf)) { topLevelLogger.info("Stop criterion reached on {}", rootLeaf); - RaoLogger.logMostLimitingElementsResults(topLevelLogger, rootLeaf, parameters.getObjectiveFunction(), NUMBER_LOGGED_ELEMENTS_END_TREE); + RaoLogger.logMostLimitingElementsResults(topLevelLogger, rootLeaf, parameters.getObjectiveFunctionUnit(), parameters.relativePositiveMargins(), NUMBER_LOGGED_ELEMENTS_END_TREE); logOptimizationSummary(rootLeaf); rootLeaf.finalizeOptimization(); return CompletableFuture.completedFuture(rootLeaf); } TECHNICAL_LOGS.info("{}", rootLeaf); - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, rootLeaf, parameters.getObjectiveFunction(), NUMBER_LOGGED_ELEMENTS_DURING_TREE); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, rootLeaf, parameters.getObjectiveFunctionUnit(), parameters.relativePositiveMargins(), NUMBER_LOGGED_ELEMENTS_DURING_TREE); TECHNICAL_LOGS.info("Linear optimization on root leaf"); optimizeLeaf(rootLeaf); topLevelLogger.info("{}", rootLeaf); RaoLogger.logRangeActions(TECHNICAL_LOGS, optimalLeaf, input.getOptimizationPerimeter(), null); - RaoLogger.logMostLimitingElementsResults(topLevelLogger, optimalLeaf, parameters.getObjectiveFunction(), NUMBER_LOGGED_ELEMENTS_DURING_TREE); + RaoLogger.logMostLimitingElementsResults(topLevelLogger, optimalLeaf, parameters.getObjectiveFunctionUnit(), parameters.relativePositiveMargins(), NUMBER_LOGGED_ELEMENTS_DURING_TREE); logVirtualCostInformation(rootLeaf, ""); if (stopCriterionReached(rootLeaf)) { @@ -135,7 +135,7 @@ public CompletableFuture run() { TECHNICAL_LOGS.info("Best leaf: {}", optimalLeaf); RaoLogger.logRangeActions(TECHNICAL_LOGS, optimalLeaf, input.getOptimizationPerimeter(), "Best leaf: "); - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, optimalLeaf, parameters.getObjectiveFunction(), NUMBER_LOGGED_ELEMENTS_END_TREE); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, optimalLeaf, parameters.getObjectiveFunctionUnit(), parameters.relativePositiveMargins(), NUMBER_LOGGED_ELEMENTS_END_TREE); logOptimizationSummary(optimalLeaf); optimalLeaf.finalizeOptimization(); @@ -179,7 +179,7 @@ private void iterateOnTree() { topLevelLogger.info("Search depth {} best leaf: {}", depth + 1, optimalLeaf); RaoLogger.logRangeActions(TECHNICAL_LOGS, optimalLeaf, input.getOptimizationPerimeter(), String.format("Search depth %s best leaf: ", depth + 1)); - RaoLogger.logMostLimitingElementsResults(topLevelLogger, optimalLeaf, parameters.getObjectiveFunction(), NUMBER_LOGGED_ELEMENTS_DURING_TREE); + RaoLogger.logMostLimitingElementsResults(topLevelLogger, optimalLeaf, parameters.getObjectiveFunctionUnit(), parameters.relativePositiveMargins(), NUMBER_LOGGED_ELEMENTS_DURING_TREE); } else { topLevelLogger.info("No better result found in search depth {}, exiting search tree", depth + 1); } @@ -377,7 +377,7 @@ private SensitivityComputer getSensitivityComputerForEvaluation(boolean isRootLe sensitivityComputerBuilder.withAppliedRemedialActions(getPreviousDepthAppliedRemedialActionsBeforeNewLeafEvaluation(previousDepthOptimalLeaf)); } - if (parameters.getObjectiveFunction().relativePositiveMargins()) { + if (parameters.relativePositiveMargins()) { if (parameters.getMaxMinRelativeMarginParameters().getPtdfApproximation().shouldUpdatePtdfWithTopologicalChange()) { sensitivityComputerBuilder.withPtdfsResults(input.getToolProvider().getAbsolutePtdfSumsComputation(), input.getOptimizationPerimeter().getFlowCnecs()); } else { @@ -506,7 +506,7 @@ && costSatisfiesStopCriterion(leaf.getCost() - leaf.getVirtualCost(virtualCostNa } List getVirtualCostlyElementsLogs(Leaf leaf, String virtualCostName, String prefix) { - Unit unit = parameters.getObjectiveFunction().getUnit(); + Unit unit = parameters.getObjectiveFunctionUnit(); List logs = new ArrayList<>(); int i = 1; for (FlowCnec flowCnec : leaf.getCostlyElements(virtualCostName, NUMBER_LOGGED_VIRTUAL_COSTLY_ELEMENTS)) { diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParameters.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParameters.java index fd1ebef0b2..388d1cecad 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParameters.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParameters.java @@ -6,18 +6,19 @@ */ package com.powsybl.openrao.searchtreerao.searchtree.parameters; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.cracapi.Crac; import com.powsybl.openrao.data.cracapi.Instant; import com.powsybl.openrao.data.cracapi.RaUsageLimits; import com.powsybl.openrao.data.cracapi.State; import com.powsybl.openrao.data.cracapi.rangeaction.PstRangeAction; import com.powsybl.openrao.data.cracapi.rangeaction.RangeAction; -import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.commons.parameters.*; import com.powsybl.openrao.searchtreerao.result.api.OptimizationResult; import com.powsybl.openrao.searchtreerao.result.api.PrePerimeterResult; @@ -32,7 +33,8 @@ */ public class SearchTreeParameters { - private final ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private final Unit objectiveFunctionUnit; + private final boolean relativePositiveMargins; // required for the search tree algorithm private final TreeParameters treeParameters; @@ -48,7 +50,8 @@ public class SearchTreeParameters { private final RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters; private final int maxNumberOfIterations; - public SearchTreeParameters(ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + public SearchTreeParameters(Unit objectiveFunctionUnit, + boolean relativePositiveMargins, TreeParameters treeParameters, NetworkActionParameters networkActionParameters, Map raLimitationParameters, @@ -59,7 +62,8 @@ public SearchTreeParameters(ObjectiveFunctionParameters.ObjectiveFunctionType ob UnoptimizedCnecParameters unoptimizedCnecParameters, RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters, int maxNumberOfIterations) { - this.objectiveFunction = objectiveFunction; + this.objectiveFunctionUnit = objectiveFunctionUnit; + this.relativePositiveMargins = relativePositiveMargins; this.treeParameters = treeParameters; this.networkActionParameters = networkActionParameters; this.raLimitationParameters = raLimitationParameters; @@ -72,8 +76,12 @@ public SearchTreeParameters(ObjectiveFunctionParameters.ObjectiveFunctionType ob this.maxNumberOfIterations = maxNumberOfIterations; } - public ObjectiveFunctionParameters.ObjectiveFunctionType getObjectiveFunction() { - return objectiveFunction; + public Unit getObjectiveFunctionUnit() { + return objectiveFunctionUnit; + } + + public boolean relativePositiveMargins() { + return relativePositiveMargins; } public TreeParameters getTreeParameters() { @@ -235,7 +243,8 @@ public static SearchTreeParametersBuilder create() { } public static class SearchTreeParametersBuilder { - private ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private Unit objectiveFunctionUnit; + private boolean relativePositiveMargins; private TreeParameters treeParameters; private NetworkActionParameters networkActionParameters; private Map raLimitationParameters; @@ -248,7 +257,8 @@ public static class SearchTreeParametersBuilder { private int maxNumberOfIterations; public SearchTreeParametersBuilder withConstantParametersOverAllRao(RaoParameters raoParameters, Crac crac) { - this.objectiveFunction = raoParameters.getObjectiveFunctionParameters().getType(); + this.objectiveFunctionUnit = RaoUtil.getObjectiveFunctionUnit(raoParameters); + this.relativePositiveMargins = raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(); this.networkActionParameters = NetworkActionParameters.buildFromRaoParameters(raoParameters.getTopoOptimizationParameters(), crac); this.raLimitationParameters = new HashMap<>(crac.getRaUsageLimitsPerInstant()); this.rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); @@ -260,8 +270,13 @@ public SearchTreeParametersBuilder withConstantParametersOverAllRao(RaoParameter return this; } - public SearchTreeParametersBuilder with0bjectiveFunction(ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction) { - this.objectiveFunction = objectiveFunction; + public SearchTreeParametersBuilder withObjectiveFunctionUnit(Unit unit) { + this.objectiveFunctionUnit = unit; + return this; + } + + public SearchTreeParametersBuilder withRelativePositiveMargins(boolean relativePositiveMargins) { + this.relativePositiveMargins = relativePositiveMargins; return this; } @@ -316,7 +331,8 @@ public SearchTreeParametersBuilder withMaxNumberOfIterations(int maxNumberOfIter } public SearchTreeParameters build() { - return new SearchTreeParameters(objectiveFunction, + return new SearchTreeParameters(objectiveFunctionUnit, + relativePositiveMargins, treeParameters, networkActionParameters, raLimitationParameters, @@ -326,7 +342,8 @@ public SearchTreeParameters build() { loopFlowParameters, unoptimizedCnecParameters, solverParameters, - maxNumberOfIterations); + maxNumberOfIterations + ); } } } diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulatorTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulatorTest.java index f08e302424..718d7f0d3e 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulatorTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulatorTest.java @@ -228,7 +228,8 @@ public void setup() { autoState = crac.getState(contingency1, autoInstant); RaoParameters raoParameters = new RaoParameters(); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); + raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().setDc(true); raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityProvider("OpenLoadFlow"); mockedPreAutoPerimeterSensitivityAnalysis = mock(PrePerimeterSensitivityAnalysis.class); @@ -294,9 +295,9 @@ void testDisableHvdcAngleDroopControl1() { // check that sensitivity computation has been run assertEquals(mockedPrePerimeterResult, result.getLeft()); assertEquals(1, result.getRight().size()); - assertEquals(2451.3764524964786, result.getRight().get(hvdcRa1), DOUBLE_TOLERANCE); + assertEquals(821.50, result.getRight().get(hvdcRa1), DOUBLE_TOLERANCE); assertEquals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getConvertersMode()); - assertEquals(2451.3764524964786, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); + assertEquals(821.50, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); assertEquals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER, network.getHvdcLine(hvdcRa2.getNetworkElement().getId()).getConvertersMode()); assertEquals(0, network.getHvdcLine(hvdcRa2.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); @@ -307,7 +308,7 @@ void testDisableHvdcAngleDroopControl1() { assertEquals(prePerimeterResult, result.getLeft()); assertEquals(Map.of(), result.getRight()); assertEquals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getConvertersMode()); - assertEquals(2451.3764524964786, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); + assertEquals(821.50, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); assertEquals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER, network.getHvdcLine(hvdcRa2.getNetworkElement().getId()).getConvertersMode()); assertEquals(0, network.getHvdcLine(hvdcRa2.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); } @@ -323,12 +324,12 @@ void testDisableHvdcAngleDroopControl2() { assertFalse(network.getHvdcLine("BBE2AA12 FFR3AA12 1").getExtension(HvdcAngleDroopActivePowerControl.class).isEnabled()); assertEquals(mockedPrePerimeterResult, result.getLeft()); assertEquals(2, result.getRight().size()); - assertEquals(2451.3764524964786, result.getRight().get(hvdcRa1), DOUBLE_TOLERANCE); + assertEquals(821.50, result.getRight().get(hvdcRa1), DOUBLE_TOLERANCE); assertEquals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getConvertersMode()); - assertEquals(2451.3764524964786, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); - assertEquals(-46.65616621806521, result.getRight().get(hvdcRa2), DOUBLE_TOLERANCE); - assertEquals(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER, network.getHvdcLine(hvdcRa2.getNetworkElement().getId()).getConvertersMode()); - assertEquals(46.65616621806521, network.getHvdcLine(hvdcRa2.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); + assertEquals(821.50, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); + assertEquals(105.02, result.getRight().get(hvdcRa2), DOUBLE_TOLERANCE); + assertEquals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER, network.getHvdcLine(hvdcRa2.getNetworkElement().getId()).getConvertersMode()); + assertEquals(105.02, network.getHvdcLine(hvdcRa2.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); } @Test @@ -374,9 +375,9 @@ void testDisableHvdcAngleDroopControl5() { assertFalse(network.getHvdcLine("BBE2AA11 FFR3AA11 1").getExtension(HvdcAngleDroopActivePowerControl.class).isEnabled()); assertEquals(mockedPrePerimeterResult, result.getLeft()); assertEquals(1, result.getRight().size()); - assertEquals(-813.9957894885341, result.getRight().get(hvdcRa1), DOUBLE_TOLERANCE); + assertEquals(-2414.62, result.getRight().get(hvdcRa1), DOUBLE_TOLERANCE); assertEquals(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getConvertersMode()); - assertEquals(813.9957894885341, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); + assertEquals(2414.62, network.getHvdcLine(hvdcRa1.getNetworkElement().getId()).getActivePowerSetpoint(), DOUBLE_TOLERANCE); } @Test @@ -387,7 +388,7 @@ void testDisableHvdcAngleDroopControl6() { .withGroupId("hvdcGroup") .withNetworkElement("BBE2AA11 FFR3AA11 1") .withSpeed(1) - .newRange().withMax(1000).withMin(-1000).add() + .newRange().withMax(500).withMin(-500).add() .newOnInstantUsageRule().withInstant(AUTO_INSTANT_ID).withUsageMethod(UsageMethod.FORCED).add() .add(); @@ -692,9 +693,9 @@ void testDisableHvdcAngleDroopControlBeforeShifting() { automatonSimulator.shiftRangeActionsUntilFlowCnecsSecure(List.of(hvdcRa1, hvdcRa2), Set.of(cnec1, cnec2), network, mockedPreAutoPerimeterSensitivityAnalysis, prePerimeterResult, autoState); assertFalse(network.getHvdcLine("BBE2AA11 FFR3AA11 1").getExtension(HvdcAngleDroopActivePowerControl.class).isEnabled()); assertFalse(network.getHvdcLine("BBE2AA12 FFR3AA12 1").getExtension(HvdcAngleDroopActivePowerControl.class).isEnabled()); - assertEquals(2451.3764524964786, network.getHvdcLine("BBE2AA11 FFR3AA11 1").getActivePowerSetpoint(), DOUBLE_TOLERANCE); + assertEquals(821.50, network.getHvdcLine("BBE2AA11 FFR3AA11 1").getActivePowerSetpoint(), DOUBLE_TOLERANCE); assertEquals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER, network.getHvdcLine("BBE2AA11 FFR3AA11 1").getConvertersMode()); - assertEquals(46.65616621806521, network.getHvdcLine("BBE2AA12 FFR3AA12 1").getActivePowerSetpoint(), DOUBLE_TOLERANCE); - assertEquals(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER, network.getHvdcLine("BBE2AA12 FFR3AA12 1").getConvertersMode()); + assertEquals(105.02, network.getHvdcLine("BBE2AA12 FFR3AA12 1").getActivePowerSetpoint(), DOUBLE_TOLERANCE); + assertEquals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER, network.getHvdcLine("BBE2AA12 FFR3AA12 1").getConvertersMode()); } } diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimizationTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimizationTest.java index 80a5924584..dde839a1fe 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimizationTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimizationTest.java @@ -30,6 +30,7 @@ import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.openrao.raoapi.parameters.SecondPreventiveRaoParameters; +import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.result.impl.FailedRaoResultImpl; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -165,7 +166,6 @@ void testOptimizationStepsExecutedAndLogsWhenFallbackOnFirstPrev() throws IOExce crac = Crac.read("small-crac-2P_cost_increase.json", getClass().getResourceAsStream("/crac/small-crac-2P_cost_increase.json"), network); RaoInput raoInput = RaoInput.build(network, crac).build(); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setForbidCostIncrease(true); RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); // Test Optimization steps executed @@ -221,7 +221,7 @@ void testThreeCurativeInstantsWithSecondCurativeHavingNoCnecAndNoRa() { RaoInput raoInput = RaoInput.build(network, crac).build(); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -315,7 +315,7 @@ void testThreeCurativeInstants() { RaoInput raoInput = RaoInput.build(network, crac).build(); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -474,7 +474,7 @@ void curativeOptimizationShouldNotBeDoneIfPreventiveUnsecure() throws IOExceptio RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(false); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -489,7 +489,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveSecure() throws IOException { RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(false); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -503,7 +503,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveMinMarginNegative() throws IOEx RaoInput raoInput = RaoInput.build(network, crac).build(); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(false); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -518,7 +518,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveUnsecureAndAssociatedParameterS RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -533,7 +533,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveSecureAndAssociatedParameterSet RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -547,7 +547,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveMinMarginNegativeAndAssociatedP RaoInput raoInput = RaoInput.build(network, crac).build(); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -560,8 +560,8 @@ void curativeStopCriterionReachedSkipsPerimeterBuilding() throws IOException { crac = Crac.read("small-crac-purely-virtual-curative.json", getClass().getResourceAsStream("/crac/small-crac-purely-virtual-curative.json"), network); RaoInput raoInput = RaoInput.build(network, crac).build(); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_secure.json")); - - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + assertEquals(Unit.MEGAWATT, RaoUtil.getObjectiveFunctionUnit(raoParameters)); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO, if not skipping, then tap to -15, since skipping, it stays at preventive optimization value (-12) RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java index 70962c9bde..824d901683 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java @@ -275,11 +275,9 @@ void testShouldRunSecondPreventiveRaoSimple() { // CurativeStopCriterion.MIN_OBJECTIVE parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); assertTrue(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, null, 0)); // CurativeStopCriterion.SECURE, secure case - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.SECURE); Mockito.doReturn(-1.).when(optimizationResult1).getFunctionalCost(); Mockito.doReturn(-10.).when(optimizationResult2).getFunctionalCost(); Mockito.doReturn(0.).when(optimizationResult1).getVirtualCost(); @@ -314,12 +312,12 @@ void testShouldRunSecondPreventiveRaoAdvanced() { parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); parameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(10.); - parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); when(preventiveResult.getCost()).thenReturn(-500.); CastorSecondPreventive castorSecondPreventive = new CastorSecondPreventive(crac, parameters, network, null, null, null); // CurativeStopCriterion.PREVENTIVE_OBJECTIVE - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE); + parameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); setCost(preventiveResult, -100.); // case 1 : final cost is better than preventive (cost < preventive cost - minObjImprovement) when(postFirstPreventiveRaoResult.getCost(curativeInstant)).thenReturn(-200.); @@ -332,7 +330,7 @@ void testShouldRunSecondPreventiveRaoAdvanced() { assertTrue(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, postFirstPreventiveRaoResult, 0)); // CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE); + parameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // case 1 : all curatives are better than preventive (cost <= preventive cost - minObjImprovement), SECURE setCost(optimizationResult1, -200.); setCost(optimizationResult2, -300.); @@ -365,7 +363,6 @@ void testShouldRunSecondPreventiveRaoTime() { Collection curativeResults = Set.of(optimizationResult1, optimizationResult2); parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); CastorSecondPreventive castorSecondPreventive = new CastorSecondPreventive(crac, parameters, network, null, null, java.time.Instant.now().plusSeconds(200)); // Enough time @@ -386,7 +383,6 @@ void testShouldRunSecondPreventiveRaoCostIncrease() { Collection curativeResults = Set.of(optimizationResult1, optimizationResult2); parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.COST_INCREASE); - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); RaoResult postFirstRaoResult = Mockito.mock(RaoResult.class); when(postFirstRaoResult.getCost(null)).thenReturn(-100.); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysisTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysisTest.java index da69d048ff..1257b351e0 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysisTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysisTest.java @@ -90,7 +90,7 @@ private void mockSystematicSensitivityInterface(boolean withPtdf, boolean withLf @Test void testRunNoPtdfNoLf() { assertNotNull(prePerimeterSensitivityAnalysis); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); mockSystematicSensitivityInterface(false, false); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); @@ -102,7 +102,7 @@ void testRunNoPtdfNoLf() { @Test void testRunWithPtdf() { - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); mockSystematicSensitivityInterface(true, false); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); assertNotNull(result.getSensitivityResult()); @@ -112,7 +112,7 @@ void testRunWithPtdf() { void testRunWithLf() { raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); raoParameters.getExtension(LoopFlowParametersExtension.class).setPtdfApproximation(PtdfApproximation.FIXED_PTDF); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); mockSystematicSensitivityInterface(false, true); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); @@ -123,7 +123,7 @@ void testRunWithLf() { void testRunWithPtdfAndLf() { raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); raoParameters.getExtension(LoopFlowParametersExtension.class).setPtdfApproximation(PtdfApproximation.FIXED_PTDF); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); mockSystematicSensitivityInterface(true, true); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); @@ -136,7 +136,7 @@ void testRunWithFixedPtdfAndLf() { raoParameters.getExtension(LoopFlowParametersExtension.class).setPtdfApproximation(PtdfApproximation.FIXED_PTDF); raoParameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); raoParameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfApproximation(PtdfApproximation.FIXED_PTDF); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); mockSystematicSensitivityInterface(false, false); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runBasedOnInitialResults(network, crac, optimizationResult, Collections.emptySet(), new AppliedRemedialActions()); @@ -151,7 +151,7 @@ void testRunAndRecomputePtdf() { raoParameters.getExtension(LoopFlowParametersExtension.class).setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO); raoParameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); raoParameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); mockSystematicSensitivityInterface(true, true); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runBasedOnInitialResults(network, crac, optimizationResult, Collections.emptySet(), new AppliedRemedialActions()); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/RaoLoggerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/RaoLoggerTest.java index 779b5edb7b..5bc8c9b0a9 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/RaoLoggerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/RaoLoggerTest.java @@ -20,7 +20,6 @@ import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.cracapi.networkaction.NetworkAction; import com.powsybl.openrao.data.cracapi.rangeaction.RangeAction; -import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; import com.powsybl.openrao.searchtreerao.result.api.ObjectiveFunctionResult; import com.powsybl.openrao.searchtreerao.result.api.OptimizationResult; @@ -137,7 +136,7 @@ private String marginLog(int order, double margin, boolean relative, Double ptdf void testGetSummaryFromObjFunctionResultOnAllStates() { // Absolute MW when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec1, cnec2, cnec3, cnec4, cnec5)); - List summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT, 5); + List summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, Unit.MEGAWATT, false, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -10, MEGAWATT, cnec1), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -147,7 +146,7 @@ void testGetSummaryFromObjFunctionResultOnAllStates() { // Relative MW when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec1, cnec2, cnec3, cnec4, cnec5)); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, Unit.MEGAWATT, true, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -10, MEGAWATT, cnec1), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -157,7 +156,7 @@ void testGetSummaryFromObjFunctionResultOnAllStates() { // Absolute A when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec2, cnec4, cnec3, cnec5, cnec1)); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, Unit.AMPERE, false, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -10, AMPERE, cnec2), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, AMPERE, cnec4), summary.get(1)); @@ -167,7 +166,7 @@ void testGetSummaryFromObjFunctionResultOnAllStates() { // Relative A when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec2, cnec4, cnec5, cnec3, cnec1)); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(statePreventive, stateCo1Auto, stateCo1Curative, stateCo2Curative), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(statePreventive, stateCo1Auto, stateCo1Curative, stateCo2Curative), Unit.AMPERE, true, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -10, AMPERE, cnec2), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, AMPERE, cnec4), summary.get(1)); @@ -180,25 +179,25 @@ void testGetSummaryFromObjFunctionResultOnAllStates() { void testGetMostLimitingElementsForNarrowMargin() { // Absolute MW when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec6)); - List summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT, 1); + List summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, MEGAWATT, false, 1); assertEquals(1, summary.size()); assertEquals(absoluteMarginLog(1, -0.0003, MEGAWATT, cnec6), summary.get(0)); // Relative MW when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec6)); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, MEGAWATT, true, 5); assertEquals(1, summary.size()); assertEquals(absoluteMarginLog(1, -0.0003, MEGAWATT, cnec6), summary.get(0)); // Absolute A when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec6)); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, null, AMPERE, false, 5); assertEquals(1, summary.size()); assertEquals(absoluteMarginLog(1, -0.002, AMPERE, cnec6), summary.get(0)); // Relative A when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec6)); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(statePreventive, stateCo1Auto, stateCo1Curative, stateCo2Curative), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(statePreventive, stateCo1Auto, stateCo1Curative, stateCo2Curative), AMPERE, true, 5); assertEquals(1, summary.size()); assertEquals(absoluteMarginLog(1, -0.002, AMPERE, cnec6), summary.get(0)); } @@ -207,15 +206,15 @@ void testGetMostLimitingElementsForNarrowMargin() { void testGetSummaryFromObjFunctionResultOnSomeStates() { // Absolute MW when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec1, cnec2, cnec3, cnec4, cnec5)); - List summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT, 5); + List summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(), Unit.MEGAWATT, false, 5); assertEquals(0, summary.size()); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(statePreventive), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(statePreventive), Unit.MEGAWATT, false, 5); assertEquals(1, summary.size()); assertEquals(absoluteMarginLog(1, 0, MEGAWATT, cnec2), summary.get(0)); // Relative MW when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec1, cnec2, cnec3, cnec4, cnec5)); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(statePreventive, stateCo1Curative), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(statePreventive, stateCo1Curative), Unit.MEGAWATT, true, 5); assertEquals(3, summary.size()); assertEquals(absoluteMarginLog(1, -10, MEGAWATT, cnec1), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -223,13 +222,13 @@ void testGetSummaryFromObjFunctionResultOnSomeStates() { // Absolute A when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec2, cnec4, cnec3, cnec5, cnec1)); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(stateCo2Curative), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(stateCo2Curative), Unit.AMPERE, false, 5); assertEquals(1, summary.size()); assertEquals(absoluteMarginLog(1, 10, AMPERE, cnec3), summary.get(0)); // Relative A when(objectiveFunctionResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec2, cnec4, cnec5, cnec3, cnec1)); - summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(stateCo2Curative, stateCo1Auto), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, 5); + summary = RaoLogger.getMostLimitingElementsResults(objectiveFunctionResult, flowResult, Set.of(stateCo2Curative, stateCo1Auto), Unit.AMPERE, true, 5); assertEquals(2, summary.size()); assertEquals(absoluteMarginLog(1, 0, AMPERE, cnec4), summary.get(0)); assertEquals(relativeMarginLog(2, 200, .3, AMPERE, cnec3), summary.get(1)); @@ -268,7 +267,7 @@ void testGetSummaryFromScenarios() { when(basecaseOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec1, cnec2, cnec3, cnec4, cnec5)); when(co1AutoOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec5, cnec1, cnec4)); when(co1CurativeOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec5, cnec1)); - List summary = RaoLogger.getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT, 5); + List summary = RaoLogger.getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, Unit.MEGAWATT, false, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -8, MEGAWATT, cnec5), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -280,7 +279,7 @@ void testGetSummaryFromScenarios() { when(basecaseOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec5, cnec4, cnec3, cnec2, cnec1)); when(co1AutoOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec5, cnec1, cnec4)); when(co1CurativeOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec5, cnec1)); - summary = RaoLogger.getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT, 5); + summary = RaoLogger.getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, Unit.MEGAWATT, true, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -8, MEGAWATT, cnec5), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -292,7 +291,7 @@ void testGetSummaryFromScenarios() { when(basecaseOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec2, cnec5, cnec1, cnec3, cnec4)); when(co1AutoOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec4, cnec5, cnec1)); when(co1CurativeOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec1, cnec5)); - summary = RaoLogger.getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, 5); + summary = RaoLogger.getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, Unit.AMPERE, false, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -21, AMPERE, cnec4), summary.get(0)); assertEquals(absoluteMarginLog(2, -10, AMPERE, cnec2), summary.get(1)); @@ -304,7 +303,7 @@ void testGetSummaryFromScenarios() { when(basecaseOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec4, cnec3, cnec5, cnec1, cnec2)); when(co1AutoOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec4, cnec1, cnec5)); when(co1CurativeOptimResult.getMostLimitingElements(anyInt())).thenReturn(List.of(cnec1, cnec5)); - summary = RaoLogger.getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, 5); + summary = RaoLogger.getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, Unit.AMPERE, true, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -21, AMPERE, cnec4), summary.get(0)); assertEquals(absoluteMarginLog(2, -10, AMPERE, cnec2), summary.get(1)); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/RaoUtilTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/RaoUtilTest.java index a5dfe58431..f1714d3cb9 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/RaoUtilTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/RaoUtilTest.java @@ -86,26 +86,26 @@ private void addGlskProvider() { void testExceptionForGlskOnRelativeMargin() { raoParameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); raoParameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfBoundariesFromString(new ArrayList<>(Arrays.asList("{FR}-{ES}", "{ES}-{PT}"))); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); OpenRaoException exception = assertThrows(OpenRaoException.class, () -> RaoUtil.checkParameters(raoParameters, raoInput)); - assertEquals("Objective function MAX_MIN_RELATIVE_MARGIN_IN_AMPERE requires glsks", exception.getMessage()); + assertEquals("Objective function MAX_MIN_RELATIVE_MARGIN requires glsks", exception.getMessage()); } @Test void testExceptionForNoRelativeMarginParametersOnRelativeMargin() { addGlskProvider(); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); OpenRaoException exception = assertThrows(OpenRaoException.class, () -> RaoUtil.checkParameters(raoParameters, raoInput)); - assertEquals("Objective function MAX_MIN_RELATIVE_MARGIN_IN_AMPERE requires a config with a non empty boundary set", exception.getMessage()); + assertEquals("Objective function MAX_MIN_RELATIVE_MARGIN requires a config with a non empty boundary set", exception.getMessage()); } @Test void testExceptionForNullBoundariesOnRelativeMargin() { addGlskProvider(); raoParameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); OpenRaoException exception = assertThrows(OpenRaoException.class, () -> RaoUtil.checkParameters(raoParameters, raoInput)); - assertEquals("Objective function MAX_MIN_RELATIVE_MARGIN_IN_AMPERE requires a config with a non empty boundary set", exception.getMessage()); + assertEquals("Objective function MAX_MIN_RELATIVE_MARGIN requires a config with a non empty boundary set", exception.getMessage()); } @Test @@ -113,17 +113,18 @@ void testExceptionForEmptyBoundariesOnRelativeMargin() { addGlskProvider(); raoParameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); raoParameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfBoundariesFromString(new ArrayList<>()); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); OpenRaoException exception = assertThrows(OpenRaoException.class, () -> RaoUtil.checkParameters(raoParameters, raoInput)); - assertEquals("Objective function MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT requires a config with a non empty boundary set", exception.getMessage()); + assertEquals("Objective function MAX_MIN_RELATIVE_MARGIN requires a config with a non empty boundary set", exception.getMessage()); } @Test void testAmpereWithDc() { - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); + assertEquals(Unit.AMPERE, RaoUtil.getObjectiveFunctionUnit(raoParameters)); raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().setDc(true); - OpenRaoException exception = assertThrows(OpenRaoException.class, () -> RaoUtil.checkParameters(raoParameters, raoInput)); - assertEquals("Objective function MAX_MIN_RELATIVE_MARGIN_IN_AMPERE cannot be calculated with a DC default sensitivity engine", exception.getMessage()); + assertEquals(Unit.MEGAWATT, RaoUtil.getObjectiveFunctionUnit(raoParameters)); + raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().setDc(false); + assertEquals(Unit.AMPERE, RaoUtil.getObjectiveFunctionUnit(raoParameters)); } @Test diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java index 8c1f0eb3fe..060027af85 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java @@ -64,22 +64,9 @@ void testPreventive() { assertTrue(treeParameters.raRangeShrinking()); } - @Test - void testCurativeMinObjective() { - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); - raoParameters.getNotOptimizedCnecsParameters().setDoNotOptimizeCurativeCnecsForTsosWithoutCras(false); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.DISABLED); - TreeParameters treeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, 100.0); - - assertEquals(TreeParameters.StopCriterion.MIN_OBJECTIVE, treeParameters.stopCriterion()); - assertEquals(2, treeParameters.leavesInParallel()); - assertEquals(6, treeParameters.maximumSearchDepth()); - assertFalse(treeParameters.raRangeShrinking()); - } - @Test void testCurativeSecureStopCriterion() { - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); raoParameters.getMultithreadingParameters().setCurativeLeavesInParallel(16); raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); TreeParameters treeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, 100.0); @@ -93,7 +80,8 @@ void testCurativeSecureStopCriterion() { @Test void testCurativePreventiveObjectiveStopCriterion() { - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(35); raoParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(0); raoParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(0); @@ -110,7 +98,8 @@ void testCurativePreventiveObjectiveStopCriterion() { @Test void testCurativePreventiveObjectiveAndSecureStopCriterion() { - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE); + raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(35); // limited by secure @@ -139,7 +128,7 @@ void testCurativePreventiveObjectiveAndSecureStopCriterion() { void testSecondPreventive() { // test with min objective raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.DISABLED); TreeParameters treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); @@ -150,7 +139,7 @@ void testSecondPreventive() { // test with secure raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); @@ -162,18 +151,18 @@ void testSecondPreventive() { // other combinations raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); - assertEquals(TreeParameters.StopCriterion.MIN_OBJECTIVE, treeParameters.stopCriterion()); + assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); assertEquals(4, treeParameters.leavesInParallel()); assertEquals(6, treeParameters.maximumSearchDepth()); assertTrue(treeParameters.raRangeShrinking()); // still another combination raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); raoParameters.getMultithreadingParameters().setPreventiveLeavesInParallel(8); raoParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(15); raoParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(5); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizerTest.java index 3adbbab69c..a072970504 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizerTest.java @@ -7,11 +7,11 @@ package com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.cracapi.*; import com.powsybl.openrao.data.cracapi.rangeaction.RangeAction; import com.powsybl.openrao.data.cracimpl.utils.NetworkImportsUtil; import com.powsybl.openrao.data.raoresultapi.ComputationStatus; -import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.SensitivityComputer; import com.powsybl.openrao.searchtreerao.commons.adapter.BranchResultAdapter; @@ -102,7 +102,8 @@ public void setUp() { RangeActionsOptimizationParameters rangeActionParameters = Mockito.mock(RangeActionsOptimizationParameters.class); when(rangeActionParameters.getPstModel()).thenReturn(RangeActionsOptimizationParameters.PstModel.CONTINUOUS); when(parameters.getRangeActionParameters()).thenReturn(rangeActionParameters); - when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); + when(parameters.relativePositiveMargins()).thenReturn(false); when(parameters.getRaRangeShrinking()).thenReturn(false); linearProblem = Mockito.mock(LinearProblem.class); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/LinearProblemBuilderTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/LinearProblemBuilderTest.java index 4f7f7de41a..e9add73f88 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/LinearProblemBuilderTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/LinearProblemBuilderTest.java @@ -7,8 +7,8 @@ package com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.cracapi.State; -import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; @@ -69,7 +69,8 @@ public void setup() { @Test void testBuildMaxMarginContinuous() { when(rangeActionParameters.getPstModel()).thenReturn(RangeActionsOptimizationParameters.PstModel.CONTINUOUS); - when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); + when(parameters.relativePositiveMargins()).thenReturn(false); LinearProblem linearProblem = linearProblemBuilder.buildFromInputsAndParameters(inputs, parameters); assertNotNull(linearProblem); @@ -83,7 +84,8 @@ void testBuildMaxMarginContinuous() { @Test void testBuildMaxMarginDiscrete() { when(rangeActionParameters.getPstModel()).thenReturn(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); - when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); + when(parameters.relativePositiveMargins()).thenReturn(false); LinearProblem linearProblem = linearProblemBuilder.buildFromInputsAndParameters(inputs, parameters); assertNotNull(linearProblem); @@ -99,7 +101,8 @@ void testBuildMaxMarginDiscrete() { @Test void testBuildMaxRelativeMarginContinuous() { when(rangeActionParameters.getPstModel()).thenReturn(RangeActionsOptimizationParameters.PstModel.CONTINUOUS); - when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); + when(parameters.relativePositiveMargins()).thenReturn(true); LinearProblem linearProblem = linearProblemBuilder.buildFromInputsAndParameters(inputs, parameters); assertNotNull(linearProblem); @@ -113,7 +116,8 @@ void testBuildMaxRelativeMarginContinuous() { @Test void testBuildMaxMarginContinuousMnecLoopflowUnoptimized() { when(rangeActionParameters.getPstModel()).thenReturn(RangeActionsOptimizationParameters.PstModel.CONTINUOUS); - when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); + when(parameters.relativePositiveMargins()).thenReturn(false); when(parameters.isRaoWithMnecLimitation()).thenReturn(true); when(parameters.isRaoWithLoopFlowLimitation()).thenReturn(true); when(parameters.getUnoptimizedCnecParameters()).thenReturn(Mockito.mock(UnoptimizedCnecParameters.class)); @@ -133,7 +137,8 @@ void testBuildMaxMarginContinuousMnecLoopflowUnoptimized() { @Test void testBuildMaxMarginContinuousRaLimitation() { when(rangeActionParameters.getPstModel()).thenReturn(RangeActionsOptimizationParameters.PstModel.CONTINUOUS); - when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); + when(parameters.relativePositiveMargins()).thenReturn(false); RangeActionLimitationParameters raLimitationParameters = Mockito.mock(RangeActionLimitationParameters.class); when(parameters.getRaLimitationParameters()).thenReturn(raLimitationParameters); when(optimizationPerimeter.getRangeActionOptimizationStates()).thenReturn(Set.of(Mockito.mock(State.class))); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinRelativeMarginFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinRelativeMarginFillerTest.java index 3efa8428a6..08663f5905 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinRelativeMarginFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinRelativeMarginFillerTest.java @@ -73,7 +73,7 @@ public void setUp() throws IOException { raoParameters.getRangeActionsOptimizationParameters().setInjectionRaPenaltyCost(0.01); raoParameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); raoParameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfSumLowerBound(0.01); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); parameters = raoParameters.getExtension(RelativeMarginsParametersExtension.class); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/LeafTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/LeafTest.java index 5114dd7e45..4ecd041b7d 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/LeafTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/LeafTest.java @@ -20,7 +20,6 @@ import com.powsybl.openrao.data.cracapi.rangeaction.RangeAction; import com.powsybl.openrao.data.cracimpl.utils.NetworkImportsUtil; import com.powsybl.openrao.data.raoresultapi.ComputationStatus; -import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.searchtreerao.commons.SensitivityComputer; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.GlobalOptimizationPerimeter; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; @@ -106,7 +105,8 @@ public void setUp() { Instant outageInstant = Mockito.mock(Instant.class); when(searchTreeInput.getOutageInstant()).thenReturn(outageInstant); searchTreeParameters = Mockito.mock(SearchTreeParameters.class); - when(searchTreeParameters.getObjectiveFunction()).thenReturn(Mockito.mock(ObjectiveFunctionParameters.ObjectiveFunctionType.class)); + when(searchTreeParameters.getObjectiveFunctionUnit()).thenReturn(Mockito.mock(Unit.class)); + when(searchTreeParameters.relativePositiveMargins()).thenReturn(false); when(searchTreeParameters.getTreeParameters()).thenReturn(Mockito.mock(TreeParameters.class)); virtualCostName = "VirtualCost"; diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTreeTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTreeTest.java index a13b54ce53..51603f8277 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTreeTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTreeTest.java @@ -22,7 +22,6 @@ import com.powsybl.openrao.data.cracapi.rangeaction.RangeAction; import com.powsybl.openrao.data.cracapi.usagerule.UsageMethod; import com.powsybl.openrao.data.raoresultapi.ComputationStatus; -import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.searchtreerao.commons.NetworkActionCombination; import com.powsybl.openrao.searchtreerao.commons.SensitivityComputer; import com.powsybl.openrao.searchtreerao.commons.ToolProvider; @@ -90,7 +89,8 @@ void setUp() { searchTreeParameters = Mockito.mock(SearchTreeParameters.class); setSearchTreeParameters(); searchTree = Mockito.spy(new SearchTree(searchTreeInput, searchTreeParameters, true)); - when(searchTreeParameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); + when(searchTreeParameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); + when(searchTreeParameters.relativePositiveMargins()).thenReturn(false); mockNetworkPool(network); } diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParametersTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParametersTest.java index 307660e374..2ff6a241c1 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParametersTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParametersTest.java @@ -7,11 +7,11 @@ package com.powsybl.openrao.searchtreerao.searchtree.parameters; import com.powsybl.iidm.network.Network; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.cracapi.Crac; import com.powsybl.openrao.data.cracapi.Instant; import com.powsybl.openrao.data.cracapi.RaUsageLimits; import com.powsybl.openrao.data.cracapi.rangeaction.RangeAction; -import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; @@ -54,7 +54,8 @@ void testWithConstantParametersOverAllRao() { SearchTreeParameters searchTreeParameters = builder.build(); assertNotNull(searchTreeParameters); - assertEquals(raoParameters.getObjectiveFunctionParameters().getType(), searchTreeParameters.getObjectiveFunction()); + assertEquals(raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().isDc() ? Unit.MEGAWATT : Unit.AMPERE, searchTreeParameters.getObjectiveFunctionUnit()); + assertEquals(raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins(), searchTreeParameters.relativePositiveMargins()); assertEquals(NetworkActionParameters.buildFromRaoParameters(raoParameters.getTopoOptimizationParameters(), crac), searchTreeParameters.getNetworkActionParameters()); assertEquals(crac.getRaUsageLimitsPerInstant(), searchTreeParameters.getRaLimitationParameters()); assertEquals(RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters), searchTreeParameters.getRangeActionParameters()); @@ -67,7 +68,8 @@ void testWithConstantParametersOverAllRao() { @Test void testIndividualSetters() { - ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction = Mockito.mock(ObjectiveFunctionParameters.ObjectiveFunctionType.class); + Unit objectiveFunctionUnit = Mockito.mock(Unit.class); + boolean relativePositiveMargins = false; TreeParameters treeParameters = Mockito.mock(TreeParameters.class); NetworkActionParameters networkActionParameters = Mockito.mock(NetworkActionParameters.class); Map raLimitationParameters = new HashMap<>(); @@ -80,7 +82,8 @@ void testIndividualSetters() { int maxNumberOfIterations = 3; SearchTreeParameters searchTreeParameters = builder - .with0bjectiveFunction(objectiveFunction) + .withObjectiveFunctionUnit(objectiveFunctionUnit) + .withRelativePositiveMargins(relativePositiveMargins) .withTreeParameters(treeParameters) .withNetworkActionParameters(networkActionParameters) .withGlobalRemedialActionLimitationParameters(raLimitationParameters) @@ -93,7 +96,8 @@ void testIndividualSetters() { .withMaxNumberOfIterations(maxNumberOfIterations) .build(); - assertEquals(objectiveFunction, searchTreeParameters.getObjectiveFunction()); + assertEquals(objectiveFunctionUnit, searchTreeParameters.getObjectiveFunctionUnit()); + assertEquals(relativePositiveMargins, searchTreeParameters.relativePositiveMargins()); assertEquals(treeParameters, searchTreeParameters.getTreeParameters()); assertEquals(networkActionParameters, searchTreeParameters.getNetworkActionParameters()); assertEquals(raLimitationParameters, searchTreeParameters.getRaLimitationParameters()); diff --git a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_2P_v2.json b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_2P_v2.json index c73834b6f2..3fe6e4267d 100644 --- a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_2P_v2.json +++ b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_2P_v2.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_DC.json b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_DC.json index 7bc6e1ef47..40ce4ff99f 100644 --- a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_DC.json +++ b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_DC.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_oneIteration_v2.json b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_oneIteration_v2.json index 83104b254e..d29cca68b7 100644 --- a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_oneIteration_v2.json +++ b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_oneIteration_v2.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_secure.json b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_secure.json index 74b8817246..eb10c18985 100644 --- a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_secure.json +++ b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_secure.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic10_relative_margin/US10_1.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic10_relative_margin/US10_1.feature index af6ef3be4f..7850cb307d 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic10_relative_margin/US10_1.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic10_relative_margin/US10_1.feature @@ -5,7 +5,7 @@ Feature: US 10.1: Linear RAO with relative margin - @fast @rao @mock @ac @preventive-only @relative + @fast @rao @mock @dc @preventive-only @relative Scenario: US 10.1.1: unsecured case Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic10/ls_relative_margin_unsecure.json" @@ -13,13 +13,13 @@ Feature: US 10.1: Linear RAO with relative margin Given loopflow glsk file is "common/glsk_proportional_12nodes.xml" When I launch search_tree_rao Then its security status should be "UNSECURED" - And the value of the objective function after CRA should be 275.8 + And the value of the objective function after CRA should be 281.0 And the tap of PstRangeAction "PRA_PST_BE" should be -16 in preventive - And the worst margin is -275.8 MW on cnec "FFR1AA1 FFR2AA1 1 - preventive" - And the relative margin on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be 2286.2 MW - And the relative margin on cnec "DDE2AA1 NNL3AA1 1 - preventive" after PRA should be 2474.7 MW + And the worst margin is -281.0 MW on cnec "FFR1AA1 FFR2AA1 1 - preventive" + And the relative margin on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be 2297.1 MW + And the relative margin on cnec "DDE2AA1 NNL3AA1 1 - preventive" after PRA should be 2475.3 MW - @fast @rao @mock @ac @preventive-only @relative + @fast @rao @mock @dc @preventive-only @relative Scenario: US 10.1.2: secured case Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic10/ls_relative_margin.json" diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic10_relative_margin/US10_6.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic10_relative_margin/US10_6.feature index 14fd65ddf1..8a7cf5c438 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic10_relative_margin/US10_6.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic10_relative_margin/US10_6.feature @@ -5,7 +5,7 @@ Feature: US 10.6: Add minimum relative margin binary variable - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: US 10.6.1: Simple case, with 2 curative states and very low cnec thresholds #Check that even with an infeasible linear problem, the RAO goes on. Given network file is "common/TestCase16Nodes.uct" for CORE CC diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_1.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_1.feature index fd1a7695b8..424454eb50 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_1.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_1.feature @@ -9,7 +9,7 @@ Feature: US 11.1: Handle mnecs in linear RAO Scenario: US 11.1.1: reference run, no mnec Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mnec_linearRao_ref.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then its security status should be "SECURED" And the tap of PstRangeAction "PRA_PST_BE" should be -16 in preventive @@ -22,7 +22,7 @@ Feature: US 11.1: Handle mnecs in linear RAO Scenario: US 11.1.2: margin on MNEC should stay positive (initial margin > 50MW) Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mnec_linearRao_1_2.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then its security status should be "SECURED" And the tap of PstRangeAction "PRA_PST_BE" should be -9 in preventive @@ -35,7 +35,7 @@ Feature: US 11.1: Handle mnecs in linear RAO Scenario: US 11.1.3: margin on MNEC should stay above initial value -50 MW [1] (initial margin < 0MW) Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mnec_linearRao_1_3.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then its security status should be "SECURED" And the tap of PstRangeAction "PRA_PST_BE" should be -7 in preventive @@ -47,7 +47,7 @@ Feature: US 11.1: Handle mnecs in linear RAO Scenario: US 11.1.4: margin on MNEC should stay above initial value -50 MW [2] (50MW > initial margin > 0MW) Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mnec_linearRao_1_4.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then its security status should be "SECURED" And the tap of PstRangeAction "PRA_PST_BE" should be -7 in preventive diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_3.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_3.feature index 32a93f1f55..21ed984962 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_3.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_3.feature @@ -5,11 +5,11 @@ Feature: US 11.3: Handle mnecs in search tree with only network actions - @fast @rao @mock @ac @preventive-only + @fast @rao @mock @dc @preventive-only Scenario: US 11.3.1: reference run, no mnec Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mnec_networkAction_ref.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the remedial action "Open line FR1- FR2" is used in preventive And line "FFR1AA1 FFR2AA1 1" in network file with PRA has connection status to "false" @@ -17,11 +17,11 @@ Feature: US 11.3: Handle mnecs in search tree with only network actions And the worst margin is -143.0 MW on cnec "FFR2AA1 DDE3AA1 1 - preventive" And the flow on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be -1856.0 MW - @fast @rao @mock @ac @preventive-only @mnec + @fast @rao @mock @dc @preventive-only @mnec Scenario: US 11.3.2: margin on MNEC should stay positive (initial margin > 180MW) Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mnec_networkAction_3_2.json" - Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin180.json" + Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_mnecDimin180.json" When I launch search_tree_rao Then the remedial action "Open line FR1- FR2" is used in preventive And line "FFR1AA1 FFR2AA1 1" in network file with PRA has connection status to "false" @@ -30,11 +30,11 @@ Feature: US 11.3: Handle mnecs in search tree with only network actions And the margin on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be 108.0 MW And the flow on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be -1692.0 MW - @fast @rao @mock @ac @preventive-only @mnec + @fast @rao @mock @dc @preventive-only @mnec Scenario: US 11.3.3: margin on MNEC should stay above initial value - 180 MW Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mnec_networkAction_3_3.json" - Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin180.json" + Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_mnecDimin180.json" When I launch search_tree_rao Then the remedial action "PST BE setpoint" is used in preventive And PST "BBE2AA1 BBE3AA1 1" in network file with PRA is on tap -16 diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_4.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_4.feature index afb856a74c..e8aeca15c7 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_4.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic11_mnec/US11_4.feature @@ -5,11 +5,11 @@ Feature: US 11.4: Handle mnecs in search tree with range actions and network actions - @fast @rao @mock @ac @preventive-only + @fast @rao @mock @dc @preventive-only Scenario: US 11.4.1: reference run, no mnec Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mixed_ref.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the remedial action "Open line NL1-NL2" is used in preventive And line "NNL1AA1 NNL2AA1 1" in network file with PRA has connection status to "false" @@ -21,11 +21,11 @@ Feature: US 11.4: Handle mnecs in search tree with range actions and network act And the flow on cnec "DDE1AA1 DDE2AA1 1 - Contingency FR1 FR3 - curative" after CRA should be -394.0 MW And the flow on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be -1642.0 MW - @fast @rao @mock @ac @preventive-only @mnec + @fast @rao @mock @dc @preventive-only @mnec Scenario: US 11.4.2: margin on MNEC should stay positive Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mixed_4_2.json" - Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json" + Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json" When I launch search_tree_rao Then the remedial action "Open line NL1-NL2" is used in preventive And line "NNL1AA1 NNL2AA1 1" in network file with PRA has connection status to "false" @@ -35,11 +35,11 @@ Feature: US 11.4: Handle mnecs in search tree with range actions and network act And the worst margin is -99.0 MW on cnec "FFR2AA1 FFR3AA1 1 - preventive" And the flow on cnec "NNL2AA1 NNL3AA1 1 - preventive" after PRA should be 1100.0 MW - @fast @rao @mock @ac @preventive-only @mnec + @fast @rao @mock @dc @preventive-only @mnec Scenario: US 11.4.3: Search Tree RAO - 2 MNECs with one curative Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/ls_mixed_4_3.json" - Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json" + Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json" When I launch search_tree_rao Then the remedial action "Open line NL1-NL2" is used in preventive And line "NNL1AA1 NNL2AA1 1" in network file with PRA has connection status to "false" @@ -50,11 +50,11 @@ Feature: US 11.4: Handle mnecs in search tree with range actions and network act And the flow on cnec "NNL2AA1 NNL3AA1 1 - preventive" after PRA should be 1069.0 MW And the flow on cnec "DDE1AA1 DDE2AA1 1 - Contingency FR1 FR3 - curative" after PRA should be -370.0 MW - @fast @rao @mock @ac @preventive-only + @fast @rao @mock @dc @preventive-only Scenario: US 11.4.4.a: reference run on CBCORA, no mnec Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/MergedCB_ref.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the remedial action "Open line NL1-NL2" is used in preventive And line "NNL1AA1 NNL2AA1 1" in network file with PRA has connection status to "false" @@ -66,11 +66,11 @@ Feature: US 11.4: Handle mnecs in search tree with range actions and network act And the flow on cnec "DE1-DE2-DO - curative" after PRA should be -394.0 MW And the flow on cnec "NL2-BE3-D - preventive" after PRA should be -1642.0 MW - @fast @rao @mock @ac @preventive-only @mnec + @fast @rao @mock @dc @preventive-only @mnec Scenario: US 11.4.4.b: margin on MNEC should stay positive Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic11/MergedCB_4_4.xml" - Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json" + Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the remedial action "Open line NL1-NL2" is used in preventive And line "NNL1AA1 NNL2AA1 1" in network file with PRA has connection status to "false" diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_1.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_1.feature index 256b369062..028479d8de 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_1.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_1.feature @@ -19,7 +19,7 @@ Feature: US 12.1: handling of curative optimization in the CORE CNE export Scenario: 12.1.2: Curative case with MNECs (copy of scenario 13.6.4) Given network file is "epic13/TestCase12NodesDifferentPstTap.uct" for CORE CC Given crac file is "epic13/MergedCB_ep13us6case4.xml" - Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json" + Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json" Given RaoResult file is "epic12/RaoResult_12_1_2.json" When I export CORE CNE at "2019-01-08 13:00" Then the CORE CNE file is xsd-compliant @@ -30,7 +30,7 @@ Feature: US 12.1: handling of curative optimization in the CORE CNE export Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic12/MergedCB_12_1_3.xml" Given loopflow glsk file is "common/glsk_proportional_12nodes.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt_withLoopFlows.json" Given RaoResult file is "epic12/RaoResult_12_1_3.json" When I export CORE CNE at "2019-01-08 00:59" Then the CORE CNE file is xsd-compliant diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_15.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_15.feature index 2542a8dfc8..600c7dd2f8 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_15.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_15.feature @@ -82,14 +82,9 @@ Feature: US 12.15: export different reason per perimeter in SWE CNE Given crac creation parameters file is "epic12/CimCracCreationParameters_MonitorLeftSide.json" Given configuration file is "epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json" When I launch search_tree_rao at "2021-04-02 05:00" - Then the calculation partially fails + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" And 0 remedial actions are used in preventive - And 1 remedial actions are used after "CO_N1012_N4012" at "auto" - And 0 remedial actions are used after "CO_N1012_N4012" at "curative" - And the worst margin is -20.0 A on cnec "N1013_N1014 - preventive" - And the value of the objective function initially should be 20.0 - And the value of the objective function after PRA should be 20.0 - And the value of the objective function after CRA should be 10020.2 + And the worst margin is -1419.4 A @fast @rao @mock @ac @contingency-scenarios @second-preventive # sensi pre 2P fails @@ -99,14 +94,9 @@ Feature: US 12.15: export different reason per perimeter in SWE CNE Given crac creation parameters file is "epic12/CimCracCreationParameters_MonitorLeftSide.json" Given configuration file is "epic12/raoParametersSweIDCC_minObjective.json" When I launch search_tree_rao at "2021-04-02 05:00" - Then the calculation partially fails + Then the optimization steps executed by the RAO should be "SECOND_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" And 0 remedial actions are used in preventive - And 1 remedial actions are used after "CO_N1012_N4012" at "auto" - And 0 remedial actions are used after "CO_N1012_N4012" at "curative" - And the worst margin is -20.0 A on cnec "N1013_N1014 - preventive" - And the value of the objective function initially should be 20.0 - And the value of the objective function after PRA should be 20.0 - And the value of the objective function after CRA should be 10020.2 + And the worst margin is -1419.4 A @fast @rao @mock @ac @contingency-scenarios @second-preventive # sensi pre 2P fails @@ -116,14 +106,9 @@ Feature: US 12.15: export different reason per perimeter in SWE CNE Given crac creation parameters file is "epic12/CimCracCreationParameters_MonitorLeftSide.json" Given configuration file is "epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json" When I launch search_tree_rao at "2021-04-02 05:00" - Then the calculation partially fails + Then the optimization steps executed by the RAO should be "SECOND_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" And 0 remedial actions are used in preventive - And 1 remedial actions are used after "CO_N1012_N4012" at "auto" - And 0 remedial actions are used after "CO_N1012_N4012" at "curative" - And the worst margin is -20.0 A on cnec "N1013_N1014 - preventive" - And the value of the objective function initially should be 20.0 - And the value of the objective function after PRA should be 20.0 - And the value of the objective function after CRA should be 10020.2 + And the worst margin is -1419.4 A @fast @cne-export @mock # CNE export @@ -148,14 +133,9 @@ Feature: US 12.15: export different reason per perimeter in SWE CNE Given crac creation parameters file is "epic12/CimCracCreationParameters_MonitorLeftSide.json" Given configuration file is "epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json" When I launch search_tree_rao at "2021-04-02 05:00" - Then the calculation partially fails - And 1 remedial actions are used in preventive - And the remedial action "PRA_OPEN_N1011_N1013" is used in preventive - And 0 remedial actions are used after "CO_N1012_N4012" at "curative" - And the worst margin is 198 A on cnec "N1013_N1014 - preventive" - And the value of the objective function initially should be 20.2 - And the value of the objective function after PRA should be 9801.7 - And the value of the objective function after CRA should be 9801.7 + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And 0 remedial actions are used in preventive + And the worst margin is -1419.4 A on cnec "N1013_N1014 - CO_N1012_N4012 - curative" @fast @rao @mock @ac @contingency-scenarios @second-preventive # 2P does not apply the same PRA as previously since it leads to a sensi divergence on a curative perimeter : no PRA is applied diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_6.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_6.feature index e5e9167319..94f18a5fef 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_6.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_6.feature @@ -31,7 +31,7 @@ Feature: US 12.6: CORE CNE export for preventive case Scenario: 12.6.4: Test case with a CBCORA file and a MNEC Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic12/MergedCB_12_6_4.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" Given RaoResult file is "epic12/RaoResult_12_6_4.json" When I export CORE CNE at "2019-01-08 01:00" Then the CORE CNE file is xsd-compliant diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_9.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_9.feature index b69ada9943..94f8460ef4 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_9.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic12_export_improvement/US12_9.feature @@ -9,7 +9,7 @@ Feature: US 12.9: CORE CNE export for CBCORA with inverted branches Scenario: 12.9.1: CBCORA with inverted branches Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic12/MergedCB_12_6_4_withInvertedLines.xml" - Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json" + Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json" Given RaoResult file is "epic12/RaoResult_12_6_4_withInvertedLines.json" When I export CORE CNE at "2019-01-08 01:59" Then the CORE CNE file is xsd-compliant diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_1.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_1.feature index 130ce9199c..83f4a1fa28 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_1.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_1.feature @@ -5,24 +5,24 @@ Feature: US 13.1: solve a RAO for a single preventive or curative state - @fast @rao @mock @ac @preventive-only + @fast @rao @mock @dc @preventive-only Scenario: US 13.1.1: Solve preventive perimeter alone Given network file is "epic13/TestCase12NodesForCurative.uct" Given crac file is "epic13/12nodes_pst_topo_frm_cbcora_curative.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 00:30" on preventive state - Then the tap of PstRangeAction "SelectTapPSTPrev" should be 12 in preventive + Then the tap of PstRangeAction "SelectTapPSTPrev" should be 14 in preventive Then the initial flow on cnec "CnecPreventiveDir - preventive" should be -400.0 MW # Then the flow on cnec "DDE1AA1 DDE3AA1 1 - preventive" after PRA should be 121.0 MW # Previously there was a mistake it was optimizing with all cnecs and not only on preventive state - Then the flow on cnec "CnecPreventiveDir - preventive" after PRA should be -8 MW + Then the flow on cnec "CnecPreventiveDir - preventive" after PRA should be 12 MW - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: US 13.1.2: Solve curative perimeter alone at curative instant Given network file is "epic13/TestCase12NodesForCurative.uct" Given crac file is "epic13/12nodes_pst_topo_frm_cbcora_curative.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 00:30" after "Contingency" at "curative" - Then the tap of PstRangeAction "SelectTapPSTCur" should be -9 after "Contingency" at "curative" + Then the tap of PstRangeAction "SelectTapPSTCur" should be -10 after "Contingency" at "curative" Then the initial flow on cnec "CnecCurativeDir - curative" should be 286.0 MW Then the flow on cnec "CnecCurativeDir - curative" after CRA should be -9.0 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_3.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_3.feature index 654e553a33..c9ca80d06b 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_3.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_3.feature @@ -11,19 +11,9 @@ Feature: US 13.3 : Solve a RAO for N compounds states Given crac file is "epic13/SL_ep13us3case1.json" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "co1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "co1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_fr3_1" at "curative" - And the worst margin is -242 A - And the margin on cnec "FFR1AA1 FFR4AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be -242 A - And the margin on cnec "FFR3AA1 FFR5AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be 675 A - And the margin on cnec "FFR3AA1 FFR5AA1 1 - co1_fr2_fr3_1 - outage" after PRA should be 984 A - And the margin on cnec "FFR4AA1 DDE1AA1 1 - preventive" after PRA should be 984 A - And the value of the objective function after CRA should be 242 + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And 0 remedial actions are used in preventive + And the worst margin is 114 A @fast @rao @mock @ac @contingency-scenarios Scenario: US 13.3.2: Simple case, with 2 curative states @@ -209,16 +199,5 @@ Feature: US 13.3 : Solve a RAO for N compounds states Given crac file is "epic13/CBCORA_ep13us3case10.xml" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao at "2019-01-08 12:00" - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -242 A - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -242 A - And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 675 A - And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 984 A - And the margin on cnec "fr4_de1_N - preventive" after PRA should be 984 A - And the value of the objective function after CRA should be 242 \ No newline at end of file + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst margin is 114 A \ No newline at end of file diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_4.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_4.feature index 83667b1d5e..a1e6af9c45 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_4.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_4.feature @@ -25,18 +25,8 @@ Feature: US 13.4: Dynamic of topological remedial actions available in several i Given crac file is "epic13/SL_ep13us4case2.json" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the tap of PstRangeAction "pst_fr" should be -5 in preventive - And the tap of PstRangeAction "pst_be" should be -16 in preventive - And 0 remedial actions are used after "co1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_fr" should be -5 after "co1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_fr3_1" at "curative" - And the worst margin is -653 A - And the margin on cnec "FFR4AA1 DDE1AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be -653 A - And the margin on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be 340 A - And the margin on cnec "FFR2AA1 DDE3AA1 1 - co1_fr2_fr3_1 - outage" after PRA should be 703 A - And the value of the objective function after CRA should be 653 + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst margin is -522 A @fast @rao @mock @ac @contingency-scenarios Scenario: US 13.4.3: Topological RA available in preventive and curative : used in curative @@ -63,18 +53,9 @@ Feature: US 13.4: Dynamic of topological remedial actions available in several i Given crac file is "epic13/SL_ep13us4case4.json" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4_pra" is used in preventive - And the tap of PstRangeAction "pst_fr" should be -5 in preventive - And the tap of PstRangeAction "pst_be" should be -16 in preventive - And 0 remedial actions are used after "co1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_fr" should be -5 after "co1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_fr3_1" at "curative" - And the worst margin is -653 A - And the margin on cnec "FFR4AA1 DDE1AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be -653 A - And the margin on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be 340 A - And the margin on cnec "FFR2AA1 DDE3AA1 1 - co1_fr2_fr3_1 - outage" after PRA should be 703 A - And the value of the objective function after CRA should be 653 + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst margin is -522 A + @fast @rao @mock @ac @contingency-scenarios Scenario: US 13.4.5: Topological RA duplicated into PRA and CRA : CRA is activated diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_5.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_5.feature index 062a5b05bc..6339409b41 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_5.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_5.feature @@ -68,75 +68,64 @@ Feature: US 13.5: dynamic of range actions available in several instants Given crac file is "epic13/SL_ep13us5case4.json" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao - Then the worst margin is -247 A - And the margin on cnec "FFR2AA1 FFR3AA1 2 - co1_fr2_fr3_1 - curative" after CRA should be -247 A - And the margin on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be 149 A - And the margin on cnec "FFR2AA1 DDE3AA1 1 - co1_fr2_fr3_1 - outage" after PRA should be 575 A - And the margin on cnec "FFR3AA1 FFR5AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be 774 A - And the margin on cnec "FFR3AA1 FFR5AA1 1 - co1_fr2_fr3_1 - outage" after PRA should be 1179 A - And the remedial action "open_fr1_fr2" is used in preventive - And the remedial action "close_fr1_fr5" is used after "co1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_fr_pra" should be -7 in preventive - And the tap of PstRangeAction "pst_fr_cra" should be 1 after "co1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be 0 in preventive - And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_fr3_1" at "curative" - And the value of the objective function after CRA should be 247 + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst margin is -184.1 A - @fast @rao @mock @ac @contingency-scenarios - Scenario: US 13.5.5: Preventive and curative optimization with absolute limit on curative PST + @fast @rao @mock @dc @contingency-scenarios + Scenario: US 13.5.5: Preventive and curative optimization with relative limit on curative PST Given network file is "epic13/TestCase12NodesForCurative.uct" Given crac file is "epic13/12nodes_onePreventiveAndCurativePst_relativeLimit.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 00:30" - Then the worst margin is 1432 MW - And the margin on cnec "CnecCurativeDir - curative" after CRA should be 1432 MW - And the tap of PstRangeAction "SelectTapPSTPrev" should be 12 in preventive - And the tap of PstRangeAction "SelectTapPSTCur" should be 14 after "Contingency" at "curative" - And the value of the objective function after CRA should be -1432 + Then the worst margin is 1406 MW + And the margin on cnec "CnecCurativeDir - curative" after CRA should be 1406 MW + And the tap of PstRangeAction "SelectTapPSTPrev" should be 8 in preventive + And the tap of PstRangeAction "SelectTapPSTCur" should be 10 after "Contingency" at "curative" + And the value of the objective function after CRA should be -1406 - @fast @rao @mock @ac @contingency-scenarios - Scenario: US 13.5.6: Preventive and curative optimization with relative limit on curative PST + @fast @rao @mock @dc @contingency-scenarios + Scenario: US 13.5.6: Preventive and curative optimization with absolute limit on curative PST Given network file is "epic13/TestCase12NodesForCurative.uct" Given crac file is "epic13/12nodes_onePreventiveAndCurativePst_absoluteLimit.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 00:30" Then the worst margin is 1432 MW And the margin on cnec "CnecCurativeDir - curative" after CRA should be 1432 MW - And the tap of PstRangeAction "SelectTapPSTPrev" should be 12 in preventive + And the tap of PstRangeAction "SelectTapPSTPrev" should be 8 in preventive And the tap of PstRangeAction "SelectTapPSTCur" should be 14 after "Contingency" at "curative" - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: US 13.5.7: Preventive and curative optimization with wrong absolute limit on curative PST Given network file is "epic13/TestCase12NodesForCurative.uct" Given crac file is "epic13/12nodes_onePreventiveAndCurativePst_absoluteLimitError.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 00:30" Then the worst margin is 1422 MW And the margin on cnec "CnecCurativeDir - curative" after CRA should be 1422 MW - And the tap of PstRangeAction "SelectTapPSTPrev" should be 12 in preventive - And the tap of PstRangeAction "SelectTapPSTCur" should be 12 after "Contingency" at "curative" + And the tap of PstRangeAction "SelectTapPSTPrev" should be 11 in preventive + And the tap of PstRangeAction "SelectTapPSTCur" should be 11 after "Contingency" at "curative" And the value of the objective function after CRA should be -1422 @fast @crac @mock Scenario: US 13.5.8: PST filtering Given network file is "epic13/TestCase12NodesForCurative.uct" Given crac file is "epic13/12nodes_oneCorrectPreventivePst.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I import crac at "2019-01-08 12:00" Then it should have 2 range actions And range action "SelectTapPSTPrev" should have 1 ranges And range action "SelectTapPSTPrevWrongRange" should have 0 ranges - @fast @rao @mock @ac @preventive-only + @fast @rao @mock @dc @preventive-only Scenario: US 13.5.9: Preventive optimization after PST filtering Given network file is "epic13/TestCase12NodesForCurative.uct" Given crac file is "epic13/12nodes_oneCorrectPreventivePst.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 00:30" - Then the worst margin is 1637 MW - And the margin on cnec "CnecPreventiveDir - preventive" after PRA should be 1637 MW - And the tap of PstRangeAction "SelectTapPSTPrev" should be 12 in preventive - And the value of the objective function after CRA should be -1637 + Then the worst margin is 1722 MW + And the margin on cnec "CnecPreventiveDir - preventive" after PRA should be 1722 MW + And the tap of PstRangeAction "SelectTapPSTPrev" should be 11 in preventive + And the value of the objective function after CRA should be -1722 @fast @rao @mock @ac @contingency-scenarios Scenario: US 13.5.10: CBCORA, CRA and PRA on same PSTs (as done in CORE CC data) diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_6.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_6.feature index ef7cada961..dd7182f5dd 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_6.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_6.feature @@ -25,7 +25,7 @@ Feature: US 13.6: cross validation curative optimization and MNECs And the tap of PstRangeAction "pst_be" should be 14 after "co1_fr2_fr3_1" at "curative" And the value of the objective function after CRA should be -999 - @fast @rao @mock @ac @contingency-scenarios @mnec + @fast @rao @mock @dc @contingency-scenarios @mnec Scenario: US 13.6.2: CBCORA - Curative MNECs should have a positive margin Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic13/MergedCB_ep13us6case2.xml" @@ -44,26 +44,20 @@ Feature: US 13.6: cross validation curative optimization and MNECs And the margin on cnec "NL1-NL3-D - curative" after CRA should be 0.0 MW And the value of the objective function after CRA should be 140 - @fast @rao @mock @ac @contingency-scenarios @mnec + @fast @rao @mock @dc @contingency-scenarios @mnec Scenario: US 13.6.3: CBCORA - Curative MNECs limited by their initial margin - CRAs only Given network file is "epic13/TestCase12NodesDifferentPstTap.uct" for CORE CC Given crac file is "epic13/MergedCB_ep13us6case3.xml" - Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json" + Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json" When I launch search_tree_rao at "2019-01-08 12:00" - Then the margin on cnec "NL2-BE3-O - outage" after PRA should be -83.0 MW - And the margin on cnec "NL2-BE3-O - curative" after CRA should be -103.0 MW - And 3 remedial actions are used after "Contingency_FR1_FR3" at "curative" - And the remedial action "Open line DE1-DE2" is used after "Contingency_FR1_FR3" at "curative" - And the remedial action "Open line NL1-NL2" is used after "Contingency_FR1_FR3" at "curative" - And the tap of PstRangeAction "PRA_PST_BE" should be 8 after "Contingency_FR1_FR3" at "curative" - And the margin on cnec "FR2-FR3-OO - curative" after CRA should be -96 MW + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" And the value of the objective function after CRA should be 286 - @fast @rao @mock @ac @contingency-scenarios @mnec + @fast @rao @mock @dc @contingency-scenarios @mnec Scenario: US 13.6.4: CBCORA - Curative MNECs limited by their initial margin - PRAs and CRAs Given network file is "epic13/TestCase12NodesDifferentPstTap.uct" for CORE CC Given crac file is "epic13/MergedCB_ep13us6case4.xml" - Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json" + Given configuration file is "epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the margin on cnec "NL2-BE3-O - outage" after PRA should be -103.0 MW And 1 remedial actions are used in preventive @@ -102,20 +96,8 @@ Feature: US 13.6: cross validation curative optimization and MNECs Given crac file is "epic13/SL_ep13us2case6_with_mnec_curative.json" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao - Then 2 remedial actions are used in preventive - And the remedial action "open_be1_be4" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 2 in preventive - And the initial margin on cnec "FFR1AA1 FFR2AA1 1 - preventive" should be 70 MW - And the margin on cnec "FFR1AA1 FFR2AA1 1 - preventive" after PRA should be 5 MW - # Flow is -572 MW without RA, and threshold -700 MW. - And the initial margin on cnec "BBE1AA1 BBE2AA1 1 - co1_fr2_fr3_1 - curative" should be 127 MW - # Here the margin should not be negative because the branch is a MNEC and initial margin was positive. - # Flow is -643 MW with PRA and CRA (actually no CRA were activated in this test case), and threshold -700 MW. Margin is positive. - And the margin on cnec "BBE1AA1 BBE2AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be 57 MW - # 2 Remedial actions would have been used if the MNEC was not limiting - And 0 remedial actions are used after "co1_fr2_fr3_1" at "curative" - And the worst margin is 612 A on cnec "FFR3AA1 FFR5AA1 1 - co1_fr2_fr3_1 - curative" - And the value of the objective function after CRA should be -612 + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the value of the objective function after CRA should be -679.48 @fast @rao @mock @ac @contingency-scenarios @mnec Scenario: US 13.6.7: Simple case with a mix of preventive and curative remedial actions and MNECs in preventive and curative limited by initial value @@ -141,7 +123,7 @@ Feature: US 13.6: cross validation curative optimization and MNECs And the worst margin is 705 A on cnec "FFR3AA1 FFR5AA1 1 - co1_fr2_fr3_1 - curative" And the value of the objective function after CRA should be -705 - @fast @rao @mock @ac @contingency-scenarios @mnec + @fast @rao @mock @dc @contingency-scenarios @mnec Scenario: US 13.6.8: Curative perimeter with pure MNECs only Given network file is "common/TestCase16Nodes.uct" for CORE CC Given crac file is "epic13/MergedCB_ep13us6case8.xml" @@ -164,7 +146,7 @@ Feature: US 13.6: cross validation curative optimization and MNECs And the value of the objective function after ARA should be -71 And the value of the objective function after CRA should be -390 - @fast @rao @mock @ac @contingency-scenarios @mnec + @fast @rao @mock @dc @contingency-scenarios @mnec Scenario: US 13.6.11: Curative with pure MNECs only - PST CRA should remove MNEC constraint Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic13/CBCORA_ep13us6case11.xml" diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_7.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_7.feature index e3e7032076..6c5f63c048 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_7.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_7.feature @@ -10,7 +10,7 @@ Feature: US 13.7: Cross-validation Curative and Loop-flows Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic13/CBCORA_ep13us7case1.xml" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt_withLoopFlows.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the worst margin is -337.0 MW And the worst margin is -337.0 MW on cnec "001_FR-DE - preventive" @@ -29,7 +29,7 @@ Feature: US 13.7: Cross-validation Curative and Loop-flows Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic13/CBCORA_ep13us7case2.xml" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt_withLoopFlows.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the worst margin is -530.0 MW And the worst margin is -530.0 MW on cnec "001_FR-DE - preventive" @@ -66,7 +66,7 @@ Feature: US 13.7: Cross-validation Curative and Loop-flows Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic13/CBCORA_ep13us7case3.xml" Given loopflow glsk file is "common/glsk_proportional_12nodes.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt_withLoopFlows.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the worst margin is 524.0 MW And the margin on cnec "001_FR-DE - preventive" after PRA should be 524.0 MW @@ -90,7 +90,7 @@ Feature: US 13.7: Cross-validation Curative and Loop-flows Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic13/CBCORA_ep13us7case4.xml" Given loopflow glsk file is "common/glsk_proportional_12nodes.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt_withLoopFlows.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the worst margin is 524.0 MW And the margin on cnec "001_FR-DE - preventive" after PRA should be 524.0 MW @@ -114,7 +114,7 @@ Feature: US 13.7: Cross-validation Curative and Loop-flows Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic13/CBCORA_ep13us7case5.xml" Given loopflow glsk file is "common/glsk_proportional_12nodes.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt_withLoopFlows.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the worst margin is 524.0 MW And the margin on cnec "001_FR-DE - preventive" after PRA should be 524.0 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_8.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_8.feature index 04b485295c..a0fe41949b 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_8.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic13_curative/US13_8.feature @@ -33,7 +33,7 @@ Feature: US 13.8: cross-validation curative and relative margin Then the relative margin on cnec "BBE4AA1 FFR5AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be 693 A And the value of the objective function after CRA should be 244 - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @ac @contingency-scenarios @relative Scenario: US 13.8.2: Full optimization in absolute margin with positive margin in curative # Curative limiting element of previous case has been removed so that limiting element in curative has a positive # absolute margin. This case is a reference for the following one. @@ -56,7 +56,7 @@ Feature: US 13.8: cross-validation curative and relative margin And the margin on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be 470 A And the value of the objective function after CRA should be -300 - @fast @rao @mock @ac @contingency-scenarios @relative @relative + @fast @rao @mock @ac @contingency-scenarios @relative Scenario: US 13.8.3: Full optimization in relative margin with positive margin in curative # Optimizations in both preventive and curative are slightly different since due to PTDF factor limiting elements # are not the same in both situations. diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic14_core_d2_extra_tasks/US14_4.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic14_core_d2_extra_tasks/US14_4.feature index f470f6e1ba..500d3d6a21 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic14_core_d2_extra_tasks/US14_4.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic14_core_d2_extra_tasks/US14_4.feature @@ -9,7 +9,7 @@ Feature: US 14.4: HVDC Scenario: US 14.4.1 : Outage HVDC modelling 1 (CORE's Cobra) Given network file is "epic14/TestCase12NodesHvdc.uct" for CORE CC Given crac file is "epic14/cbcora_ep14us4case1.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the initial margin on cnec "004_FR-DE - outage" should be 501.0 MW And the initial margin on cnec "003_FR-DE - curative" should be 501.0 MW @@ -23,7 +23,7 @@ Feature: US 14.4: HVDC Scenario: US 14.4.2 : Outage HVDC modelling 2 (CORE's Alegro) Given network file is "epic14/TestCase12NodesHvdc.uct" for CORE CC Given crac file is "epic14/cbcora_ep14us4case2.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the initial margin on cnec "004_FR-DE - outage" should be 501.0 MW And the initial margin on cnec "003_FR-DE - curative" should be 501.0 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic14_core_d2_extra_tasks/US14_6.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic14_core_d2_extra_tasks/US14_6.feature index bde063ef5e..d335d6392f 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic14_core_d2_extra_tasks/US14_6.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic14_core_d2_extra_tasks/US14_6.feature @@ -9,7 +9,7 @@ Feature: US 14.6: Dangling lines Scenario: 14.6.1 : Dangling line with no generation, RAO in MW Given network file is "epic14/TestCase12NodesXnodeNoGen.uct" for CORE CC Given crac file is "epic14/cbcora_ep14us6.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 12:00" Then its security status should be "SECURED" Then the worst margin is 2000.0 MW @@ -29,7 +29,7 @@ Feature: US 14.6: Dangling lines Scenario: 14.6.3 : Dangling line with generation, RAO in MW Given network file is "epic14/TestCase12NodesXnodeWithGen.uct" for CORE CC Given crac file is "epic14/cbcora_ep14us6.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 12:00" Then its security status should be "SECURED" Then the worst margin is 1000.0 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_17.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_17.feature index 9204f2ecba..75ce49abd4 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_17.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_17.feature @@ -10,7 +10,7 @@ Feature: US 15.17: Optimize HVDC range actions initially in AC emulation mode # Copy of test case 15.12.5.1, except HVDC is initially in AC emulation mode Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case1.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 1 remedial actions are used in preventive And the setpoint of RangeAction "PRA_HVDC" should be 1422 MW in preventive @@ -22,7 +22,7 @@ Feature: US 15.17: Optimize HVDC range actions initially in AC emulation mode # Copy of test case 15.12.5.2, except HVDC is initially in AC emulation mode Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case2.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 1 remedial actions are used in preventive And the setpoint of RangeAction "PRA_HVDC" should be 2008 MW in preventive @@ -35,7 +35,7 @@ Feature: US 15.17: Optimize HVDC range actions initially in AC emulation mode # Copy of test case 15.12.5.3, except HVDC is initially in AC emulation mode Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case3.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 2 remedial actions are used in preventive And the setpoint of RangeAction "PRA_HVDC" should be 810 MW in preventive @@ -49,7 +49,7 @@ Feature: US 15.17: Optimize HVDC range actions initially in AC emulation mode # Copy of test case 15.12.5.4, except HVDC is initially in AC emulation mode Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case4.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 2 remedial actions are used in preventive And the setpoint of RangeAction "PRA_HVDC" should be 917 MW in preventive @@ -65,7 +65,7 @@ Feature: US 15.17: Optimize HVDC range actions initially in AC emulation mode # Copy of test case 15.12.5.5, except HVDC is initially in AC emulation mode Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case5.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt_maximizing_curative.json" When I launch search_tree_rao Then 2 remedial actions are used in preventive And the setpoint of RangeAction "PRA_HVDC" should be 1236 MW in preventive @@ -83,7 +83,7 @@ Feature: US 15.17: Optimize HVDC range actions initially in AC emulation mode # Copy of test case 15.12.5.6, except HVDC is initially in AC emulation mode Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case6.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt_maximizing_curative.json" When I launch search_tree_rao Then 2 remedial actions are used in preventive And the setpoint of RangeAction "PRA_HVDC" should be 1652 MW in preventive @@ -105,7 +105,7 @@ Feature: US 15.17: Optimize HVDC range actions initially in AC emulation mode # Copy of test case 15.12.5.7, except HVDC is initially in AC emulation mode Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case7.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 1 remedial actions are used in preventive And the setpoint of RangeAction "PRA_HVDC" should be -307 MW in preventive @@ -117,7 +117,7 @@ Feature: US 15.17: Optimize HVDC range actions initially in AC emulation mode # Copy of test case 15.12.5.8, except HVDC is initially in AC emulation mode Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case8.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 0 remedial actions are used in preventive And 1 remedial actions are used after "co1_be1_fr5" at "curative" @@ -130,7 +130,7 @@ Feature: US 15.17: Optimize HVDC range actions initially in AC emulation mode # Copy of test case 15.12.5.9, except HVDC is initially in AC emulation mode Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case9.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 1 remedial actions are used in preventive And the setpoint of RangeAction "PRA_HVDC" should be -307 MW in preventive diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_3.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_3.feature index e8ac3b8156..4174174232 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_3.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_3.feature @@ -9,7 +9,7 @@ Feature: US 15.3: Handle transformers Scenario: US 15.3.1: Handle transformers on a small test case in DC Given network file is "epic15/TestCase12Nodes_with_2_voltage_levels_1.uct" Given crac file is "epic15/SL_ep15us3case1.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 3 remedial actions are used in preventive And the remedial action "open_be1_fr1" is used in preventive diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_7.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_7.feature index 22cbfb1074..58caf54497 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_7.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_7.feature @@ -13,10 +13,11 @@ Feature: US 15.7: Injection setpoint with absolute and relative target Then the remedial action "cra_2" is used in preventive Then the worst margin is 545.8 MW - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: US 15.7.2: Curative search tree RAO with absolute injectionSetpoint curative ra Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic15/cse_crac_1_curative_ra.xml" + Given configuration file is "common/RaoParameters_maxMargin_megawatt_maximizing_curative.json" When I launch search_tree_rao at "2021-04-30 22:30" Then 0 remedial actions are used in preventive And the remedial action "cra_1" is used after "outage_1" at "curative" diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_10/US15_10_1.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_10/US15_10_1.feature index 5e8b0ea5fb..442996df1e 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_10/US15_10_1.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_10/US15_10_1.feature @@ -75,7 +75,7 @@ Feature: US 15.10.1: Modify voltage level topology as remedial action (2 nodes c Given network file is "epic15/TestCase12Nodes_forCSE_3nodes.uct" Given crac file is "epic15/cseCrac_ep15us10-1case6.xml" Given crac creation parameters file is "epic15/CseCracCreationParameters_15_10_1_6.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 1 remedial actions are used in preventive And the remedial action "RA1" is used in preventive diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_10/US15_10_2.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_10/US15_10_2.feature index f00ab61ce3..cb207921ed 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_10/US15_10_2.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_10/US15_10_2.feature @@ -19,7 +19,7 @@ Feature: US 15.10.2: Modify voltage level topology as remedial action (3 nodes c Given network file is "epic15/TestCase12Nodes_forCSE_3nodes_uselessSwitches2.uct" Given crac file is "epic15/cseCrac_ep15us10-1case6.xml" Given crac creation parameters file is "epic15/CseCracCreationParameters_15_10_2.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 0 remedial actions are used in preventive And 1 remedial actions are used after "co1_fr2_fr3" at "curative" @@ -30,7 +30,7 @@ Feature: US 15.10.2: Modify voltage level topology as remedial action (3 nodes c Given network file is "epic15/TestCase12Nodes_forCSE_3nodes_uselessSwitches3.uct" Given crac file is "epic15/cseCrac_ep15us10-1case6.xml" Given crac creation parameters file is "epic15/CseCracCreationParameters_15_10_2.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 1 remedial actions are used in preventive And the remedial action "RA1" is used in preventive @@ -42,7 +42,7 @@ Feature: US 15.10.2: Modify voltage level topology as remedial action (3 nodes c Given network file is "epic15/TestCase12Nodes_forCSE_3nodes_uselessSwitches4.uct" Given crac file is "epic15/cseCrac_ep15us10-1case6.xml" Given crac creation parameters file is "epic15/CseCracCreationParameters_15_10_2.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 1 remedial actions are used in preventive And the remedial action "RA1" is used in preventive diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_3.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_3.feature index 846f6df0f8..6d73f58fb2 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_3.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_3.feature @@ -9,7 +9,7 @@ Feature: US 15.11.3: Simulate range action automatons right after topological au Scenario: US 15.11.3.1: 1 auto HVDC Given network file is "epic15/TestCase16NodesWithHvdc_AC_emulation.xiidm" Given crac file is "epic15/jsonCrac_ep15us11-3case1.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then 0 remedial actions are used in preventive And the setpoint of RangeAction "ARA_HVDC" should be 0.0 MW in preventive diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_4.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_4.feature index 07d6db6b12..c14b0e3b0d 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_4.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_4.feature @@ -5,7 +5,7 @@ Feature: US 15.11.4: ARAO with 2P - @fast @rao @mock @ac @second-preventive @mnec + @fast @rao @mock @dc @second-preventive @mnec Scenario: US 15.11.4.1: Check that PRAO2 ignores applied ARAs from ARAO1 Given network file is "common/TestCase12Nodes2PSTs.uct" Given crac file is "epic15/jsonCrac_ep15us11-4case1.json" @@ -16,16 +16,16 @@ Feature: US 15.11.4: ARAO with 2P # Then the RAO falls back to 1st preventive RAO result Then 2 remedial actions are used in preventive And the remedial action "Open line NL1-NL2" is used in preventive - And the tap of PstRangeAction "PRA_PST_BE" should be -6 in preventive + And the tap of PstRangeAction "PRA_PST_BE" should be -7 in preventive And 1 remedial actions are used after "Contingency_FR1_FR3" at "auto" And 0 remedial actions are used after "Contingency_FR1_FR3" at "curative" And the worst margin is -140 MW And the value of the objective function after CRA should be 140 And the margin on cnec "FR2-FR3-O - preventive" after PRA should be -140 MW - And the margin on cnec "NL2-BE3-O - curative" after CRA should be 0 MW + And the margin on cnec "NL2-BE3-O - curative" after CRA should be 8.9 MW Then the optimization steps executed by the RAO should be "SECOND_PREVENTIVE_IMPROVED_FIRST" - @fast @rao @mock @ac @second-preventive @mnec + @fast @rao @mock @dc @second-preventive @mnec Scenario: US 15.11.4.2: ARAO2 Given network file is "common/TestCase12Nodes2PSTs.uct" Given crac file is "epic15/jsonCrac_ep15us11-4case2.json" @@ -40,5 +40,5 @@ Feature: US 15.11.4: ARAO with 2P And the remedial action "PRA_CRA_PST_BE" is not used after "Contingency_FR1_FR3" at "curative" And the worst margin is -141 MW And the value of the objective function after CRA should be 141 - And the margin on cnec "NL2-BE3-O - curative" after CRA should be 224 MW + And the margin on cnec "NL2-BE3-O - curative" after CRA should be 205 MW Then the optimization steps executed by the RAO should be "SECOND_PREVENTIVE_IMPROVED_FIRST" \ No newline at end of file diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_5.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_5.feature index ed1bb8b3c2..15aa5c9f6a 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_5.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_11/US15_11_5.feature @@ -70,14 +70,7 @@ Feature: US 15.11.5: Additional tests to check various fixes concerning automato Given crac file is "epic15/crac_15_11_5_1.json" Given configuration file is "epic15/RaoParameters_ep15us11-5-3-3.json" When I launch search_tree_rao - And the remedial action "open_de1_de2_open_nl2_be3 - prev" is not used in preventive - And the remedial action "open_de2_nl3 - co1 - auto" is not used after "co1_fr2_de3" at "auto" - And the remedial action "close_fr2_de3 - co1 - auto" is used after "co1_fr2_de3" at "auto" - And the tap of PstRangeAction "pst_be" should be -16 after "co1_fr2_de3" at "curative" - And the margin on cnec "be1_be3_co1 - BBE1AA11->BBE3AA11 - co1_fr2_de3 - curative" after PRA should be -302.38 MW - And the margin on cnec "be1_be3_co1 - BBE1AA11->BBE3AA11 - co1_fr2_de3 - auto" after ARA should be -223.44 MW - And the margin on cnec "be1_be3_co1 - BBE1AA11->BBE3AA11 - co1_fr2_de3 - curative" after CRA should be 240.61 MW - And the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_ONLY" + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" @fast @rao @mock @dc @second-preventive Scenario: US 15.11.5.6: Considering ARA in 2P improves 2P optimization diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_12/US15_12_5.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_12/US15_12_5.feature index 4d07e65c56..a03df6e9a3 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_12/US15_12_5.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_12/US15_12_5.feature @@ -9,7 +9,7 @@ Feature: US 15.12.5: Handle HVDC range actions in RAO Scenario: US 15.12.5.1: HVDC range action with one preventive CNEC Given network file is "epic15/TestCase16NodesWithHvdc.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case1.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 1419 MW in preventive And the worst margin is 400 MW @@ -19,7 +19,7 @@ Feature: US 15.12.5: Handle HVDC range actions in RAO Scenario: US 15.12.5.2: HVDC range action with two preventive CNECs Given network file is "epic15/TestCase16NodesWithHvdc.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case2.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 2008 MW in preventive And the worst margin is 191 MW @@ -30,7 +30,7 @@ Feature: US 15.12.5: Handle HVDC range actions in RAO Scenario: US 15.12.5.3: HVDC range action with PST range action and two preventive CNECs Given network file is "epic15/TestCase16NodesWithHvdc.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case3.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 807 MW in preventive And the tap of PstRangeAction "PST_PRA_PST_be_BBE2AA11 BBE3AA11 1" should be 15 in preventive @@ -42,7 +42,7 @@ Feature: US 15.12.5: Handle HVDC range actions in RAO Scenario: US 15.12.5.4: HVDC range action with outage CNEC Given network file is "epic15/TestCase16NodesWithHvdc.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case4.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 914 MW in preventive And the tap of PstRangeAction "PST_PRA_PST_be_BBE2AA11 BBE3AA11 1" should be 14 in preventive @@ -56,7 +56,7 @@ Feature: US 15.12.5: Handle HVDC range actions in RAO Scenario: US 15.12.5.5: HVDC range action with one curative perimeter Given network file is "epic15/TestCase16NodesWithHvdc.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case5.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 1233 MW in preventive And the tap of PstRangeAction "PST_PRA_PST_be_BBE2AA11 BBE3AA11 1" should be 10 in preventive @@ -71,7 +71,7 @@ Feature: US 15.12.5: Handle HVDC range actions in RAO Scenario: US 15.12.5.6: HVDC range action with two curative perimeters and negative initial flow Given network file is "epic15/TestCase16NodesWithHvdc.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case6.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 1652 MW in preventive And the tap of PstRangeAction "PST_PRA_PST_be_BBE2AA11 BBE3AA11 1" should be 3 in preventive @@ -89,7 +89,7 @@ Feature: US 15.12.5: Handle HVDC range actions in RAO Scenario: US 15.12.5.7: HVDC with a negative optimal setpoint Given network file is "epic15/TestCase16NodesWithHvdc.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case7.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be -354 MW in preventive And the worst margin is 50 MW @@ -99,7 +99,7 @@ Feature: US 15.12.5: Handle HVDC range actions in RAO Scenario: US 15.12.5.8: HVDC and PST filtering Given network file is "epic15/TestCase16NodesWithHvdc.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case8.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "CRA_HVDC" should be 1419 MW after "co1_be1_fr5" at "curative" And the worst margin is 300 MW @@ -109,7 +109,7 @@ Feature: US 15.12.5: Handle HVDC range actions in RAO Scenario: US 15.12.5.9: HVDC inverted in CRAC file Given network file is "epic15/TestCase16NodesWithHvdc.xiidm" Given crac file is "epic15/jsonCrac_ep15us12-5case9.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be -354 MW in preventive And the worst margin is 50 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_12/US15_12_7.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_12/US15_12_7.feature index cd92d137a4..9ed526e0b8 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_12/US15_12_7.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/epic15_12/US15_12_7.feature @@ -9,7 +9,7 @@ Feature: US 15.12.7: Handle CSE's HVDCs with range actions on injections Scenario: US 15.12.7.1: UCTE HVDC as InjectionRangeAction with one preventive CNEC Given network file is "epic15/TestCase16NodesWithUcteHvdc.uct" Given crac file is "epic15/cseCrac_ep15us12-5case1.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 1406 MW in preventive And the worst margin is 380 MW @@ -19,7 +19,7 @@ Feature: US 15.12.7: Handle CSE's HVDCs with range actions on injections Scenario: US 15.12.7.2: UCTE HVDC as InjectionRangeAction with two preventive CNECs Given network file is "epic15/TestCase16NodesWithUcteHvdc.uct" Given crac file is "epic15/cseCrac_ep15us12-5case2.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 1985 MW in preventive And the worst margin is 172 MW @@ -30,7 +30,7 @@ Feature: US 15.12.7: Handle CSE's HVDCs with range actions on injections Scenario: US 15.12.7.3: UCTE HVDC as InjectionRangeAction with PST range action and two preventive CNECs Given network file is "epic15/TestCase16NodesWithUcteHvdc.uct" Given crac file is "epic15/cseCrac_ep15us12-5case3.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 828 MW in preventive And the tap of PstRangeAction "PST_PRA_PST_be_BBE2AA11 BBE3AA11 1" should be 15 in preventive @@ -42,7 +42,7 @@ Feature: US 15.12.7: Handle CSE's HVDCs with range actions on injections Scenario: US 15.12.7.4: UCTE HVDC as InjectionRangeAction with outage CNEC Given network file is "epic15/TestCase16NodesWithUcteHvdc.uct" Given crac file is "epic15/cseCrac_ep15us12-5case4.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 929 MW in preventive And the tap of PstRangeAction "PST_PRA_PST_be_BBE2AA11 BBE3AA11 1" should be 14 in preventive @@ -56,7 +56,7 @@ Feature: US 15.12.7: Handle CSE's HVDCs with range actions on injections Scenario: US 15.12.7.5: UCTE HVDC as InjectionRangeAction with one curative perimeter Given network file is "epic15/TestCase16NodesWithUcteHvdc.uct" Given crac file is "epic15/cseCrac_ep15us12-5case5.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 1230 MW in preventive And the tap of PstRangeAction "PST_PRA_PST_be_BBE2AA11 BBE3AA11 1" should be 10 in preventive @@ -71,7 +71,7 @@ Feature: US 15.12.7: Handle CSE's HVDCs with range actions on injections Scenario: US 15.12.7.6: UCTE HVDC as InjectionRangeAction with two curative perimeters and negative initial flow Given network file is "epic15/TestCase16NodesWithUcteHvdc.uct" Given crac file is "epic15/cseCrac_ep15us12-5case6.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be 1661 MW in preventive And the tap of PstRangeAction "PST_PRA_PST_be_BBE2AA11 BBE3AA11 1" should be 3 in preventive @@ -89,7 +89,7 @@ Feature: US 15.12.7: Handle CSE's HVDCs with range actions on injections Scenario: US 15.12.7.7: UCTE HVDC as InjectionRangeAction with a negative optimal setpoint Given network file is "epic15/TestCase16NodesWithUcteHvdc.uct" Given crac file is "epic15/cseCrac_ep15us12-5case7.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the setpoint of RangeAction "PRA_HVDC" should be -353 MW in preventive And the worst margin is 47 MW @@ -99,7 +99,7 @@ Feature: US 15.12.7: Handle CSE's HVDCs with range actions on injections Scenario: US 15.12.7.8: UCTE HVDC as InjectionRangeAction and PST filtering Given network file is "epic15/TestCase16NodesWithUcteHvdc.uct" Given crac file is "epic15/cseCrac_ep15us12-5case8.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" Given crac creation parameters file is "epic15/us_15_2_7.json" When I launch search_tree_rao Then the setpoint of RangeAction "CRA_HVDC" should be 1406 MW after "co1_be1_fr5" at "curative" diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic16_specific_usage_rules/US16_5.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic16_specific_usage_rules/US16_5.feature index 45bbc1de50..6841b4bd5f 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic16_specific_usage_rules/US16_5.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic16_specific_usage_rules/US16_5.feature @@ -196,7 +196,7 @@ Feature: User Story #16.5: activate remedial actions only after a constraint in Scenario: US 16.5.14: Trigger ARA only after a given outage Given network file is "epic16/12Nodes3ParallelLines.uct" Given crac file is "epic16/crac_16_5_14.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao # An overload is created in the Netherlands only after co_nl1_nl_2_1 # Thus, the OnFlowConstraintInCountry ARA must be triggered only after this contingency @@ -209,7 +209,7 @@ Feature: User Story #16.5: activate remedial actions only after a constraint in Scenario: US 16.5.15: Trigger CRA only after a given outage Given network file is "epic16/12Nodes4ParallelLines.uct" Given crac file is "epic16/crac_16_5_15.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao # An overload is created in the Netherlands only after co_nl1_nl_2_1 # Thus, the OnFlowConstraintInCountry CRA must be triggered only after this contingency diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_2.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_2.feature index e4585818de..9e8c34b792 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_2.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_2.feature @@ -11,19 +11,8 @@ Feature: US 19.2: Handle maximum topological CRA per TSO Given crac file is "epic19/SL_ep19us2case1.json" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao - Then 3 remedial actions are used in preventive - And the remedial action "open_be1_be4" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And the tap of PstRangeAction "pst_be" should be -15 in preventive - Then 1 remedial actions are used after "co1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_fr" should be -5 after "co1_fr2_fr3_1" at "curative" - And the worst margin is -810 A on cnec "FFR1AA1 FFR4AA1 1 - co1_fr2_fr3_1 - curative" - And the margin on cnec "BBE4AA1 FFR5AA1 1 - preventive" after PRA should be 300 A - And the margin on cnec "BBE2AA1 FFR3AA1 1 - preventive" after PRA should be 308 A - Then the margin on cnec "FFR1AA1 FFR4AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be -810 A - Then the margin on cnec "BBE4AA1 FFR5AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be 335 A - Then the margin on cnec "FFR3AA1 FFR5AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be 352 A - Then the margin on cnec "BBE2AA1 FFR3AA1 1 - co1_fr2_fr3_1 - curative" after CRA should be 392 A + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst margin is -686.35 A on cnec "FFR1AA1 FFR4AA1 1 - co1_fr2_fr3_1 - curative" @fast @rao @mock @ac @contingency-scenarios Scenario: US 19.2.2: Check that the maximum number of network actions per TSO is respected in curative - reference run @@ -74,10 +63,7 @@ Feature: US 19.2: Handle maximum topological CRA per TSO Given crac file is "epic19/SL_ep19us2case5.json" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao - Then 2 remedial actions are used in preventive - And the remedial action "open_be1_be4" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And 0 remedial actions are used after "co1_fr2_fr3_1" at "curative" + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" @fast @rao @mock @ac @contingency-scenarios Scenario: US 19.2.6: Check country filtering is well done in curative diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_5.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_5.feature index 041c311824..548c7ba0a5 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_5.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_5.feature @@ -109,7 +109,4 @@ Feature: US 19.5: max number of CRAs Given crac file is "epic19/SL_ep19us5case10.json" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao - Then 3 remedial actions are used in preventive - And the remedial action "open_be1_be4" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And the tap of PstRangeAction "pst_be" should be -15 in preventive \ No newline at end of file + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" \ No newline at end of file diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_6.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_6.feature index 857fe5c3b1..4947cd7346 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_6.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_6.feature @@ -112,7 +112,4 @@ Feature: US 19.6: handle maximum number of TSOs using RAs in curative optimizati Given crac file is "epic19/SL_ep19us6case10.json" Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao - Then 3 remedial actions are used in preventive - And the remedial action "open_be1_be4" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And the tap of PstRangeAction "pst_be" should be -15 in preventive \ No newline at end of file + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" \ No newline at end of file diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_7.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_7.feature index 8f6c032b8a..f8e816a7c2 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_7.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic19_specific_rao_parameters/US19_7.feature @@ -29,19 +29,7 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs Given crac file is "epic19/CBCORA_ep19us7case2.xml" Given configuration file is "epic19/RaoParameters_maxMargin_ampere_shareCra.json" When I launch search_tree_rao at "2019-01-08 12:00" - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -242 A - And the value of the objective function after CRA should be 242.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -242 A - And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 675 A - And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 984 A - And the margin on cnec "fr4_de1_N - preventive" after PRA should be 984 A + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" @fast @rao @mock @ac @contingency-scenarios Scenario: 19.7.3.A: Most limiting CNEC belongs to operator not sharing CRAs - AMP @@ -68,19 +56,7 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs Given crac file is "epic19/CBCORA_ep19us7case4.xml" Given configuration file is "epic19/RaoParameters_maxMargin_ampere_shareCra.json" When I launch search_tree_rao at "2019-01-08 12:00" - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -242 A - And the value of the objective function after CRA should be 242.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -242 A - And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 675 A - And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 984 A - And the margin on cnec "fr4_de1_N - preventive" after PRA should be 984 A + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" @fast @rao @mock @ac @contingency-scenarios Scenario: 19.7.5.A: Second most limiting CNEC after PRA belongs to operator not sharing CRAs, and is improved in CRAO - AMP @@ -111,18 +87,7 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs Given crac file is "epic19/CBCORA_ep19us7case6.xml" Given configuration file is "epic19/RaoParameters_maxMargin_ampere_shareCra.json" When I launch search_tree_rao at "2019-01-08 12:00" - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 1 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -250 A - And the value of the objective function after CRA should be 250.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -250 A - And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 18 A - And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 984 A - And the margin on cnec "fr4_de1_N - preventive" after PRA should be 984 A + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" @fast @rao @mock @ac @contingency-scenarios Scenario: 19.7.7.A: Only PSTs - All CNECs belong to one operator sharing a CRA - AMP @@ -167,7 +132,7 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 603 A And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 610 A - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: 19.7.1.MW: All CNECs belong to one operator not sharing CRAs - MW Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic13/CBCORA_ep13us3case10.xml" @@ -179,33 +144,21 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the tap of PstRangeAction "pst_fr" should be 15 in preventive And 0 remedial actions are used after "CO1_fr2_fr3_1" at "curative" And the worst margin is -339 MW - And the value of the objective function after CRA should be -682.0 + And the value of the objective function after CRA should be -984 And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -339 MW And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 543 MW And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 682 MW And the margin on cnec "fr4_de1_N - preventive" after PRA should be 682 MW - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: 19.7.2.MW: All CNECs belong to one operator sharing one CRA - MW Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case2.xml" Given configuration file is "epic19/RaoParameters_maxMargin_megawatt_shareCra.json" When I launch search_tree_rao at "2019-01-08 12:00" - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -166 MW - And the value of the objective function after CRA should be 166.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -166 MW - And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 468 MW - And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 682 MW - And the margin on cnec "fr4_de1_N - preventive" after PRA should be 682 MW + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: 19.7.3.MW: Most limiting CNEC belongs to operator not sharing CRAs - MW Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case3.xml" @@ -218,32 +171,21 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And 1 remedial actions are used after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" And the worst margin is -310 MW - And the value of the objective function after CRA should be -682.0 + And the value of the objective function after CRA should be -984 And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -310 MW And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 691 MW And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 682 MW And the margin on cnec "fr4_de1_N - preventive" after PRA should be 682 MW - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: 19.7.4.MW: Second most limiting CNEC belongs to operator not sharing CRAs - MW Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case4.xml" Given configuration file is "epic19/RaoParameters_maxMargin_megawatt_shareCra.json" When I launch search_tree_rao at "2019-01-08 12:00" - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -166 MW - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -166 MW - And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 468 MW - And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 682 MW - And the margin on cnec "fr4_de1_N - preventive" after PRA should be 682 MW + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: 19.7.5.MW: Second most limiting CNEC after PRA belongs to operator not sharing CRAs, and is improved in CRAO - MW Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case5.xml" @@ -259,47 +201,36 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the tap of PstRangeAction "pst_fr" should be -5 after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_fr_cur" should be -5 after "CO1_fr2_fr3_1" at "curative" And the worst margin is 31 MW - And the value of the objective function after CRA should be -498.0 + And the value of the objective function after CRA should be -718 And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 512 MW And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 31 MW And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 682 MW And the margin on cnec "fr4_de1_CO1 - curative" after CRA should be 498 MW And the margin on cnec "fr4_de1_N - preventive" after PRA should be 682 MW - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: 19.7.6.MW: Second most limiting CNEC after PRA belongs to operator not sharing CRAs, and can become most limiting in CRAO - MW Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case6.xml" Given configuration file is "epic19/RaoParameters_maxMargin_megawatt_shareCra.json" When I launch search_tree_rao at "2019-01-08 12:00" - Then 3 remedial actions are used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 1 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -171 MW - And the value of the objective function after CRA should be 171 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -171 MW - And the margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 12 MW - And the margin on cnec "fr3_fr5_CO1 - DIR - outage" after PRA should be 682 MW - And the margin on cnec "fr4_de1_N - preventive" after PRA should be 682 MW + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: 19.7.7.MW: Only PSTs - All CNECs belong to one operator sharing a CRA - MW Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case7.xml" Given configuration file is "epic19/RaoParameters_maxMargin_megawatt_shareCra.json" When I launch search_tree_rao at "2019-01-08 12:00" after "CO1_fr2_fr3_1" at "curative" Then 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -2 after "CO1_fr2_fr3_1" at "curative" + And the tap of PstRangeAction "pst_be" should be -3 after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_fr" should be -5 after "CO1_fr2_fr3_1" at "curative" And the worst margin is 420 MW - And the value of the objective function after CRA should be -420.0 + And the value of the objective function after CRA should be -603.0 And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 420 MW - And the margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 430 MW + And the margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 418 MW - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: 19.7.8.MW: Only PSTs - Most limiting CNEC belongs to an operator not sharing CRAs - MW Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case8.xml" @@ -309,24 +240,24 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the tap of PstRangeAction "pst_be" should be 9 after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_fr" should be 4 after "CO1_fr2_fr3_1" at "curative" And the worst margin is 91 MW - And the value of the objective function after CRA should be -572.0 + And the value of the objective function after CRA should be -827.0 And the margin on cnec "fr4_de1_CO1 - curative" after CRA should be 573 MW And the margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 572 MW And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 91 MW - @fast @rao @mock @ac @contingency-scenarios + @fast @rao @mock @dc @contingency-scenarios Scenario: 19.7.9.MW: Only PSTs - Second most limiting CNEC belongs to an operator not sharing CRAs - MW Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case9.xml" Given configuration file is "epic19/RaoParameters_maxMargin_megawatt_shareCra.json" When I launch search_tree_rao at "2019-01-08 12:00" after "CO1_fr2_fr3_1" at "curative" Then 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -2 after "CO1_fr2_fr3_1" at "curative" + And the tap of PstRangeAction "pst_be" should be -3 after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_fr" should be -5 after "CO1_fr2_fr3_1" at "curative" And the worst margin is 420 MW - And the value of the objective function after CRA should be -420.0 + And the value of the objective function after CRA should be -603.0 And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 420 MW - And the margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 430 MW + And the margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 418 MW @fast @rao @mock @ac @contingency-scenarios @relative Scenario: 19.7.1.A.R: All CNECs belong to one operator not sharing CRAs - AMP - relative @@ -355,19 +286,8 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs Given configuration file is "epic19/RaoParameters_maxRelMargin_ampere_shareCra.json" Given loopflow glsk file is "common/glsk_proportional_16nodes.xml" When I launch search_tree_rao at "2019-01-08 12:00" - Then 4 remedial actions are used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -565 A - And the value of the objective function after CRA should be 565.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -565 A - And the relative margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 343 A - And the relative margin on cnec "fr4_de1_N - preventive" after PRA should be 1269 A - And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 1289 A + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst relative margin is 112.23 MW @fast @rao @mock @ac @contingency-scenarios @relative Scenario: 19.7.3.A.R: Most limiting CNEC belongs to operator not sharing CRAs - AMP - relative @@ -397,20 +317,8 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs Given configuration file is "epic19/RaoParameters_maxRelMargin_ampere_shareCra.json" Given loopflow glsk file is "common/glsk_proportional_16nodes.xml" When I launch search_tree_rao at "2019-01-08 12:00" - Then 4 remedial actions are used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be 16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -572 A - And the value of the objective function after CRA should be 565.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -572 A - And the relative margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 343 A - And the relative margin on cnec "fr4_de1_N - preventive" after PRA should be 1269 A - And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 1289 A + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst relative margin is 112.23 MW @fast @rao @mock @ac @contingency-scenarios @relative @@ -445,19 +353,8 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs Given configuration file is "epic19/RaoParameters_maxRelMargin_ampere_shareCra.json" Given loopflow glsk file is "common/glsk_proportional_16nodes.xml" When I launch search_tree_rao at "2019-01-08 12:00" - Then 4 remedial actions are used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 1 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -61 A - And the value of the objective function after CRA should be 61.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -61 A - And the relative margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 140 A - And the relative margin on cnec "fr4_de1_N - preventive" after PRA should be 1269 A - And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 1340 A + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst relative margin is 289.88 MW @fast @rao @mock @ac @contingency-scenarios @relative @@ -506,7 +403,7 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the relative margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 843 A And the relative margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 833 A - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: 19.7.1.MW.R: All CNECs belong to one operator not sharing CRAs - MW - relative Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic13/CBCORA_ep13us3case10.xml" @@ -520,35 +417,23 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the tap of PstRangeAction "pst_fr" should be 15 in preventive And 0 remedial actions are used after "CO1_fr2_fr3_1" at "curative" And the worst margin is -622 MW - And the value of the objective function after CRA should be -879.0 + And the value of the objective function after CRA should be -1270.0 And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -622 MW And the relative margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 749 MW And the relative margin on cnec "fr4_de1_N - preventive" after PRA should be 879 MW And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 879 MW - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: 19.7.2.MW.R: All CNECs belong to one operator sharing one CRA - MW - relative Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case2.xml" Given configuration file is "epic19/RaoParameters_maxRelMargin_megawatt_shareCra.json" Given loopflow glsk file is "common/glsk_proportional_16nodes.xml" When I launch search_tree_rao at "2019-01-08 12:00" - Then 4 remedial actions are used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be 16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -389 MW - And the value of the objective function after CRA should be 389.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -389 MW - And the relative margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 238 MW - And the relative margin on cnec "fr4_de1_N - preventive" after PRA should be 879 MW - And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 893 MW + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst relative margin is 112.23 MW - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: 19.7.3.MW.R: Most limiting CNEC belongs to operator not sharing CRAs - MW - relative Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case3.xml" @@ -563,35 +448,23 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And 1 remedial actions are used after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_be" should be -9 after "CO1_fr2_fr3_1" at "curative" And the worst margin is -606 MW - And the value of the objective function after CRA should be -851.0 + And the value of the objective function after CRA should be -1230.0 And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -606 MW And the relative margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 851 MW And the relative margin on cnec "fr4_de1_N - preventive" after PRA should be 879 MW And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 907 MW - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: 19.7.4.MW.R: Second most limiting CNEC belongs to operator not sharing CRAs - MW - relative Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case4.xml" Given configuration file is "epic19/RaoParameters_maxRelMargin_megawatt_shareCra.json" Given loopflow glsk file is "common/glsk_proportional_16nodes.xml" When I launch search_tree_rao at "2019-01-08 12:00" - Then 4 remedial actions are used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 2 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the remedial action "open_fr1_fr3" is used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be 16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -389 MW - And the value of the objective function after CRA should be 389.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -389 MW - And the relative margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 238 MW - And the relative margin on cnec "fr4_de1_N - preventive" after PRA should be 879 MW - And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 893 MW + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst relative margin is 112.23 MW - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: 19.7.5.MW.R: Second most limiting CNEC after PRA belongs to operator not sharing CRAs, and is improved in CRAO - MW - relative Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case5R.xml" @@ -609,32 +482,21 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the tap of PstRangeAction "pst_fr" should be -10 after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_fr_cur" should be -10 after "CO1_fr2_fr3_1" at "curative" And the worst relative margin is 355 MW - And the value of the objective function after CRA should be -491.0 + And the value of the objective function after CRA should be -709.0 And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 491 MW And the relative margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 355 MW - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: 19.7.6.MW.R: Second most limiting CNEC after PRA belongs to operator not sharing CRAs, and can become most limiting in CRAO - MW - relative Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case6R.xml" Given configuration file is "epic19/RaoParameters_maxRelMargin_megawatt_shareCra.json" Given loopflow glsk file is "common/glsk_proportional_16nodes.xml" When I launch search_tree_rao at "2019-01-08 12:00" - Then 4 remedial actions are used in preventive - And the remedial action "close_fr1_fr5" is used in preventive - And the remedial action "open_fr1_fr2" is used in preventive - And the remedial action "close_de3_de4" is used in preventive - And the tap of PstRangeAction "pst_fr" should be 15 in preventive - And 1 remedial actions are used after "CO1_fr2_fr3_1" at "curative" - And the tap of PstRangeAction "pst_be" should be -16 after "CO1_fr2_fr3_1" at "curative" - And the worst margin is -39 MW - And the value of the objective function after CRA should be 39.0 - And the margin on cnec "fr1_fr4_CO1 - curative" after CRA should be -39 MW - And the relative margin on cnec "fr3_fr5_CO1 - DIR - curative" after CRA should be 97 MW - And the relative margin on cnec "fr4_de1_N - preventive" after PRA should be 879 MW - And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 929 MW + Then the optimization steps executed by the RAO should be "FIRST_PREVENTIVE_FELLBACK_TO_INITIAL_SITUATION" + And the worst relative margin is 289.88 MW - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: 19.7.7.MW.R: Only PSTs - All CNECs belong to one operator sharing a CRA - MW - relative Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case7.xml" @@ -645,11 +507,11 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the tap of PstRangeAction "pst_be" should be 2 after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_fr" should be -5 after "CO1_fr2_fr3_1" at "curative" And the worst relative margin is 578 MW - And the value of the objective function after CRA should be -578.0 + And the value of the objective function after CRA should be -833.0 And the relative margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 585 MW And the relative margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 578 MW - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: 19.7.8.MW.R: Only PSTs - Most limiting CNEC belongs to an operator not sharing CRAs - MW - relative Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case8.xml" @@ -660,12 +522,12 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the tap of PstRangeAction "pst_be" should be 13 after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_fr" should be 4 after "CO1_fr2_fr3_1" at "curative" And the worst relative margin is 115 MW - And the value of the objective function after CRA should be -751.0 + And the value of the objective function after CRA should be -1084.0 And the relative margin on cnec "fr4_de1_CO1 - curative" after CRA should be 751 MW And the relative margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 760 MW And the relative margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 115 MW - @fast @rao @mock @ac @contingency-scenarios @relative + @fast @rao @mock @dc @contingency-scenarios @relative Scenario: 19.7.9.MW.R: Only PSTs - Second most limiting CNEC belongs to an operator not sharing CRAs - MW - relative Given network file is "epic13/TestCase16Nodes_with_different_imax.uct" for CORE CC Given crac file is "epic19/CBCORA_ep19us7case9.xml" @@ -676,6 +538,6 @@ Feature: US 19.7: handle CNECs belonging to TSOs that don't share CRAs And the tap of PstRangeAction "pst_be" should be 2 after "CO1_fr2_fr3_1" at "curative" And the tap of PstRangeAction "pst_fr" should be -5 after "CO1_fr2_fr3_1" at "curative" And the worst relative margin is 578 MW - And the value of the objective function after CRA should be -578.0 + And the value of the objective function after CRA should be -833.0 And the relative margin on cnec "fr3_fr5_CO1 - OPP - curative" after CRA should be 585 MW And the relative margin on cnec "fr1_fr4_CO1 - curative" after CRA should be 578 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic20_advanced_search_tree/US20_4.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic20_advanced_search_tree/US20_4.feature index 85143e2d0d..010af9b221 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic20_advanced_search_tree/US20_4.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic20_advanced_search_tree/US20_4.feature @@ -5,7 +5,7 @@ Feature: US 20.4: Handle MNECs in second preventive optimization - @fast @rao @mock @ac @second-preventive @mnec + @fast @rao @mock @dc @second-preventive @mnec Scenario: US 20.4.1: MNEC constraint in curative is solved by 2P Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic20/CBCORA_ep20us4case1.xml" @@ -21,7 +21,7 @@ Feature: US 20.4: Handle MNECs in second preventive optimization And the margin on cnec "NL2-BE3-O - curative" after CRA should be 7 MW Then the optimization steps executed by the RAO should be "SECOND_PREVENTIVE_IMPROVED_FIRST" - @fast @rao @mock @ac @second-preventive @mnec + @fast @rao @mock @dc @second-preventive @mnec Scenario: US 20.4.2: MNEC constraint in curative is solved by CRA + 2P Given network file is "common/TestCase12Nodes2PSTs.uct" for CORE CC Given crac file is "epic20/CBCORA_ep20us4case2.xml" @@ -38,7 +38,7 @@ Feature: US 20.4: Handle MNECs in second preventive optimization And the margin on cnec "NL2-BE3-O - curative" after CRA should be 7 MW Then the optimization steps executed by the RAO should be "SECOND_PREVENTIVE_IMPROVED_FIRST" - @fast @rao @mock @ac @second-preventive @mnec + @fast @rao @mock @dc @second-preventive @mnec Scenario: US 20.4.3: MNEC constraint avoided on preventive MNEC in 2P Given network file is "common/TestCase12Nodes2PSTs.uct" for CORE CC Given crac file is "epic20/CBCORA_ep20us4case3.xml" diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic4_dc_mw/US4_2.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic4_dc_mw/US4_2.feature index f4b346ebe5..dc7f7cb07c 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic4_dc_mw/US4_2.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic4_dc_mw/US4_2.feature @@ -9,7 +9,7 @@ Feature: US 4.2: Optimization in A/MW, thresholds in A/MW, computation in AC/DC Scenario: US 4.2.1: MW thresholds in DC mode and min margin in MW Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic4/SL_ep4us2_4MR_MW.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the worst margin is 19.0 MW And the value of the objective function after CRA should be -19.0 @@ -18,24 +18,24 @@ Feature: US 4.2: Optimization in A/MW, thresholds in A/MW, computation in AC/DC And the margin on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be 20.0 MW And the margin on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be 44.0 MW - @fast @rao @mock @ac @preventive-only + @fast @rao @mock @dc @preventive-only Scenario: US 4.2.2: MW thresholds in AC mode and min margin in MW Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic4/SL_ep4us2_4MR_MW.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the worst margin is 19.0 MW And the value of the objective function after CRA should be -19.0 - And the tap of PstRangeAction "PRA_PST_BE" should be 4 in preventive + And the tap of PstRangeAction "PRA_PST_BE" should be 5 in preventive And the margin on cnec "FFR2AA1 DDE3AA1 1 - N-1 NL1-NL3 - outage" after PRA should be 25.0 MW - And the margin on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be 19.0 MW - And the margin on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be 49.0 MW + And the margin on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be 24.0 MW + And the margin on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be 44.0 MW @fast @rao @mock @dc @preventive-only Scenario: US 4.2.3: A thresholds in DC mode and min margin in MW Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic4/SL_ep4us2_4MR_A.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the worst margin is 15.0 MW Then the value of the objective function after CRA should be -15.0 @@ -62,7 +62,7 @@ Feature: US 4.2: Optimization in A/MW, thresholds in A/MW, computation in AC/DC Scenario: US 4.2.5: mixed thresholds in DC mode and min margin in MW Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic4/SL_ep4us2_4MR_mixed.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the worst margin is 19.0 MW Then the value of the objective function after CRA should be -19.0 @@ -74,10 +74,10 @@ Feature: US 4.2: Optimization in A/MW, thresholds in A/MW, computation in AC/DC Scenario: US 4.2.6: mixed thresholds in AC mode and min margin in MW Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic4/SL_ep4us2_4MR_mixed.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then the worst margin is 19.0 MW Then the value of the objective function after CRA should be -19.0 - Then the tap of PstRangeAction "PRA_PST_BE" should be 4 in preventive - And the margin on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be 19.0 MW + Then the tap of PstRangeAction "PRA_PST_BE" should be 5 in preventive + And the margin on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be 24.0 MW And the margin on cnec "FFR2AA1 DDE3AA1 1 - N-1 NL1-NL3 - outage" after PRA should be 23.0 MW \ No newline at end of file diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic5_max_margin_stop_criterion/US5_1.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic5_max_margin_stop_criterion/US5_1.feature index b1414a61ee..f6c076759a 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic5_max_margin_stop_criterion/US5_1.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic5_max_margin_stop_criterion/US5_1.feature @@ -70,7 +70,7 @@ Feature: US 5.1: Maximum margin stop criterion Then the remedial action "Open tie-line FR1 FR2" is used in preventive Then the remedial action "Open tie-line FR1 FR3" is used in preventive - @fast @rao @mock @ac @preventive-only + @fast @rao @mock @dc @preventive-only Scenario: US 5.1.4.b: maximum margin stop criterion: absolute minimum impact threshold not reached Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic5/SL_ep5us1.json" diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_10.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_10.feature index a7efca9347..eed4055602 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_10.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_10.feature @@ -5,33 +5,33 @@ Feature: US 7.10: Search-tree RAO with loopflow limitation - @fast @rao @mock @ac @preventive-only + @fast @rao @mock @dc @preventive-only Scenario: US 7.10.1: Simple search tree RAO without LF limitation Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic7/crac_lf_rao_3.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then its security status should be "UNSECURED" - Then the worst margin is -143.0 MW - Then the worst margin is -143.0 MW on cnec "FFR2AA1 DDE3AA1 1 - preventive" + Then the worst margin is -160.0 MW + Then the worst margin is -160.0 MW on cnec "FFR2AA1 DDE3AA1 1 - preventive" Then the tap of PstRangeAction "PRA_PST_BE" should be -16 in preventive Then 2 remedial actions are used in preventive Then the remedial action "Open FR1 FR2" is used in preventive Then the remedial action "PRA_PST_BE" is used in preventive - @fast @rao @mock @ac @preventive-only @loopflow + @fast @rao @mock @dc @preventive-only @loopflow Scenario: US 7.10.2: Simple search tree RAO with LF limited by a predefined threshold Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic7/crac_lf_rao_3.json" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json" When I launch loopflow search_tree_rao with default loopflow limit as 50.0 percent of pmax Then its security status should be "UNSECURED" - Then the worst margin is -349.0 MW - Then the worst margin is -349.0 MW on cnec "FFR2AA1 DDE3AA1 1 - preventive" - Then the tap of PstRangeAction "PRA_PST_BE" should be 4 in preventive - Then 2 remedial actions are used in preventive - Then the remedial action "Open FR1 FR2" is used in preventive + Then the worst margin is -401.0 MW + Then the worst margin is -401.0 MW on cnec "FFR2AA1 DDE3AA1 1 - preventive" + Then the tap of PstRangeAction "PRA_PST_BE" should be -10 in preventive + Then 1 remedial actions are used in preventive + Then the remedial action "PRA_PST_BE" is used in preventive And the loopflow threshold on cnec "DDE2AA1 NNL3AA1 1 - preventive" should be 2000.0 MW And the loopflow threshold on cnec "NNL2AA1 BBE3AA1 1 - preventive" should be 2000.0 MW And the loopflow threshold on cnec "FFR2AA1 DDE3AA1 1 - preventive" should be 500.0 MW @@ -40,17 +40,17 @@ Feature: US 7.10: Search-tree RAO with loopflow limitation And the initial loopflow on cnec "NNL2AA1 BBE3AA1 1 - preventive" should be -391.0 MW And the initial loopflow on cnec "FFR2AA1 DDE3AA1 1 - preventive" should be -391.0 MW And the initial loopflow on cnec "BBE2AA1 FFR3AA1 1 - preventive" should be -391.0 MW - And the loopflow on cnec "DDE2AA1 NNL3AA1 1 - preventive" after PRA should be -498.0 MW - And the loopflow on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be -498.0 MW - And the loopflow on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be -498.0 MW - And the loopflow on cnec "BBE2AA1 FFR3AA1 1 - preventive" after PRA should be -498.0 MW + And the loopflow on cnec "DDE2AA1 NNL3AA1 1 - preventive" after PRA should be -490.0 MW + And the loopflow on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be -490.0 MW + And the loopflow on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be -490.0 MW + And the loopflow on cnec "BBE2AA1 FFR3AA1 1 - preventive" after PRA should be -490.0 MW @fast @rao @mock @ac @preventive-only @loopflow Scenario: US 7.10.3: Simple search tree RAO with LF limited by their initial value Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic7/crac_lf_rao_3.json" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_ac_lf_false_5_100.json" When I launch loopflow search_tree_rao with default loopflow limit as 25.0 percent of pmax Then its security status should be "UNSECURED" Then the worst margin is -463.0 MW @@ -75,12 +75,12 @@ Feature: US 7.10: Search-tree RAO with loopflow limitation Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic7/crac_lf_rao_3.json" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_true_5_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_mw_dc_lf_true_5_100.json" When I launch loopflow search_tree_rao with default loopflow limit as 50.0 percent of pmax Then its security status should be "UNSECURED" Then the worst margin is -391.0 MW Then the worst margin is -391.0 MW on cnec "FFR2AA1 DDE3AA1 1 - preventive" - Then the tap of PstRangeAction "PRA_PST_BE" should be -10 in preventive + Then the tap of PstRangeAction "PRA_PST_BE" should be -11 in preventive And the loopflow threshold on cnec "DDE2AA1 NNL3AA1 1 - preventive" should be 2000.0 MW And the loopflow threshold on cnec "NNL2AA1 BBE3AA1 1 - preventive" should be 2000.0 MW And the loopflow threshold on cnec "FFR2AA1 DDE3AA1 1 - preventive" should be 500.0 MW @@ -97,7 +97,7 @@ Feature: US 7.10: Search-tree RAO with loopflow limitation Scenario: US 7.10.5: Complex search tree RAO without LF limitation Given network file is "common/TestCase12Nodes2PSTs.uct" Given crac file is "epic7/crac_lf_rao_4.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_ampere.json" When I launch search_tree_rao Then its security status should be "UNSECURED" Then the worst margin is -251.0 MW @@ -110,17 +110,17 @@ Feature: US 7.10: Search-tree RAO with loopflow limitation Then the remedial action "Open_BE1_BE3" is used in preventive Then the remedial action "Open_NL1_NL2" is used in preventive - @fast @rao @mock @ac @preventive-only @loopflow + @fast @rao @mock @dc @preventive-only @loopflow Scenario: US 7.10.6: Complex search tree RAO with LF limitation Given network file is "common/TestCase12Nodes2PSTs.uct" Given crac file is "epic7/crac_lf_rao_4.json" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json" When I launch loopflow search_tree_rao with default loopflow limit as 35.0 percent of pmax Then its security status should be "UNSECURED" Then the worst margin is -290.0 MW Then the worst margin is -290.0 MW on cnec "FFR1AA1 FFR2AA1 1 - preventive" - Then the tap of PstRangeAction "PRA_PST_DE" should be -11 in preventive + Then the tap of PstRangeAction "PRA_PST_DE" should be -12 in preventive Then the tap of PstRangeAction "PRA_PST_BE" should be -1 in preventive Then 2 remedial actions are used in preventive And the loopflow threshold on cnec "BBE2AA1 FFR3AA1 1 - preventive" should be 525.5 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_11.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_11.feature index 3dc522bf3e..84459f6c69 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_11.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_11.feature @@ -10,7 +10,7 @@ Feature: US 7.11: Additional tests with CBCORA input files and FRM Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic7/crac_lf_rao_3_cbcora.xml" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_ac_lf_false_5_100.json" When I launch loopflow search_tree_rao at "2019-01-08 00:00" with default loopflow limit as 0.0 percent of pmax # if the loopflow limit is defined equal to zero, josiris-server will not create LoopFlowExtensions @@ -34,31 +34,31 @@ Feature: US 7.11: Additional tests with CBCORA input files and FRM And the initial loopflow on cnec "BBE2AA1 FFR3AA1 1 - preventive" should be -391.0 MW And the loopflow on cnec "BBE2AA1 FFR3AA1 1 - preventive" after PRA should be -384.0 MW - @fast @rao @mock @ac @preventive-only @loopflow + @fast @rao @mock @dc @preventive-only @loopflow Scenario: 7.11.2 : Loop-flow limitation with FRM Given network file is "common/TestCase12Nodes.uct" for CORE CC Given crac file is "epic7/crac_lf_rao_3_with_frm_cbcora.xml" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json" When I launch loopflow search_tree_rao at "2019-01-08 12:00" with default loopflow limit as 0.0 percent of pmax # if the loopflow limit is defined equal to zero, josiris-server will not create LoopFlowExtensions # and the limits given in the CBCORA file will be used instead Then its security status should be "UNSECURED" - Then the worst margin is -451.0 MW - Then the worst margin is -451.0 MW on cnec "FFR2AA1 DDE3AA1 1 - preventive" - Then the tap of PstRangeAction "PRA_PST_BE" should be 9 in preventive + Then the worst margin is -505.0 MW + Then the worst margin is -505.0 MW on cnec "FFR2AA1 DDE3AA1 1 - preventive" + Then the tap of PstRangeAction "PRA_PST_BE" should be 14 in preventive Then the remedial action "Open FR1 FR2" is used in preventive And the loopflow threshold on cnec "DDE2AA1 NNL3AA1 1 - preventive" should be 900.0 MW And the loopflow threshold on cnec "NNL2AA1 BBE3AA1 1 - preventive" should be 800.0 MW And the loopflow threshold on cnec "FFR2AA1 DDE3AA1 1 - preventive" should be 450.0 MW And the loopflow threshold on cnec "BBE2AA1 FFR3AA1 1 - preventive" should be 650.0 MW And the initial loopflow on cnec "DDE2AA1 NNL3AA1 1 - preventive" should be -391.0 MW - And the loopflow on cnec "DDE2AA1 NNL3AA1 1 - preventive" after PRA should be -446.0 MW + And the loopflow on cnec "DDE2AA1 NNL3AA1 1 - preventive" after PRA should be -437.0 MW And the initial loopflow on cnec "NNL2AA1 BBE3AA1 1 - preventive" should be -391.0 MW - And the loopflow on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be -446.0 MW + And the loopflow on cnec "NNL2AA1 BBE3AA1 1 - preventive" after PRA should be -437.0 MW And the initial loopflow on cnec "FFR2AA1 DDE3AA1 1 - preventive" should be -391.0 MW - And the loopflow on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be -446.0 MW + And the loopflow on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be -437.0 MW And the initial loopflow on cnec "BBE2AA1 FFR3AA1 1 - preventive" should be -391.0 MW - And the loopflow on cnec "BBE2AA1 FFR3AA1 1 - preventive" after PRA should be -446.0 MW \ No newline at end of file + And the loopflow on cnec "BBE2AA1 FFR3AA1 1 - preventive" after PRA should be -437.0 MW \ No newline at end of file diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_14.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_14.feature index 417a278fae..94bfe9dda7 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_14.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_14.feature @@ -34,7 +34,7 @@ Feature: US 7.14: Use a refProg file to calculate the loop-flows Given crac file is "epic7/crac_lf_rao_3_cbcora.xml" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" Given RefProg file is "epic7/refProg_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_ac_lf_false_5_100.json" When I launch loopflow search_tree_rao at "2019-01-08 21:30" with default loopflow limit as 0.0 percent of pmax Then the worst margin is -473.0 MW @@ -64,7 +64,7 @@ Feature: US 7.14: Use a refProg file to calculate the loop-flows Given crac file is "epic7/crac_lf_rao_3_with_frm_cbcora.xml" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" Given RefProg file is "epic7/refProg_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_ac_lf_false_5_100.json" When I launch loopflow search_tree_rao at "2019-01-08 21:30" with default loopflow limit as 0.0 percent of pmax Then the worst margin is -378.0 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_7.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_7.feature index 4346c3b77b..46dee23702 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_7.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_7.feature @@ -5,16 +5,16 @@ Feature: US 7.7: Handle optimisation unfeasibility with loopflow constraints - @fast @rao @mock @ac @preventive-only @loopflow + @fast @rao @mock @dc @preventive-only @loopflow Scenario: US 7.7.1: Simple search tree RAO with LF limitation and infeasible linear problem Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic7/crac_lf_rao_3bis.json" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json" When I launch loopflow search_tree_rao with default loopflow limit as 50.0 percent of pmax Then the worst margin is -402.0 MW Then the margin on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be -402.0 MW - Then the tap of PstRangeAction "PRA_PST_BE" should be -9 in preventive + Then the tap of PstRangeAction "PRA_PST_BE" should be -10 in preventive And the loopflow threshold on cnec "FFR2AA1 DDE3AA1 1 - preventive" should be 500.0 MW And the initial loopflow on cnec "FFR2AA1 DDE3AA1 1 - preventive" should be -391.0 MW And the loopflow on cnec "FFR2AA1 DDE3AA1 1 - preventive" after PRA should be -490.0 MW \ No newline at end of file diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_8.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_8.feature index 746b0981f7..52d5f66c39 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_8.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_8.feature @@ -9,7 +9,7 @@ Feature: US 7.8: Loopflow computation (not within the RAO) Scenario: US 7.8.1: optimise network action without loop flow limitation Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic7/crac_lf_rao_2.json" - Given configuration file is "common/RaoParameters_posMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_posMargin_ac.json" When I launch search_tree_rao Then its security status should be "SECURED" Then the worst margin is 92.0 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_9.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_9.feature index 7884385b61..bfd52d003f 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_9.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic7_loopflow/US7_9.feature @@ -5,15 +5,15 @@ Feature: US 7.9: Linear RAO with loopflow limitation - @fast @rao @mock @ac @preventive-only + @fast @rao @mock @dc @preventive-only Scenario: US 7.9.1: linear RAO without LF limitation Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic7/crac_lf_rao_1.json" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao Then its security status should be "SECURED" - And the worst margin is 224.0 MW - And the margin on cnec "FFR1AA1 FFR2AA1 1 - preventive" after PRA should be 224.0 MW + And the worst margin is 219.0 MW + And the margin on cnec "FFR1AA1 FFR2AA1 1 - preventive" after PRA should be 219.0 MW And the tap of PstRangeAction "PRA_PST_BE" should be -16 in preventive @fast @rao @mock @ac @preventive-only @loopflow @@ -21,7 +21,7 @@ Feature: US 7.9: Linear RAO with loopflow limitation Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic7/crac_lf_rao_1.json" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_10_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_ac_lf_false_10_100.json" When I launch loopflow search_tree_rao with default loopflow limit as 10.0 percent of pmax Then the worst margin is 198.0 MW And the margin on cnec "FFR1AA1 FFR2AA1 1 - preventive" after PRA should be 198.0 MW @@ -44,7 +44,7 @@ Feature: US 7.9: Linear RAO with loopflow limitation Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic7/crac_lf_rao_1.json" Given loopflow glsk file is "common/glsk_lots_of_lf_12nodes.xml" - Given configuration file is "epic7/RaoParameters_maxMargin_mw_ac_lf_false_10_100.json" + Given configuration file is "epic7/RaoParameters_maxMargin_ac_lf_false_10_100.json" When I launch loopflow search_tree_rao with default loopflow limit as 5.0 percent of pmax Then the worst margin is 166.0 MW And the margin on cnec "FFR1AA1 FFR2AA1 1 - preventive" after PRA should be 166.0 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic8_core_d2_io/US8_3.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic8_core_d2_io/US8_3.feature index ad613c151e..b7b6cba4b6 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic8_core_d2_io/US8_3.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic8_core_d2_io/US8_3.feature @@ -10,5 +10,5 @@ Feature: US 8.3: Handle elementName tag Given network file is "epic8/US2-3-case1-elementName.uct" for CORE CC Given crac file is "epic8/12nodes_pst_topo_frm_cbcora_elementName.xml" When I launch search_tree_rao at "2019-01-08 12:00" - Then the value of the objective function after CRA should be 24.0 + Then the value of the objective function after CRA should be 44.0 Then the margin on cnec "Cnec1 - preventive" after PRA should be -24.0 MW \ No newline at end of file diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic8_core_d2_io/US8_5.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic8_core_d2_io/US8_5.feature index 6b37130fc8..56fc808a85 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic8_core_d2_io/US8_5.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic8_core_d2_io/US8_5.feature @@ -18,5 +18,5 @@ Feature: US 8.5: Management of FRM during computation Given network file is "epic2/US2-3-case1-standard.uct" for CORE CC Given crac file is "epic8/12nodes_pst_topo_frm_cbcora.xml" When I launch search_tree_rao at "2019-01-08 12:00" - Then the value of the objective function after CRA should be 24.0 + Then the value of the objective function after CRA should be 44.0 Then the margin on cnec "Cnec1 - preventive" after PRA should be -24.0 MW diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic91_rao_enhancements/US91_11.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic91_rao_enhancements/US91_11.feature index b09f7554d6..ee290f451d 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic91_rao_enhancements/US91_11.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic91_rao_enhancements/US91_11.feature @@ -27,7 +27,7 @@ Feature: US 91.11: optimize computations for SECURE stop criterion Scenario: US 91.11.3: Skip curative optimization Given network file is "epic13/TestCase12NodesForCurative.uct" Given crac file is "epic91/CBCORA_ep91us11case3.xml" - Given configuration file is "common/RaoParameters_posMargin_megawatt_ac.json" + Given configuration file is "common/RaoParameters_posMargin_ac.json" When I launch search_tree_rao at "2019-01-08 00:30" Then its security status should be "UNSECURED" And 0 remedial actions are used in preventive diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic91_rao_enhancements/US91_3.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic91_rao_enhancements/US91_3.feature index d8792e6f99..23cb8699e9 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic91_rao_enhancements/US91_3.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic91_rao_enhancements/US91_3.feature @@ -9,7 +9,7 @@ Feature: US 91.3: pst initially out of range Scenario: US 91.3.1: initial PST tap outside of Range Given network file is "common/TestCase16Nodes.uct" for CORE CC Given crac file is "epic91/cbcora_ep91us3case1.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the worst margin is 496.0 MW # margin on Cnec is improved @@ -25,7 +25,7 @@ Feature: US 91.3: pst initially out of range Scenario: US 91.3.2: PST tap outside of Range at the start of the curative RAO Given network file is "common/TestCase16Nodes.uct" for CORE CC Given crac file is "epic91/cbcora_ep91us3case2.xml" - Given configuration file is "common/RaoParameters_maxMargin_megawatt_dc.json" + Given configuration file is "common/RaoParameters_maxMargin_megawatt.json" When I launch search_tree_rao at "2019-01-08 12:00" Then the tap of PstRangeAction "pst_fr" should be 10 in preventive And the tap of PstRangeAction "pst_fr" should be 10 after "CO1" at "curative" diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_default.json b/tests/src/test/resources/files/configurations/common/RaoParameters_default.json index 0d827d466f..76f99e393b 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_default.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_default.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere.json index 4ef1f8ac0d..ffb175f5e2 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_mip.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_mip.json index 879fcfec02..3b796f3ccb 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_mip.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_mip.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_withFallback.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_withFallback.json index 534121df80..92e1cb1833 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_withFallback.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_withFallback.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt.json similarity index 93% rename from tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc.json rename to tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt.json index 4326759575..8e2fe8e472 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_ac.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_maximizing_curative.json similarity index 92% rename from tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_ac.json rename to tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_maximizing_curative.json index 37685ea8c8..8e2fe8e472 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_ac.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_maximizing_curative.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_withLoopFlows.json similarity index 93% rename from tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json rename to tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_withLoopFlows.json index 08b3c44ef8..b396f08bd0 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_withLoopFlows.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_ac.json b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ac.json similarity index 92% rename from tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_ac.json rename to tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ac.json index 8862c19c94..f9e62af64d 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_ac.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ac.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere.json b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere.json index f2ab5e5779..feb6634529 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere_withFallback.json b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere_withFallback.json index ef8915fc36..009b7f678e 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere_withFallback.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere_withFallback.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_dc.json b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_dc.json index ff02f10c48..c21cf2887c 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_dc.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_dc.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json b/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json index 0e0c31145a..2dc3dc9128 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_simple_AC_loopflow.json b/tests/src/test/resources/files/configurations/common/RaoParameters_simple_AC_loopflow.json index 16e6bce634..dc292bdf7b 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_simple_AC_loopflow.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_simple_AC_loopflow.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/epic10/RaoParameters_relMargin_megawatt.json b/tests/src/test/resources/files/configurations/epic10/RaoParameters_relMargin_megawatt.json index 3242a53b6d..21045faa91 100644 --- a/tests/src/test/resources/files/configurations/epic10/RaoParameters_relMargin_megawatt.json +++ b/tests/src/test/resources/files/configurations/epic10/RaoParameters_relMargin_megawatt.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json index a512b9cf46..177cc70cfc 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json index d8be8733fa..77a602b434 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json b/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json index 90bc835c6d..2fb9354c2e 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json b/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json index ef2787412e..f98fd4158d 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin180.json b/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_mnecDimin180.json similarity index 92% rename from tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin180.json rename to tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_mnecDimin180.json index 486966f059..642142f0ae 100644 --- a/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin180.json +++ b/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_mnecDimin180.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json b/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json similarity index 92% rename from tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json rename to tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json index 8e1b494586..4732704391 100644 --- a/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json +++ b/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_mnecDimin20.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/epic11/RaoParameters_posMargin_ampere_mnecDiminMinusInf.json b/tests/src/test/resources/files/configurations/epic11/RaoParameters_posMargin_ampere_mnecDiminMinusInf.json index 1269f870fc..5f543ce678 100644 --- a/tests/src/test/resources/files/configurations/epic11/RaoParameters_posMargin_ampere_mnecDiminMinusInf.json +++ b/tests/src/test/resources/files/configurations/epic11/RaoParameters_posMargin_ampere_mnecDiminMinusInf.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json index ec8dce0ebe..6ca6c09683 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json index 4e546dba57..7d5a7240e5 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json index 01f51be61e..b0b9f461a4 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_11.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_11.json index 1ff456111e..bf3111be3e 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_11.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_11.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_2.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_2.json index 50e5509180..bc4ca01754 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_2.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_2.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_300_secure.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_300_secure.json index 7da8f6095f..5391b0ff5d 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_300_secure.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_300_secure.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 300.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE_AND_SECURE" + "enforce-curative-security" : true }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_500.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_500.json index 38a06a10af..5cb15d2590 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_500.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_500.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 500.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_628.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_628.json index d51f315c8b..982b4e5f04 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_628.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_628.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 628.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json index c4d387eeb2..44bcbf3e8f 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json index 430d54b6e5..266e8e83df 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_2p_global.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_2p_global.json index 11f4333014..23a8ea1e5d 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_2p_global.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_2p_global.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold.json index 987d5ca460..156f2032d0 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold_12.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold_12.json index fc64c5ef7e..9644601747 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold_12.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold_12.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_relMargin_ampere.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_relMargin_ampere.json index 20854f0d18..9d3252c33c 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_relMargin_ampere.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_relMargin_ampere.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_stop_curative_at_preventive.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_stop_curative_at_preventive.json index 3067b8b81b..19f36207e6 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_stop_curative_at_preventive.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_stop_curative_at_preventive.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-2.json index 8edd24f9f2..f46b339130 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-2.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-4.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-4.json index 54ed17663c..9ff52fcdba 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-4.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-4.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 200.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-1.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-1.json index 2db7bf0fd0..52f54fcd7e 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-1.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-1.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-2.json index 01a8c2509d..8f62518c83 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-2.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-3-3.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-3-3.json index c4390a01b8..0e3a11abbf 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-3-3.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-3-3.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json index 66b7ddad40..ae719fc120 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json index 04bead7208..7a3032566c 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json index e1f895743d..c7507f0ca1 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json index 0dce4c0231..120559dd26 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json index f993039fc8..b0e6599bd0 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json index 0398cac308..93d1174701 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json index c392fe3a48..0a7e4602ff 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json index 8e4f1f7210..d9a53b9b22 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json index 8e4f1f7210..d9a53b9b22 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json index 42a8e757a2..8d1e574365 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json index 99f5c3e282..ae7a8fd8a3 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json index 99f5c3e282..ae7a8fd8a3 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json b/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json index de68e6abda..1487fa4f63 100644 --- a/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json +++ b/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_10_10&11.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_10_10&11.json index 260d029d5a..842d7862ad 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_10_10&11.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_10_10&11.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9.json index 4e41145898..4f5352f062 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9_bis.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9_bis.json index f2b0bb85f6..9654a63fc1 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9_bis.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9_bis.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_dc_discrete.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_dc_discrete.json index 7a908516e1..81a5813da9 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_dc_discrete.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_dc_discrete.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_ampere_shareCra.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_ampere_shareCra.json index 4001319285..4616823700 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_ampere_shareCra.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_ampere_shareCra.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_megawatt_shareCra.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_megawatt_shareCra.json index c610eee629..4616823700 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_megawatt_shareCra.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_megawatt_shareCra.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra.json index 6e3b95195c..e7da23d9f7 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra_mip.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra_mip.json index de4db63827..fc6f8c5d07 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra_mip.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra_mip.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra.json index 32c32048e6..e7da23d9f7 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra_mip.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra_mip.json index 1ba1cb3af6..fc6f8c5d07 100644 --- a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra_mip.json +++ b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra_mip.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_RELATIVE_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_4.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_4.json index 1ef1c6dc10..6fc16286b4 100644 --- a/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_4.json +++ b/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_4.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_1.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_1.json index ac03d7605e..bbe7d59da3 100644 --- a/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_1.json +++ b/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_1.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_2.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_2.json index 7e46ad1d1e..ed899dba93 100644 --- a/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_2.json +++ b/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_2.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_MW_DC_withLF_with2P.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_MW_DC_withLF_with2P.json index 8999b7d8d6..898f45efb0 100644 --- a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_MW_DC_withLF_with2P.json +++ b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_MW_DC_withLF_with2P.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 50.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE_AND_SECURE" + "enforce-curative-security" : true }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_2p_if_cost_increase.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_2p_if_cost_increase.json index a73aa8d6e4..fa1cb8b06b 100644 --- a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_2p_if_cost_increase.json +++ b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_2p_if_cost_increase.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : true, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_forbid_cost_increase.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_forbid_cost_increase.json index 032432cf8b..ffb175f5e2 100644 --- a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_forbid_cost_increase.json +++ b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_forbid_cost_increase.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : true, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_second_preventive.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_second_preventive.json index 3cd9c60903..adb6c85047 100644 --- a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_second_preventive.json +++ b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_second_preventive.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_ac_divergence.json b/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_ac_divergence.json index 283b03224d..d0f602c292 100644 --- a/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_ac_divergence.json +++ b/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_ac_divergence.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_ac_divergence.json b/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_ac_divergence.json index e87b7bf33b..22f18fd109 100644 --- a/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_ac_divergence.json +++ b/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_ac_divergence.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_differentFallbackCost.json b/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_differentFallbackCost.json index 6ba9b05270..90e9f5a254 100644 --- a/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_differentFallbackCost.json +++ b/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_differentFallbackCost.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact190.json b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact190.json index 17a5c93b0e..d6e3a16461 100644 --- a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact190.json +++ b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact190.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact195.json b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact195.json index becec5e470..26dc8524a1 100644 --- a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact195.json +++ b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact195.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_maxDepth.json b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_maxDepth.json index 262dc8f7eb..d1d8cd4305 100644 --- a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_maxDepth.json +++ b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_maxDepth.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_relativeMinImpact.json b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_relativeMinImpact.json index c94fef6621..279aeab9f3 100644 --- a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_relativeMinImpact.json +++ b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_relativeMinImpact.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_10_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_ac_lf_false_10_100.json similarity index 93% rename from tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_10_100.json rename to tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_ac_lf_false_10_100.json index 5bd596317b..1c5b6c5cfe 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_10_100.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_ac_lf_false_10_100.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_ac_lf_false_5_100.json similarity index 93% rename from tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json rename to tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_ac_lf_false_5_100.json index 8fc3f35091..248ed8382f 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_ac_lf_false_5_100.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_BE_NL.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_BE_NL.json index 21d458595f..11c4ecb4ac 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_BE_NL.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_BE_NL.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_NL.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_NL.json index 42caab0306..8cd71c0819 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_NL.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_NL.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_lfAugmentation.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_lfAugmentation.json index 53e69e8ee3..d68be3f266 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_lfAugmentation.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_lfAugmentation.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_accurate_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_accurate_5_100.json index 60296c86a0..b21f9feac9 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_accurate_5_100.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_accurate_5_100.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_10_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_10_100.json index e62847933c..64265fe00e 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_10_100.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_10_100.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json index 03d17ce8d8..673cf8642d 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_inBetween_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_inBetween_5_100.json index 4df81c89cc..e20b39d99f 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_inBetween_5_100.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_inBetween_5_100.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_true_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_true_5_100.json similarity index 92% rename from tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_true_5_100.json rename to tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_true_5_100.json index db5e556dbe..266e8e83df 100644 --- a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_true_5_100.json +++ b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_true_5_100.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, @@ -61,7 +60,7 @@ "shuntCompensatorVoltageControlOn" : false, "readSlackBus" : true, "writeSlackBus" : true, - "dc" : false, + "dc" : true, "distributedSlack" : true, "balanceType" : "PROPORTIONAL_TO_GENERATION_P", "dcUseTransformerRatio" : true, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_search_tree.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_search_tree.json index 14ef1203f0..6ccd287575 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_search_tree.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_search_tree.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure.json index 7bee959627..ea0dfef076 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure_2PRAO.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure_2PRAO.json index 79db028d20..f71dc44850 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure_2PRAO.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure_2PRAO.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_13_1.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_13_1.json index dfb9779140..b661778612 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_13_1.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_13_1.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_1.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_1.json index 045ad17a0f..1be65e04c8 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_1.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_1.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_12.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_12.json index 26a3848b8d..d5b0e1379d 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_12.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_12.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_3.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_3.json index 7ab3061eb3..27c8a4377f 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_3.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_3.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_6.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_6.json index b7d50fec01..3aa7696e6f 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_6.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_6.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_7.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_7.json index 297c34dfaf..486588f0b1 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_7.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_7.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree.json index f033eb9fc7..b96059eae6 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree_2_threads.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree_2_threads.json index 74ea7200b4..460e4cd4cb 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree_2_threads.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree_2_threads.json @@ -1,11 +1,9 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, + "type" : "MAX_MIN_MARGIN", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100.json index abc7c4c7ad..cb0e8b69a2 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100_mip.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100_mip.json index 94eaba803c..60924055a0 100644 --- a/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100_mip.json +++ b/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100_mip.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/rao1/RaoParameters_maxMargin_ampere_highPSTcost.json b/tests/src/test/resources/files/configurations/rao1/RaoParameters_maxMargin_ampere_highPSTcost.json index 7d080c876d..2e5c36bb90 100644 --- a/tests/src/test/resources/files/configurations/rao1/RaoParameters_maxMargin_ampere_highPSTcost.json +++ b/tests/src/test/resources/files/configurations/rao1/RaoParameters_maxMargin_ampere_highPSTcost.json @@ -1,11 +1,10 @@ { - "version" : "2.4", + "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "forbid-cost-increase" : false, - "curative-min-obj-improvement" : 0.0, + "type" : "MAX_MIN_MARGIN", + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/crac/epic13/12nodes_oneCorrectPreventivePst.xml b/tests/src/test/resources/files/crac/epic13/12nodes_oneCorrectPreventivePst.xml index fc1fc525e9..3dea152e69 100644 --- a/tests/src/test/resources/files/crac/epic13/12nodes_oneCorrectPreventivePst.xml +++ b/tests/src/test/resources/files/crac/epic13/12nodes_oneCorrectPreventivePst.xml @@ -31,7 +31,7 @@ 0.95 SEASONAL - 0.5 + 0.55 0.5 0 70 diff --git a/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_absoluteLimit.xml b/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_absoluteLimit.xml index 0a26025e09..9f359d30d3 100644 --- a/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_absoluteLimit.xml +++ b/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_absoluteLimit.xml @@ -31,7 +31,7 @@ 0.95 SEASONAL - 0.5 + 0.6 0.5 0 70 diff --git a/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_absoluteLimitError.xml b/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_absoluteLimitError.xml index 3a3a9deb7a..8edf087f2a 100644 --- a/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_absoluteLimitError.xml +++ b/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_absoluteLimitError.xml @@ -31,7 +31,7 @@ 0.95 SEASONAL - 0.5 + 0.55 0.5 0 70 diff --git a/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_relativeLimit.xml b/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_relativeLimit.xml index d8e417e641..a2a2f2499b 100644 --- a/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_relativeLimit.xml +++ b/tests/src/test/resources/files/crac/epic13/12nodes_onePreventiveAndCurativePst_relativeLimit.xml @@ -31,7 +31,7 @@ 0.95 SEASONAL - 0.5 + 0.6 0.5 0 70