From d588d486f8de271a22b40cb72c888dbf43080e3c Mon Sep 17 00:00:00 2001 From: Pauline Jean-Marie Date: Fri, 15 Nov 2024 13:41:03 +0100 Subject: [PATCH] Move unit out of objective function type Signed-off-by: Pauline Jean-Marie --- .../com/powsybl/openrao/commons/Unit.java | 9 +++++ .../io/cne/core/CoreCneCnecsCreatorTest.java | 6 ++- .../max-min-relative-margin-filler.md | 2 +- docs/output-data/core-cne/java-api.md | 6 +-- docs/parameters.md | 38 ++++++++++--------- docs/tutorial.md | 6 ++- python-util/rao_parameter_modification.py | 34 ++++++++--------- .../openrao/raoapi/RaoParametersCommons.java | 1 + .../json/JsonObjectiveFunctionParameters.java | 18 +++++++++ .../ObjectiveFunctionParameters.java | 32 ++++++++-------- .../raoapi/json/JsonRaoParametersTest.java | 4 +- .../parameters/RaoParametersConfigTest.java | 13 +++++-- .../RaoParametersConsistencyTest.java | 6 +-- .../RaoParametersYamlConfigTest.java | 10 +++-- .../test/resources/RaoParametersSet_v2.json | 3 +- .../RaoParametersWithExtension_v2.json | 3 +- .../RaoParametersWithLoopFlowError_v2.json | 3 +- ...rametersWithPrevStopCriterionError_v2.json | 3 +- .../RaoParametersWithWrongField_v2.json | 3 +- .../RaoParameters_config_withExtensions.json | 3 +- .../RaoParameters_config_withOLFParams.json | 3 +- ...rameters_config_withPartialExtensions.json | 3 +- ...aoParameters_config_withoutExtensions.json | 3 +- .../resources/RaoParameters_default_v2.json | 3 +- .../resources/RaoParameters_update_v2.json | 3 +- .../src/test/resources/RaoParameters_v2.json | 3 +- .../test/resources/config_withExtensions.yml | 3 +- .../resources/config_withoutExtensions.yml | 3 +- .../castor/algorithm/AutomatonSimulator.java | 12 +++--- .../algorithm/CastorFullOptimization.java | 6 +-- .../algorithm/CastorSecondPreventive.java | 2 +- .../searchtreerao/commons/RaoLogger.java | 29 +++++++------- .../searchtreerao/commons/RaoUtil.java | 6 +-- .../ObjectiveFunction.java | 8 ++-- .../linearproblem/LinearProblemBuilder.java | 2 +- .../IteratingLinearOptimizerParameters.java | 12 +++++- .../searchtree/algorithms/Leaf.java | 1 + .../searchtree/algorithms/SearchTree.java | 12 +++--- .../parameters/SearchTreeParameters.java | 20 +++++++++- .../algorithm/AutomatonSimulatorTest.java | 3 +- .../algorithm/CastorFullOptimizationTest.java | 6 ++- .../PrePerimeterSensitivityAnalysisTest.java | 18 ++++++--- .../searchtreerao/commons/RaoLoggerTest.java | 34 ++++++++--------- .../searchtreerao/commons/RaoUtilTest.java | 20 +++++----- .../IteratingLinearOptimizerTest.java | 4 +- .../algorithms/LinearProblemBuilderTest.java | 18 ++++++--- .../MaxMinRelativeMarginFillerTest.java | 3 +- .../searchtree/algorithms/SearchTreeTest.java | 3 +- .../parameters/SearchTreeParametersTest.java | 3 ++ .../parameters/RaoParameters_2P_v2.json | 3 +- .../parameters/RaoParameters_DC.json | 3 +- .../RaoParameters_oneIteration_v2.json | 3 +- .../parameters/RaoParameters_secure.json | 3 +- .../openrao/tests/utils/CneHelper.java | 4 +- .../common/RaoParameters_default.json | 3 +- .../RaoParameters_maxMargin_ampere.json | 3 +- .../RaoParameters_maxMargin_ampere_mip.json | 3 +- ...ameters_maxMargin_ampere_withFallback.json | 3 +- .../RaoParameters_maxMargin_megawatt_ac.json | 3 +- .../RaoParameters_maxMargin_megawatt_dc.json | 3 +- ...s_maxMargin_megawatt_dc_withLoopFlows.json | 3 +- .../RaoParameters_posMargin_ampere.json | 3 +- ...ameters_posMargin_ampere_withFallback.json | 3 +- .../RaoParameters_posMargin_megawatt_ac.json | 3 +- .../RaoParameters_posMargin_megawatt_dc.json | 3 +- .../RaoParameters_securityAnalysis.json | 3 +- .../RaoParameters_simple_AC_loopflow.json | 3 +- .../RaoParameters_relMargin_megawatt.json | 3 +- .../epic10/conf_ep10us2case1.json | 3 +- .../epic10/conf_ep10us2case2.json | 3 +- .../epic10/conf_ep10us3case1.json | 3 +- .../epic10/conf_ep10us4case1.json | 3 +- ...rs_maxMargin_megawatt_ac_mnecDimin180.json | 3 +- ...ers_maxMargin_megawatt_ac_mnecDimin20.json | 3 +- ...rs_posMargin_ampere_mnecDiminMinusInf.json | 3 +- .../raoParametersSweIDCC_minObjective.json | 3 +- ...ametersSweIDCC_minObjectiveDisabled2P.json | 3 +- ...etersSweIDCC_minObjectiveWithGlobal2P.json | 3 +- .../epic13/RaoParameters_13_6_11.json | 3 +- .../epic13/RaoParameters_13_6_2.json | 3 +- ...ameters_best_preventive_by_300_secure.json | 3 +- .../RaoParameters_best_preventive_by_500.json | 3 +- .../RaoParameters_best_preventive_by_628.json | 3 +- .../epic13/RaoParameters_ep13us6case8.json | 3 +- .../epic13/RaoParameters_ep13us7case6.json | 3 +- ...Parameters_maxMargin_ampere_2p_global.json | 3 +- ...s_maxMargin_ampere_absolute_threshold.json | 3 +- ...axMargin_ampere_absolute_threshold_12.json | 3 +- .../RaoParameters_relMargin_ampere.json | 3 +- ...arameters_stop_curative_at_preventive.json | 3 +- .../epic15/RaoParameters_ep15us11-2.json | 3 +- .../epic15/RaoParameters_ep15us11-4.json | 3 +- .../epic15/RaoParameters_ep15us11-5-1.json | 3 +- .../epic15/RaoParameters_ep15us11-5-2.json | 3 +- .../epic15/RaoParameters_ep15us11-5-3-3.json | 3 +- .../epic15/RaoParameters_ep15us13case1.json | 3 +- .../epic15/RaoParameters_ep15us13case10.json | 3 +- .../epic15/RaoParameters_ep15us13case2.json | 3 +- .../epic15/RaoParameters_ep15us13case5.json | 3 +- .../epic15/RaoParameters_ep15us13case6.json | 3 +- .../epic15/RaoParameters_ep15us13case7.json | 3 +- .../epic15/RaoParameters_ep15us13case8.json | 3 +- .../epic15/RaoParameters_ep15us17case10.json | 3 +- .../epic15/RaoParameters_ep15us17case11.json | 3 +- .../epic15/RaoParameters_ep15us17case12.json | 3 +- .../epic15/RaoParameters_ep15us17case2.json | 3 +- .../epic15/RaoParameters_ep15us17case6.json | 3 +- .../raoParametersSweIDCC_withoutPsts.json | 3 +- .../epic19/RaoParameters_19_10_10&11.json | 3 +- .../epic19/RaoParameters_19_11_9.json | 3 +- .../epic19/RaoParameters_19_11_9_bis.json | 3 +- .../epic19/RaoParameters_dc_discrete.json | 3 +- ...oParameters_maxMargin_ampere_shareCra.json | 3 +- ...arameters_maxMargin_megawatt_shareCra.json | 3 +- ...rameters_maxRelMargin_ampere_shareCra.json | 3 +- ...ters_maxRelMargin_ampere_shareCra_mip.json | 3 +- ...meters_maxRelMargin_megawatt_shareCra.json | 3 +- ...rs_maxRelMargin_megawatt_shareCra_mip.json | 3 +- .../epic20/RaoParameters_20_4.json | 3 +- .../epic20/RaoParameters_20_6_1.json | 3 +- .../epic20/RaoParameters_20_6_2.json | 3 +- ...ameters_maxMargin_MW_DC_withLF_with2P.json | 3 +- ..._maxMargin_ampere_2p_if_cost_increase.json | 3 +- ...maxMargin_ampere_forbid_cost_increase.json | 3 +- ...rs_maxMargin_ampere_second_preventive.json | 3 +- ...meters_posMargin_ampere_ac_divergence.json | 3 +- ...gin_ampere_withFallback_ac_divergence.json | 3 +- ...re_withFallback_differentFallbackCost.json | 3 +- ...meters_maxMargin_absoluteMinImpact190.json | 3 +- ...meters_maxMargin_absoluteMinImpact195.json | 3 +- .../RaoParameters_maxMargin_maxDepth.json | 3 +- ...arameters_maxMargin_relativeMinImpact.json | 3 +- ...eters_maxMargin_mw_ac_lf_false_10_100.json | 3 +- ...meters_maxMargin_mw_ac_lf_false_5_100.json | 3 +- ..._maxMargin_mw_ac_lf_false_5_100_BE_NL.json | 3 +- ...ers_maxMargin_mw_ac_lf_false_5_100_NL.json | 3 +- ...n_mw_ac_lf_false_5_100_lfAugmentation.json | 3 +- ...ameters_maxMargin_mw_ac_lf_true_5_100.json | 3 +- ...ers_maxMargin_mw_dc_lf_accurate_5_100.json | 3 +- ...eters_maxMargin_mw_dc_lf_false_10_100.json | 3 +- ...meters_maxMargin_mw_dc_lf_false_5_100.json | 3 +- ...rs_maxMargin_mw_dc_lf_inBetween_5_100.json | 3 +- .../RaoParameters_case_91_12_search_tree.json | 3 +- .../RaoParameters_case_91_12_secure.json | 3 +- ...RaoParameters_case_91_12_secure_2PRAO.json | 3 +- .../epic91/RaoParameters_case_91_13_1.json | 3 +- .../epic91/RaoParameters_case_91_1_1.json | 3 +- .../epic91/RaoParameters_case_91_1_12.json | 3 +- .../epic91/RaoParameters_case_91_1_3.json | 3 +- .../epic91/RaoParameters_case_91_1_6.json | 3 +- .../epic91/RaoParameters_case_91_1_7.json | 3 +- .../RaoParameters_interrupt_search_tree.json | 3 +- ...eters_interrupt_search_tree_2_threads.json | 3 +- ...meters_maxMargin_mw_ac_lf_false_3_100.json | 3 +- ...rs_maxMargin_mw_ac_lf_false_3_100_mip.json | 3 +- ...rameters_maxMargin_ampere_highPSTcost.json | 3 +- 156 files changed, 492 insertions(+), 279 deletions(-) diff --git a/commons/src/main/java/com/powsybl/openrao/commons/Unit.java b/commons/src/main/java/com/powsybl/openrao/commons/Unit.java index a496c47b01..499cb612b3 100644 --- a/commons/src/main/java/com/powsybl/openrao/commons/Unit.java +++ b/commons/src/main/java/com/powsybl/openrao/commons/Unit.java @@ -42,6 +42,15 @@ public String toString() { return symbol; } + public static Unit getEnum(String value) { + for (Unit v : values()) { + if (v.toString().equals(value)) { + return v; + } + } + throw new IllegalArgumentException(); + } + public void checkPhysicalParameter(PhysicalParameter requestedPhysicalParameter) { if (!requestedPhysicalParameter.equals(physicalParameter)) { throw new OpenRaoException(String.format("%s Unit is not suited to measure a %s value.", this.toString(), requestedPhysicalParameter)); diff --git a/data/rao-result/rao-result-io/rao-result-cne/core-cne-exporter/src/test/java/com/powsybl/openrao/data/raoresult/io/cne/core/CoreCneCnecsCreatorTest.java b/data/rao-result/rao-result-io/rao-result-cne/core-cne-exporter/src/test/java/com/powsybl/openrao/data/raoresult/io/cne/core/CoreCneCnecsCreatorTest.java index d816591721..9250693c15 100644 --- a/data/rao-result/rao-result-io/rao-result-cne/core-cne-exporter/src/test/java/com/powsybl/openrao/data/raoresult/io/cne/core/CoreCneCnecsCreatorTest.java +++ b/data/rao-result/rao-result-io/rao-result-cne/core-cne-exporter/src/test/java/com/powsybl/openrao/data/raoresult/io/cne/core/CoreCneCnecsCreatorTest.java @@ -234,7 +234,8 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.MEGAWATT); CneHelper cneHelper = new CneHelper(crac, raoResult, properties, CORE_CNE_EXPORT_PROPERTIES_PREFIX); CoreCneCnecsCreator cneCnecsCreator = new CoreCneCnecsCreator(cneHelper, new MockCracCreationContext(crac)); @@ -272,7 +273,8 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.MEGAWATT); CneHelper cneHelper = new CneHelper(crac, raoResult, properties, CORE_CNE_EXPORT_PROPERTIES_PREFIX); CoreCneCnecsCreator cneCnecsCreator = new CoreCneCnecsCreator(cneHelper, new MockCracCreationContext(crac)); 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..bf02cfb2fc 100644 --- a/docs/castor/linear-problem/max-min-relative-margin-filler.md +++ b/docs/castor/linear-problem/max-min-relative-margin-filler.md @@ -21,7 +21,7 @@ And $PTDF_{zTos}(z1, c)$, the zone-to-slack PTDF of bidding zone $z1$ on CNEC $c | 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 | +| [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/core-cne/java-api.md b/docs/output-data/core-cne/java-api.md index a0482c931c..3f7a045cf8 100644 --- a/docs/output-data/core-cne/java-api.md +++ b/docs/output-data/core-cne/java-api.md @@ -58,10 +58,8 @@ properties.setProperty("rao-result.export.core-cne.receiver-id", "RECEIVER_ID"); properties.setProperty("rao-result.export.core-cne.receiver-role", "A36"); // CAPACITY_COORDINATOR properties.setProperty("rao-result.export.core-cne.time-interval", "2021-10-30T22:00Z/2021-10-31T23:00Z"); switch (raoParameters.getObjectiveFunctionParameters().getType()) { - case MAX_MIN_RELATIVE_MARGIN_IN_AMPERE -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "true"); - case MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "true"); - case MAX_MIN_MARGIN_IN_AMPERE -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "false"); - case MAX_MIN_MARGIN_IN_MEGAWATT -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "false"); + case MAX_MIN_RELATIVE_MARGIN -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "true"); + case MAX_MIN_MARGIN -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "false"); } if (raoParameters.hasExtension(LoopFlowParametersExtension.class)) { properties.setProperty("rao-result.export.core-cne.with-loop-flows", "true"); diff --git a/docs/parameters.md b/docs/parameters.md index b9cd8e0051..0d6b9f3125 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -21,24 +21,26 @@ 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. + +#### unit +- **Expected value**: one of the following: + - "MEGAWATT" + - "AMPERE" +- **Default value**: "MEGAWATT" +- **Usage**: this parameter sets the objective function unit of the RAO. For now, the existing objective function units are: + - **MEGAWATT**: the margins to maximize are considered in MW. + - **AMPERE**: the margins to maximize are considered in A. + Note that CNECs from different voltage levels will not have the same weight in the objective function depending on the unit + considered (MW or A). Ampere unit only works in AC-load-flow mode (see [sensitivity-parameters](#sensitivity-parameters)). #### preventive-stop-criterion - **Expected value**: one of the following: @@ -551,7 +553,8 @@ Zones are seperated by + or -. { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE", "enforce-curative-security" : true @@ -669,7 +672,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 + unit: AMPERE preventive-stop-criterion: SECURE rao-range-actions-optimization: diff --git a/docs/tutorial.md b/docs/tutorial.md index a99cbcf9fb..7b60422f20 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -295,7 +295,8 @@ raoParameters.setLoadFlowAndSensitivityParameters(loadFlowAndSensitivityParamete // Ask the RAO to maximize minimum margin in MW, 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.setUnit(Unit.MEGAWATT); objectiveFunctionParameters.setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); objectiveFunctionParameters.setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.SECURE); raoParameters.setObjectiveFunctionParameters(objectiveFunctionParameters); @@ -577,7 +578,8 @@ public class Main { // Ask the RAO to maximize minimum margin in MW, 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.setUnit(Unit.MEGAWATT); 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 index a7f709ab6d..ed23b9f9a9 100644 --- a/python-util/rao_parameter_modification.py +++ b/python-util/rao_parameter_modification.py @@ -15,6 +15,7 @@ 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")): @@ -25,7 +26,7 @@ def rao_parameters_file(file_path): correct_version = True if tag_by_file_type[ftype] in line: score += 1 - if "MAX_MIN_MARGIN_IN" in line or "MAX_MIN_RELATIVE_MARGIN_IN" in line: + if "MAX_MIN_MARGIN" in line or "MAX_MIN_RELATIVE_MARGIN" in line: score += 1 if correct_version and score >= 2: return True @@ -82,24 +83,21 @@ def obj_function_as_str_lines(new_data, file_type): def new_rao_param(data: dict, file_path: str, file_type: str) -> dict: try: - old_obj_fun = data[tag_by_file_type[file_type]] + obj_fun = data[tag_by_file_type[file_type]] + # new_obj_fun to have type and unit on top of obj fun new_obj_fun = {} - for key in old_obj_fun: - if key not in ("curative-stop-criterion", "optimize-curative-if-preventive-unsecure"): - new_obj_fun[key] = old_obj_fun[key] - prev_secure = "preventive-stop-criterion" not in old_obj_fun or old_obj_fun["preventive-stop-criterion"] == "SECURE" - if prev_secure: - if "optimize-curative-if-preventive-unsecure" in old_obj_fun: - new_obj_fun["enforce-curative-security"] = old_obj_fun["optimize-curative-if-preventive-unsecure"] - else: - cur_secure = "curative-stop-criterion" in old_obj_fun and old_obj_fun["curative-stop-criterion"] in ("SECURE", "PREVENTIVE_OBJECTIVE_AND_SECURE") - if cur_secure: - new_obj_fun["enforce-curative-security"] = True - else: - new_obj_fun["enforce-curative-security"] = False - cur_min = "curative-stop-criterion" in old_obj_fun and old_obj_fun["curative-stop-criterion"] == "MIN_OBJECTIVE" - if cur_min: - new_obj_fun["curative-min-obj-improvement"] = 10000.0 + (old_obj_fun["curative-min-obj-improvement"] if "curative-min-obj-improvement" in old_obj_fun else 0.0) + if "type" in obj_fun: + if "MAX_MIN_MARGIN" in obj_fun["type"]: + new_obj_fun["type"] = "MAX_MIN_MARGIN" + elif "MAX_MIN_RELATIVE_MARGIN" in obj_fun["type"]: + new_obj_fun["type"] = "MAX_MIN_RELATIVE_MARGIN" + if "MEGAWATT" in obj_fun["type"]: + new_obj_fun["unit"] = "MW" + elif "AMPERE" in obj_fun["type"]: + new_obj_fun["unit"] = "A" + for key in obj_fun: + if key not in new_obj_fun: + new_obj_fun[key] = obj_fun[key] except KeyError as ke: raise KeyError("in file " + file_path) from ke data[tag_by_file_type[file_type]] = new_obj_fun 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 fa0bcae7af..76b2496971 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 @@ -25,6 +25,7 @@ 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 UNIT = "unit"; 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 ENFORCE_CURATIVE_SECURITY = "enforce-curative-security"; 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 34f8a0809d..e1ef89f212 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 @@ -7,6 +7,7 @@ package com.powsybl.openrao.raoapi.json; 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.RaoParameters; import com.fasterxml.jackson.core.JsonGenerator; @@ -27,6 +28,7 @@ private JsonObjectiveFunctionParameters() { static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeObjectFieldStart(OBJECTIVE_FUNCTION); jsonGenerator.writeObjectField(TYPE, parameters.getObjectiveFunctionParameters().getType()); + jsonGenerator.writeObjectField(UNIT, parameters.getObjectiveFunctionParameters().getUnit()); jsonGenerator.writeObjectField(PREVENTIVE_STOP_CRITERION, parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()); jsonGenerator.writeNumberField(CURATIVE_MIN_OBJ_IMPROVEMENT, parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement()); jsonGenerator.writeBooleanField(ENFORCE_CURATIVE_SECURITY, parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()); @@ -39,6 +41,9 @@ static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) thro case TYPE: raoParameters.getObjectiveFunctionParameters().setType(stringToObjectiveFunction(jsonParser.nextTextValue())); break; + case UNIT: + raoParameters.getObjectiveFunctionParameters().setUnit(stringToObjectiveFunctionUnit(jsonParser.nextTextValue())); + break; case PREVENTIVE_STOP_CRITERION: raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(stringToPreventiveStopCriterion(jsonParser.nextTextValue())); break; @@ -64,6 +69,19 @@ private static ObjectiveFunctionParameters.ObjectiveFunctionType stringToObjecti } } + private static Unit stringToObjectiveFunctionUnit(String string) { + Unit unit; + try { + unit = Unit.getEnum(string); + } catch (IllegalArgumentException e) { + throw new OpenRaoException(String.format("Unknown objective function unit value: %s", string)); + } + if (unit != Unit.MEGAWATT && unit != Unit.AMPERE) { + throw new OpenRaoException(String.format("Unknown objective function unit value: %s", string)); + } + return unit; + } + private static ObjectiveFunctionParameters.PreventiveStopCriterion stringToPreventiveStopCriterion(String string) { try { return ObjectiveFunctionParameters.PreventiveStopCriterion.valueOf(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 133d4217d6..634d2cb740 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 @@ -21,7 +21,8 @@ */ public class ObjectiveFunctionParameters { // Default values - private static final ObjectiveFunctionType DEFAULT_OBJECTIVE_FUNCTION = ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT; + private static final ObjectiveFunctionType DEFAULT_OBJECTIVE_FUNCTION = ObjectiveFunctionType.MAX_MIN_MARGIN; + private static final Unit DEFAULT_UNIT = Unit.MEGAWATT; private static final double DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT = 0; private static final PreventiveStopCriterion DEFAULT_PREVENTIVE_STOP_CRITERION = PreventiveStopCriterion.SECURE; private static final boolean DEFAULT_ENFORCE_CURATIVE_SECURITY = false; @@ -30,26 +31,14 @@ public class ObjectiveFunctionParameters { private double curativeMinObjImprovement = DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT; private PreventiveStopCriterion preventiveStopCriterion = DEFAULT_PREVENTIVE_STOP_CRITERION; private boolean enforceCurativeSecurity = DEFAULT_ENFORCE_CURATIVE_SECURITY; + private Unit unit = DEFAULT_UNIT; // 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); } } @@ -67,6 +56,14 @@ public void setType(ObjectiveFunctionType type) { this.type = type; } + public Unit getUnit() { + return unit; + } + + public void setUnit(Unit unit) { + this.unit = unit; + } + public void setPreventiveStopCriterion(PreventiveStopCriterion preventiveStopCriterion) { this.preventiveStopCriterion = preventiveStopCriterion; } @@ -94,6 +91,7 @@ public static ObjectiveFunctionParameters load(PlatformConfig platformConfig) { .ifPresent(config -> { parameters.setType(config.getEnumProperty(TYPE, ObjectiveFunctionType.class, DEFAULT_OBJECTIVE_FUNCTION)); + parameters.setUnit(config.getEnumProperty(UNIT, Unit.class, DEFAULT_UNIT)); 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)); 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 1894204992..f008721fce 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 @@ -7,6 +7,7 @@ package com.powsybl.openrao.raoapi.json; 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.RaoParameters; @@ -52,7 +53,8 @@ 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().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + parameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); parameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(983); parameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); 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 6383571cc9..c2f0ed49d6 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 @@ -7,6 +7,7 @@ package com.powsybl.openrao.raoapi.parameters; import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.raoapi.parameters.extensions.*; import com.google.common.jimfs.Configuration; import com.google.common.jimfs.Jimfs; @@ -41,7 +42,8 @@ public void setUp() { @Test void checkObjectiveFunctionConfig() { 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("unit", "AMPERE"); objectiveFunctionModuleConfig.setStringProperty("curative-min-obj-improvement", Objects.toString(123.0)); objectiveFunctionModuleConfig.setStringProperty("preventive-stop-criterion", "MIN_OBJECTIVE"); objectiveFunctionModuleConfig.setStringProperty("enforce-curative-security", "false"); @@ -49,7 +51,8 @@ void checkObjectiveFunctionConfig() { RaoParameters parameters = new RaoParameters(); RaoParameters.load(parameters, platformCfg); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, objectiveFunctionParameters.getType()); + assertEquals(Unit.AMPERE, objectiveFunctionParameters.getUnit()); assertEquals(123, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); @@ -214,13 +217,15 @@ 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("unit", "AMPERE"); 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(Unit.AMPERE, parameters.getObjectiveFunctionParameters().getUnit()); 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..99cf7ab6f8 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,8 @@ 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()); + 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 776e9999e8..56932d6c68 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 @@ -6,6 +6,7 @@ */ package com.powsybl.openrao.raoapi.parameters; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.raoapi.json.JsonRaoParameters; import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; @@ -43,7 +44,8 @@ void testConfigWithExtensions() throws IOException { RaoParameters parameters = loadRaoParameters("config_withExtensions"); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, objectiveFunctionParameters.getType()); + assertEquals(Unit.AMPERE, objectiveFunctionParameters.getUnit()); assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); @@ -125,7 +127,8 @@ void testConfigWithoutExtensions() throws IOException { RaoParameters parameters = loadRaoParameters("config_withoutExtensions"); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, objectiveFunctionParameters.getType()); + assertEquals(Unit.AMPERE, objectiveFunctionParameters.getUnit()); assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); @@ -194,7 +197,8 @@ void testConfigWithPartialExtensions() throws IOException { RaoParameters parameters = loadRaoParameters("config_withPartialExtensions"); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT, objectiveFunctionParameters.getType()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, objectiveFunctionParameters.getType()); + assertEquals(Unit.MEGAWATT, objectiveFunctionParameters.getUnit()); assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); 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 30c532ab6c..8a374c6d65 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "preventive-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 983.0, "enforce-curative-security" : true 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 800323d649..4d2f386c4d 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "preventive-stop-criterion" : "SECURE", "curative-min-obj-improvement" : 0.0, "enforce-curative-security" : false 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 ebbbf7e5c8..724b0b2075 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "preventive-stop-criterion" : "SECURE", "curative-min-obj-improvement" : 0.0 }, 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 d15bec1b7e..d2192b2b4a 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "preventive-stop-criterion" : "WRONG", "curative-min-obj-improvement" : 0.0 }, 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 9f8e1a8dfb..9020d01ac6 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "preventive-stop-criterion" : "SECURE", "curative-min-obj-improvement" : 0.0 }, 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 66b09077ba..04c9386a8f 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "preventive-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 3.0, "enforce-curative-security" : false 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 5bba5b5e63..e4c9643ae4 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "preventive-stop-criterion" : "SECURE", "curative-min-obj-improvement" : 0.0, "enforce-curative-security" : false 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 e0c79ea5c8..0df864eebb 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "preventive-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 3.0, "enforce-curative-security" : false 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 252c132c93..1b20d92434 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "preventive-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 3.0, "enforce-curative-security" : false 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 ab39cd98ff..e7735795dc 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,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "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 071ce5977c..9decec5c10 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false }, 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 b9782070b1..2705752085 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "preventive-stop-criterion" : "SECURE", "curative-min-obj-improvement" : 0.0, "enforce-curative-security" : false 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 dda8abd801..fbe6897a5f 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml @@ -1,5 +1,6 @@ rao-objective-function: - type: MAX_MIN_MARGIN_IN_AMPERE + type: MAX_MIN_MARGIN + unit: AMPERE preventive-stop-criterion: MIN_OBJECTIVE curative-min-obj-improvement: 3.0 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 e0d7d35028..a808ad8b02 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml @@ -1,5 +1,6 @@ rao-objective-function: - type: MAX_MIN_MARGIN_IN_AMPERE + type: MAX_MIN_MARGIN + unit: AMPERE preventive-stop-criterion: MIN_OBJECTIVE curative-min-obj-improvement: 3.0 enforce-curative-security: false 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 16e193ea11..3cc1229836 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 @@ -80,7 +80,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 = raoParameters.getObjectiveFunctionParameters().getUnit(); this.toolProvider = toolProvider; this.initialFlowResult = initialFlowResult; this.prePerimeterSensitivityOutput = prePerimeterSensitivityOutput; @@ -103,7 +103,7 @@ AutomatonPerimeterResultImpl simulateAutomatonState(State automatonState, Set> 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), raoParameters.getObjectiveFunctionParameters().getType(), raoParameters.getObjectiveFunctionParameters().getUnit(), numberLoggedElementsDuringRao); return Pair.of(result, activePowerSetpoints); } @@ -646,7 +646,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, raoParameters.getObjectiveFunctionParameters().getType(), raoParameters.getObjectiveFunctionParameters().getUnit(), NUMBER_LOGGED_ELEMENTS_END_RAO); return postCheckResults(mergedRaoResults, initialOutput, raoParameters.getObjectiveFunctionParameters()); } @@ -183,7 +183,7 @@ 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, raoParameters.getObjectiveFunctionParameters().getType(), raoParameters.getObjectiveFunctionParameters().getUnit(), NUMBER_LOGGED_ELEMENTS_END_RAO); } return postCheckResults(mergedRaoResults, initialOutput, raoParameters.getObjectiveFunctionParameters()); @@ -242,7 +242,7 @@ private CompletableFuture postCheckResults(RaoResult raoResult, PrePe 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, objectiveFunctionParameters.getType(), objectiveFunctionParameters.getUnit(), 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 26efe5a081..5694bc124c 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 @@ -199,7 +199,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, raoParameters.getObjectiveFunctionParameters().getType(), raoParameters.getObjectiveFunctionParameters().getUnit(), 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 ce3df00497..3420c98129 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 @@ -62,6 +62,7 @@ public static void logSensitivityAnalysisResults(String prefix, RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, sensitivityAnalysisResult, raoParameters.getObjectiveFunctionParameters().getType(), + raoParameters.getObjectiveFunctionParameters().getUnit(), numberOfLoggedLimitingElements); } @@ -88,16 +89,16 @@ 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, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, Unit unit, int numberOfLoggedElements) { + logMostLimitingElementsResults(logger, optimizationResult, optimizationResult, null, objectiveFunction, unit, 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, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, Unit unit, int numberOfLoggedElements) { + logMostLimitingElementsResults(logger, prePerimeterResult, prePerimeterResult, states, objectiveFunction, unit, 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, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, Unit unit, int numberOfLoggedElements) { + logMostLimitingElementsResults(logger, prePerimeterResult, prePerimeterResult, null, objectiveFunction, unit, numberOfLoggedElements); } private static void logMostLimitingElementsResults(OpenRaoLogger logger, @@ -105,8 +106,9 @@ private static void logMostLimitingElementsResults(OpenRaoLogger logger, FlowResult flowResult, Set states, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit unit, int numberOfLoggedElements) { - getMostLimitingElementsResults(objectiveFunctionResult, flowResult, states, objectiveFunction, numberOfLoggedElements) + getMostLimitingElementsResults(objectiveFunctionResult, flowResult, states, objectiveFunction, unit, numberOfLoggedElements) .forEach(logger::info); } @@ -114,9 +116,9 @@ static List getMostLimitingElementsResults(ObjectiveFunctionResult objec FlowResult flowResult, Set states, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit unit, int numberOfLoggedElements) { List summary = new ArrayList<>(); - Unit unit = objectiveFunction.getUnit(); boolean relativePositiveMargins = objectiveFunction.relativePositiveMargins(); List sortedCnecs = getMostLimitingElements(objectiveFunctionResult, states, numberOfLoggedElements); @@ -128,7 +130,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, objectiveFunction, unit); 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,11 +147,11 @@ static List getMostLimitingElementsResults(ObjectiveFunctionResult objec private static TwoSides getMostConstrainedSide(FlowCnec cnec, FlowResult flowResult, - ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction) { + ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit unit) { 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); @@ -162,8 +164,9 @@ public static void logMostLimitingElementsResults(OpenRaoLogger logger, Set contingencyScenarios, Map contingencyOptimizationResults, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit unit, int numberOfLoggedElements) { - getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, objectiveFunction, numberOfLoggedElements) + getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, objectiveFunction, unit, numberOfLoggedElements) .forEach(logger::info); } @@ -172,9 +175,9 @@ public static List getMostLimitingElementsResults(Perimeter preventivePe Set contingencyScenarios, Map contingencyOptimizationResults, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit unit, int numberOfLoggedElements) { List summary = new ArrayList<>(); - Unit unit = objectiveFunction.getUnit(); boolean relativePositiveMargins = objectiveFunction.relativePositiveMargins(); Map mostLimitingElementsAndMargins = 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 ed0dea2f15..318c4aa37e 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 @@ -57,9 +57,9 @@ public static void initNetwork(Network network, String networkVariantId) { } public static void checkParameters(RaoParameters raoParameters, RaoInput raoInput) { - if (raoParameters.getObjectiveFunctionParameters().getType().getUnit().equals(Unit.AMPERE) + if (raoParameters.getObjectiveFunctionParameters().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())); + throw new OpenRaoException(format("Objective function unit %s cannot be calculated with a DC default sensitivity engine", raoParameters.getObjectiveFunctionParameters().getUnit().toString())); } if (raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) { @@ -170,7 +170,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), raoParameters.getObjectiveFunctionParameters().getUnit())) .map(ur -> ur.getUsageMethod(state)) .collect(Collectors.toSet()); } 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 3ff741d352..be7abfe718 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 @@ -78,7 +78,7 @@ public ObjectiveFunction buildForInitialSensitivityComputation(Set flo marginEvaluator = new BasicMarginEvaluator(); } - this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getType().getUnit(), marginEvaluator)); + this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getUnit(), 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 +108,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, raoParameters.getObjectiveFunctionParameters().getUnit(), new MarginEvaluatorWithMarginDecreaseUnoptimizedCnecs(marginEvaluator, operatorsNotToOptimizeInCurative, prePerimeterFlowResult))); } else { - this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getType().getUnit(), marginEvaluator)); + this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getUnit(), 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(), + raoParameters.getObjectiveFunctionParameters().getUnit(), initialFlowResult, raoParameters.getExtension(MnecParametersExtension.class) )); 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 281e17895c..4a89cbbb36 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 @@ -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..7ca7afbef1 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 @@ -22,6 +22,7 @@ public final class IteratingLinearOptimizerParameters { private final ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private final Unit objectiveFunctionUnit; private final RangeActionsOptimizationParameters rangeActionParameters; private final MnecParametersExtension mnecParameters; @@ -35,6 +36,7 @@ public final class IteratingLinearOptimizerParameters { private final boolean raRangeShrinking; private IteratingLinearOptimizerParameters(ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit objectiveFunctionUnit, RangeActionsOptimizationParameters rangeActionParameters, MnecParametersExtension mnecParameters, RelativeMarginsParametersExtension maxMinRelativeMarginParameters, @@ -45,6 +47,7 @@ private IteratingLinearOptimizerParameters(ObjectiveFunctionParameters.Objective int maxNumberOfIterations, boolean raRangeShrinking) { this.objectiveFunction = objectiveFunction; + this.objectiveFunctionUnit = objectiveFunctionUnit; this.rangeActionParameters = rangeActionParameters; this.mnecParameters = mnecParameters; this.maxMinRelativeMarginParameters = maxMinRelativeMarginParameters; @@ -61,7 +64,7 @@ public ObjectiveFunctionParameters.ObjectiveFunctionType getObjectiveFunction() } public Unit getObjectiveFunctionUnit() { - return getObjectiveFunction().getUnit(); + return objectiveFunctionUnit; } public boolean hasRelativeMargins() { @@ -124,6 +127,7 @@ public static LinearOptimizerParametersBuilder create() { public static class LinearOptimizerParametersBuilder { private ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private Unit objectiveFunctionUnit; private RangeActionsOptimizationParameters rangeActionParameters; private MnecParametersExtension mnecParameters; private RelativeMarginsParametersExtension maxMinRelativeMarginParameters; @@ -139,6 +143,11 @@ public LinearOptimizerParametersBuilder withObjectiveFunction(ObjectiveFunctionP return this; } + public LinearOptimizerParametersBuilder withObjectiveFunctionUnit(Unit objectiveFunctionUnit) { + this.objectiveFunctionUnit = objectiveFunctionUnit; + return this; + } + public LinearOptimizerParametersBuilder withRangeActionParameters(RangeActionsOptimizationParameters rangeActionParameters) { this.rangeActionParameters = rangeActionParameters; return this; @@ -191,6 +200,7 @@ public IteratingLinearOptimizerParameters build() { return new IteratingLinearOptimizerParameters( objectiveFunction, + objectiveFunctionUnit, 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 ecf6396e1c..d61cfca307 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 @@ -209,6 +209,7 @@ void optimize(SearchTreeInput searchTreeInput, SearchTreeParameters parameters) // build parameters IteratingLinearOptimizerParameters linearOptimizerParameters = IteratingLinearOptimizerParameters.create() .withObjectiveFunction(parameters.getObjectiveFunction()) + .withObjectiveFunctionUnit(parameters.getObjectiveFunctionUnit()) .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 051301324e..ccb0912226 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.getObjectiveFunction(), parameters.getObjectiveFunctionUnit(), 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.getObjectiveFunction(), parameters.getObjectiveFunctionUnit(), 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.getObjectiveFunction(), parameters.getObjectiveFunctionUnit(), 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.getObjectiveFunction(), parameters.getObjectiveFunctionUnit(), 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.getObjectiveFunction(), parameters.getObjectiveFunctionUnit(), NUMBER_LOGGED_ELEMENTS_DURING_TREE); } else { topLevelLogger.info("No better result found in search depth {}, exiting search tree", depth + 1); } @@ -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 25cafbe711..44b720571a 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,6 +6,7 @@ */ package com.powsybl.openrao.searchtreerao.searchtree.parameters; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.crac.api.Crac; import com.powsybl.openrao.data.crac.api.Instant; import com.powsybl.openrao.data.crac.api.RaUsageLimits; @@ -33,6 +34,7 @@ public class SearchTreeParameters { private final ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private final Unit objectiveFunctionUnit; // required for the search tree algorithm private final TreeParameters treeParameters; @@ -49,7 +51,7 @@ public class SearchTreeParameters { private final int maxNumberOfIterations; public SearchTreeParameters(ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, - TreeParameters treeParameters, + Unit objectiveFunctionUnit, TreeParameters treeParameters, NetworkActionParameters networkActionParameters, Map raLimitationParameters, RangeActionsOptimizationParameters rangeActionParameters, @@ -60,6 +62,7 @@ public SearchTreeParameters(ObjectiveFunctionParameters.ObjectiveFunctionType ob RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters, int maxNumberOfIterations) { this.objectiveFunction = objectiveFunction; + this.objectiveFunctionUnit = objectiveFunctionUnit; this.treeParameters = treeParameters; this.networkActionParameters = networkActionParameters; this.raLimitationParameters = raLimitationParameters; @@ -76,6 +79,10 @@ public ObjectiveFunctionParameters.ObjectiveFunctionType getObjectiveFunction() return objectiveFunction; } + public Unit getObjectiveFunctionUnit() { + return objectiveFunctionUnit; + } + public TreeParameters getTreeParameters() { return treeParameters; } @@ -236,6 +243,7 @@ public static SearchTreeParametersBuilder create() { public static class SearchTreeParametersBuilder { private ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private Unit objectiveFunctionUnit; private TreeParameters treeParameters; private NetworkActionParameters networkActionParameters; private Map raLimitationParameters; @@ -249,6 +257,7 @@ public static class SearchTreeParametersBuilder { public SearchTreeParametersBuilder withConstantParametersOverAllRao(RaoParameters raoParameters, Crac crac) { this.objectiveFunction = raoParameters.getObjectiveFunctionParameters().getType(); + this.objectiveFunctionUnit = raoParameters.getObjectiveFunctionParameters().getUnit(); this.networkActionParameters = NetworkActionParameters.buildFromRaoParameters(raoParameters.getTopoOptimizationParameters(), crac); this.raLimitationParameters = new HashMap<>(crac.getRaUsageLimitsPerInstant()); this.rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); @@ -265,6 +274,11 @@ public SearchTreeParametersBuilder with0bjectiveFunction(ObjectiveFunctionParame return this; } + public SearchTreeParametersBuilder with0bjectiveFunctionUnit(Unit objectiveFunctionUnit) { + this.objectiveFunctionUnit = objectiveFunctionUnit; + return this; + } + public SearchTreeParametersBuilder withTreeParameters(TreeParameters treeParameters) { this.treeParameters = treeParameters; return this; @@ -316,7 +330,9 @@ public SearchTreeParametersBuilder withMaxNumberOfIterations(int maxNumberOfIter } public SearchTreeParameters build() { - return new SearchTreeParameters(objectiveFunction, + return new SearchTreeParameters( + objectiveFunction, + objectiveFunctionUnit, treeParameters, networkActionParameters, raLimitationParameters, 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 eb226fa450..7fb6ef2ea4 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 @@ -233,7 +233,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.getObjectiveFunctionParameters().setUnit(Unit.MEGAWATT); raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityProvider("OpenLoadFlow"); mockedPreAutoPerimeterSensitivityAnalysis = mock(PrePerimeterSensitivityAnalysis.class); 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 4737ac8e9c..c924e817a6 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 @@ -193,7 +193,8 @@ void testThreeCurativeInstantsWithSecondCurativeHavingNoCnecAndNoRa() { 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -287,7 +288,8 @@ void testThreeCurativeInstants() { 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); 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/PrePerimeterSensitivityAnalysisTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysisTest.java index 0ad647e925..3137b2c206 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,8 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); mockSystematicSensitivityInterface(false, false); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); @@ -102,7 +103,8 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); mockSystematicSensitivityInterface(true, false); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); assertNotNull(result.getSensitivityResult()); @@ -112,7 +114,8 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); mockSystematicSensitivityInterface(false, true); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); @@ -123,7 +126,8 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); mockSystematicSensitivityInterface(true, true); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); @@ -136,7 +140,8 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); mockSystematicSensitivityInterface(false, false); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runBasedOnInitialResults(network, crac, optimizationResult, Collections.emptySet(), new AppliedRemedialActions()); @@ -151,7 +156,8 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); 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 5ab4a52982..2763aeb103 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 @@ -140,7 +140,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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, Unit.MEGAWATT, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -10, MEGAWATT, cnec1), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -150,7 +150,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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, Unit.MEGAWATT, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -10, MEGAWATT, cnec1), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -160,7 +160,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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, Unit.AMPERE, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -10, AMPERE, cnec2), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, AMPERE, cnec4), summary.get(1)); @@ -170,7 +170,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), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, Unit.AMPERE, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -10, AMPERE, cnec2), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, AMPERE, cnec4), summary.get(1)); @@ -183,25 +183,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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, Unit.MEGAWATT, 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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, Unit.MEGAWATT, 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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, Unit.AMPERE, 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), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, Unit.AMPERE, 5); assertEquals(1, summary.size()); assertEquals(absoluteMarginLog(1, -0.002, AMPERE, cnec6), summary.get(0)); } @@ -210,15 +210,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(), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, Unit.MEGAWATT, 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), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, Unit.MEGAWATT, 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), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, Unit.MEGAWATT, 5); assertEquals(3, summary.size()); assertEquals(absoluteMarginLog(1, -10, MEGAWATT, cnec1), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -226,13 +226,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), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, Unit.AMPERE, 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), ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, Unit.AMPERE, 5); assertEquals(2, summary.size()); assertEquals(absoluteMarginLog(1, 0, AMPERE, cnec4), summary.get(0)); assertEquals(relativeMarginLog(2, 200, .3, AMPERE, cnec3), summary.get(1)); @@ -271,7 +271,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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, Unit.MEGAWATT, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -8, MEGAWATT, cnec5), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -283,7 +283,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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, Unit.MEGAWATT, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -8, MEGAWATT, cnec5), summary.get(0)); assertEquals(absoluteMarginLog(2, 0, MEGAWATT, cnec2), summary.get(1)); @@ -295,7 +295,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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, Unit.AMPERE, 5); assertEquals(5, summary.size()); assertEquals(absoluteMarginLog(1, -21, AMPERE, cnec4), summary.get(0)); assertEquals(absoluteMarginLog(2, -10, AMPERE, cnec2), summary.get(1)); @@ -307,7 +307,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, ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, Unit.AMPERE, 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 95e460e0bb..de50e99f96 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,17 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); 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("Objective function unit A cannot be calculated with a DC default sensitivity engine", exception.getMessage()); } @Test 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 a0d0fd9d09..d33203f97a 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,6 +7,7 @@ package com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.crac.api.Crac; import com.powsybl.openrao.data.crac.api.CracFactory; import com.powsybl.openrao.data.crac.api.Instant; @@ -106,7 +107,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.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); 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 ef0b73e040..4b04006c89 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,6 +7,7 @@ package com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; @@ -69,7 +70,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.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); LinearProblem linearProblem = linearProblemBuilder.buildFromInputsAndParameters(inputs, parameters); assertNotNull(linearProblem); @@ -83,7 +85,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.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); LinearProblem linearProblem = linearProblemBuilder.buildFromInputsAndParameters(inputs, parameters); assertNotNull(linearProblem); @@ -99,7 +102,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.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); LinearProblem linearProblem = linearProblemBuilder.buildFromInputsAndParameters(inputs, parameters); assertNotNull(linearProblem); @@ -113,7 +117,10 @@ 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.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); + when(parameters.isRaoWithMnecLimitation()).thenReturn(true); when(parameters.isRaoWithLoopFlowLimitation()).thenReturn(true); when(parameters.getUnoptimizedCnecParameters()).thenReturn(Mockito.mock(UnoptimizedCnecParameters.class)); @@ -133,7 +140,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.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); 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 3e741bdd1d..35bb6f475d 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,8 @@ 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); + raoParameters.getObjectiveFunctionParameters().setUnit(MEGAWATT); 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/SearchTreeTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTreeTest.java index f790ea4c9a..1cf348d552 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 @@ -93,7 +93,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.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + when(searchTreeParameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); 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 97d2eb8eaf..0c3b69e1bf 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,6 +7,7 @@ package com.powsybl.openrao.searchtreerao.searchtree.parameters; import com.powsybl.iidm.network.Network; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.crac.api.Crac; import com.powsybl.openrao.data.crac.api.Instant; import com.powsybl.openrao.data.crac.api.RaUsageLimits; @@ -68,6 +69,7 @@ void testWithConstantParametersOverAllRao() { @Test void testIndividualSetters() { ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction = Mockito.mock(ObjectiveFunctionParameters.ObjectiveFunctionType.class); + Unit objectiveFunctionUnit = Mockito.mock(Unit.class); TreeParameters treeParameters = Mockito.mock(TreeParameters.class); NetworkActionParameters networkActionParameters = Mockito.mock(NetworkActionParameters.class); Map raLimitationParameters = new HashMap<>(); @@ -81,6 +83,7 @@ void testIndividualSetters() { SearchTreeParameters searchTreeParameters = builder .with0bjectiveFunction(objectiveFunction) + .with0bjectiveFunctionUnit(objectiveFunctionUnit) .withTreeParameters(treeParameters) .withNetworkActionParameters(networkActionParameters) .withGlobalRemedialActionLimitationParameters(raLimitationParameters) 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 78ed0b746d..8c8b9f50c1 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 7d97a8c79b..2745366b2c 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 9a228dae04..951039dd2e 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 90c796da81..4dcd2c1b78 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, diff --git a/tests/src/test/java/com/powsybl/openrao/tests/utils/CneHelper.java b/tests/src/test/java/com/powsybl/openrao/tests/utils/CneHelper.java index b71065cfc1..f4f26480bb 100644 --- a/tests/src/test/java/com/powsybl/openrao/tests/utils/CneHelper.java +++ b/tests/src/test/java/com/powsybl/openrao/tests/utils/CneHelper.java @@ -76,8 +76,8 @@ private static void fillPropertiesWithCoreCneExporterParameters(Properties prope private static void fillPropertiesWithRaoParameters(Properties properties, RaoParameters raoParameters) { switch (raoParameters.getObjectiveFunctionParameters().getType()) { - case MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "true"); - case MAX_MIN_MARGIN_IN_AMPERE, MAX_MIN_MARGIN_IN_MEGAWATT -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "false"); + case MAX_MIN_RELATIVE_MARGIN -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "true"); + case MAX_MIN_MARGIN -> properties.setProperty("rao-result.export.core-cne.relative-positive-margins", "false"); } if (raoParameters.hasExtension(LoopFlowParametersExtension.class)) { properties.setProperty("rao-result.export.core-cne.with-loop-flows", "true"); 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 54d5831edb..ecf8694beb 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_default.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_default.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 f946c1265c..e761046b8a 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 3a87baebe4..e4f8fb967d 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 909fefb026..80fb639005 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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_ac.json index 2d2ea1f6d3..5786edecc7 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_ac.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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_dc.json index 7a2b0d023f..a51ee4b242 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_dc.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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_dc_withLoopFlows.json index 3bc0c4a84f..7a13ffa44c 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_dc_withLoopFlows.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 d5e1320257..97277c0e14 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 70f96d7d9a..306fd4cddc 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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_megawatt_ac.json index 72ceef349e..e7675a5e31 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_ac.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_ac.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 4f346521ea..2ab423fb5f 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 337acd27a4..65846b8f75 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 923cbb912b..29edf0c2c3 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 1f87dddf6e..e284f40c1c 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 ed8c046153..b15a8334e9 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 7ad0f13faf..15f3444af0 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 29c70396fa..f3502b1a1d 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 565a41b6f1..887c038606 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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_ac_mnecDimin180.json index 9f439d027b..66d7cc7f1c 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_ac_mnecDimin180.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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_ac_mnecDimin20.json index e6760eb3dd..485eb1b763 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_ac_mnecDimin20.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 b4e04266be..97c039327a 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 e4333c32cd..8797140e10 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 bcccd0a781..4bffab1bf7 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 0f497d4d3a..1ef7a0ce72 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 877618c0db..6e4fe7e751 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 7b05d9c7f2..328fa61b67 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 835f554a88..f1cd61cfb7 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 300.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : true 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 efee8f5ef1..4f541900e9 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 500.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 f1e0b5f530..c2ee608a96 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 628.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 ed6070a0a9..8a29589b75 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 77c173b955..dc815dd60a 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 dbbda62c30..3e713c64a8 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 e33afb2390..91a0112525 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 3175286422..6303de7630 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 792d71a696..0152799c2e 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 1dacc9d575..aef7e2fef4 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 2c148ed2a9..ee1841f836 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 ed7997dee5..3ea5df5766 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 c7be9e5775..8806772b3f 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 af8adfad33..0eb115e5d0 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 2280689477..2af2859925 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 9b0111d9f4..21bc10d84f 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 60649946b0..64f813bd89 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 e36ff9693f..f4217fc6d2 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 ba086344c8..e7c95262a2 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 474ece869a..1103355328 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 1f98ae478c..e25dc00b74 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 5163474191..19cdd43d17 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 7475d2daf3..c343c37cd5 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 7475d2daf3..c343c37cd5 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 36a6c76481..2dc1b276d1 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 2c30a7029f..03b29a212e 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 2c30a7029f..03b29a212e 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 fa17158d51..3f6ebc6ccb 100644 --- a/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json +++ b/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 ee42664592..5ffc156971 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 9e20f5043a..dcc42e6c30 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 bf6624a935..433460ae2f 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 c064eadbe8..f9aa265393 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 c5bc1fd805..6c893618d3 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 12b99c7fef..c179c5144d 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 bc712485b0..f31433e638 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 1948a0657f..5d2e227005 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 41e026fbf1..e714a3b9f5 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 8d3e7ae83a..d5a7cebf6a 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 81e4f73afc..b9069f90a1 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 80a40d6c57..1aa26415f6 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 25e390318c..57cbb2248c 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 c0042d30a5..49b38503f4 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 50.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : true 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 1821c2965e..75119f5011 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 f946c1265c..e761046b8a 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 febce2b3f2..a16b3a8433 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 bd40b180b6..faea05e52d 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 a51e1fcc02..efc43f027f 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 c040661518..8f5c888bb2 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 b3c2d3bf90..b95a079f64 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 10077f3a4b..1f860a044b 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 bd265fb42a..c523dd0c85 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 931b553b76..a96550f533 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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_mw_ac_lf_false_10_100.json index 1758d7ad39..ad3dc0688f 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_mw_ac_lf_false_10_100.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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_mw_ac_lf_false_5_100.json index 1ce7cf7d44..e607eb0b06 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_mw_ac_lf_false_5_100.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 1c3d36def3..7636ba3476 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 8dfb7d47e7..2083b79eeb 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 0d9d5ed929..b3fbe61aa1 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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_ac_lf_true_5_100.json index 770854062b..b94e66ab03 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_ac_lf_true_5_100.json @@ -1,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 ca22728162..171b4d3543 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 6aa35a76f7..e4ce16c5b2 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 05688feda9..ff1f4262ed 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 83a76ff7d8..5e65105fa0 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 67cb497029..e930fec252 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 e4bbaf265b..ec49e7e7d4 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 862f32bbc7..80a9072c65 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 8902463dda..b646ef9bed 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 6dbc8caf08..f75cb1611d 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 af49829956..a51abdb704 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 766a206c5f..287d85b478 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 33168b4a28..bc8319b0a8 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 ea5bbc7870..ae5cb5867a 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 688bf1eeca..9e20f004df 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 ae6394a4a4..b8b0ae2f5d 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE" }, 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 949b331f5d..5a80eaf3ee 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 37bec14dce..7ccdc38ec3 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false 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 3d157d4667..f8bccfc5fa 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,7 +1,8 @@ { "version" : "2.5", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", "enforce-curative-security" : false