From d726fbb0d63c0e5910ded558982f17c4579a9579 Mon Sep 17 00:00:00 2001 From: Pauline Jean-Marie Date: Tue, 3 Sep 2024 17:26:42 +0200 Subject: [PATCH 1/4] Remove curative stop criterion and 'optimize curative if preventive unsecure' and partially replace them by 'enforce curative security' NB. Curative min objective does no longer exist and is replaced by Curative have the same objective than the Preventive results Signed-off-by: Pauline Jean-Marie --- docs/parameters.md | 29 +---- python-util/rao_parameter_modification.py | 117 +++++++++++++++--- .../openrao/raoapi/RaoParametersCommons.java | 3 +- .../json/JsonObjectiveFunctionParameters.java | 18 +-- .../ObjectiveFunctionParameters.java | 33 ++--- .../raoapi/json/JsonRaoParametersTest.java | 5 +- .../parameters/RaoParametersConfigTest.java | 7 +- .../RaoParametersYamlConfigTest.java | 8 +- .../test/resources/RaoParametersSet_v2.json | 3 +- ...arametersWithCurStopCriterionError_v2.json | 83 ------------- .../RaoParametersWithExtension_v2.json | 3 +- .../RaoParametersWithLoopFlowError_v2.json | 1 - ...rametersWithPrevStopCriterionError_v2.json | 3 +- .../RaoParametersWithWrongField_v2.json | 1 - .../RaoParameters_config_withExtensions.json | 3 +- .../RaoParameters_config_withOLFParams.json | 3 +- ...rameters_config_withPartialExtensions.json | 3 +- ...aoParameters_config_withoutExtensions.json | 3 +- .../resources/RaoParameters_update_v2.json | 3 +- .../src/test/resources/RaoParameters_v2.json | 3 +- .../test/resources/config_withExtensions.yml | 1 - .../config_withPartialExtensions.yml | 1 - .../resources/config_withoutExtensions.yml | 3 +- .../algorithm/CastorFullOptimization.java | 8 +- .../algorithm/CastorSecondPreventive.java | 36 ++---- .../commons/parameters/TreeParameters.java | 24 ++-- .../algorithm/CastorFullOptimizationTest.java | 14 +-- .../algorithm/CastorSecondPreventiveTest.java | 40 +----- .../parameters/TreeParametersTest.java | 31 ++--- .../parameters/RaoParameters_2P_v2.json | 4 +- .../parameters/RaoParameters_DC.json | 4 +- .../RaoParameters_oneIteration_v2.json | 4 +- .../parameters/RaoParameters_secure.json | 3 +- .../US15_7.feature | 1 + .../common/RaoParameters_default.json | 3 +- .../RaoParameters_maxMargin_ampere.json | 4 +- .../RaoParameters_maxMargin_ampere_mip.json | 4 +- ...ameters_maxMargin_ampere_withFallback.json | 4 +- .../RaoParameters_maxMargin_megawatt_ac.json | 4 +- .../RaoParameters_maxMargin_megawatt_dc.json | 4 +- ...s_maxMargin_megawatt_dc_withLoopFlows.json | 4 +- .../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 | 4 +- .../epic10/conf_ep10us2case1.json | 4 +- .../epic10/conf_ep10us2case2.json | 4 +- .../epic10/conf_ep10us3case1.json | 4 +- .../epic10/conf_ep10us4case1.json | 4 +- ...rs_maxMargin_megawatt_ac_mnecDimin180.json | 4 +- ...ers_maxMargin_megawatt_ac_mnecDimin20.json | 4 +- ...rs_posMargin_ampere_mnecDiminMinusInf.json | 3 +- .../raoParametersSweIDCC_minObjective.json | 4 +- ...ametersSweIDCC_minObjectiveDisabled2P.json | 4 +- ...etersSweIDCC_minObjectiveWithGlobal2P.json | 4 +- .../epic13/RaoParameters_13_6_11.json | 2 +- .../epic13/RaoParameters_13_6_2.json | 4 +- ...ameters_best_preventive_by_300_secure.json | 2 +- .../RaoParameters_best_preventive_by_500.json | 2 +- .../RaoParameters_best_preventive_by_628.json | 2 +- .../epic13/RaoParameters_ep13us6case8.json | 4 +- .../epic13/RaoParameters_ep13us7case6.json | 4 +- ...Parameters_maxMargin_ampere_2p_global.json | 4 +- ...s_maxMargin_ampere_absolute_threshold.json | 4 +- ...axMargin_ampere_absolute_threshold_12.json | 4 +- .../RaoParameters_relMargin_ampere.json | 4 +- ...arameters_stop_curative_at_preventive.json | 2 +- .../epic15/RaoParameters_ep15us11-2.json | 3 +- .../epic15/RaoParameters_ep15us11-4.json | 4 +- .../epic15/RaoParameters_ep15us11-5-1.json | 4 +- .../epic15/RaoParameters_ep15us11-5-2.json | 3 +- .../epic15/RaoParameters_ep15us11-5-3-3.json | 4 +- .../epic15/RaoParameters_ep15us13case1.json | 4 +- .../epic15/RaoParameters_ep15us13case10.json | 4 +- .../epic15/RaoParameters_ep15us13case2.json | 4 +- .../epic15/RaoParameters_ep15us13case5.json | 4 +- .../epic15/RaoParameters_ep15us13case6.json | 4 +- .../epic15/RaoParameters_ep15us13case7.json | 4 +- .../epic15/RaoParameters_ep15us13case8.json | 4 +- .../epic15/RaoParameters_ep15us17case10.json | 3 +- .../epic15/RaoParameters_ep15us17case11.json | 3 +- .../epic15/RaoParameters_ep15us17case12.json | 4 +- .../epic15/RaoParameters_ep15us17case2.json | 3 +- .../epic15/RaoParameters_ep15us17case6.json | 3 +- .../epic15/RaoParameters_ep15us7-2.json | 7 ++ .../raoParametersSweIDCC_withoutPsts.json | 3 +- .../epic19/RaoParameters_19_10_10&11.json | 4 +- .../epic19/RaoParameters_19_11_9.json | 4 +- .../epic19/RaoParameters_19_11_9_bis.json | 4 +- .../epic19/RaoParameters_dc_discrete.json | 4 +- ...oParameters_maxMargin_ampere_shareCra.json | 4 +- ...arameters_maxMargin_megawatt_shareCra.json | 4 +- ...rameters_maxRelMargin_ampere_shareCra.json | 4 +- ...ters_maxRelMargin_ampere_shareCra_mip.json | 4 +- ...meters_maxRelMargin_megawatt_shareCra.json | 4 +- ...rs_maxRelMargin_megawatt_shareCra_mip.json | 4 +- .../epic20/RaoParameters_20_4.json | 2 +- .../epic20/RaoParameters_20_6_1.json | 4 +- .../epic20/RaoParameters_20_6_2.json | 4 +- ...ameters_maxMargin_MW_DC_withLF_with2P.json | 2 +- ..._maxMargin_ampere_2p_if_cost_increase.json | 4 +- ...maxMargin_ampere_forbid_cost_increase.json | 4 +- ...rs_maxMargin_ampere_second_preventive.json | 4 +- ...meters_posMargin_ampere_ac_divergence.json | 3 +- ...gin_ampere_withFallback_ac_divergence.json | 4 +- ...re_withFallback_differentFallbackCost.json | 3 +- ...meters_maxMargin_absoluteMinImpact190.json | 4 +- ...meters_maxMargin_absoluteMinImpact195.json | 4 +- .../RaoParameters_maxMargin_maxDepth.json | 4 +- ...arameters_maxMargin_relativeMinImpact.json | 4 +- ...eters_maxMargin_mw_ac_lf_false_10_100.json | 4 +- ...meters_maxMargin_mw_ac_lf_false_5_100.json | 4 +- ..._maxMargin_mw_ac_lf_false_5_100_BE_NL.json | 4 +- ...ers_maxMargin_mw_ac_lf_false_5_100_NL.json | 4 +- ...n_mw_ac_lf_false_5_100_lfAugmentation.json | 4 +- ...ameters_maxMargin_mw_ac_lf_true_5_100.json | 4 +- ...ers_maxMargin_mw_dc_lf_accurate_5_100.json | 4 +- ...eters_maxMargin_mw_dc_lf_false_10_100.json | 4 +- ...meters_maxMargin_mw_dc_lf_false_5_100.json | 4 +- ...rs_maxMargin_mw_dc_lf_inBetween_5_100.json | 4 +- .../RaoParameters_case_91_12_search_tree.json | 4 +- .../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 | 4 +- .../epic91/RaoParameters_case_91_1_3.json | 4 +- .../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 | 4 +- ...rs_maxMargin_mw_ac_lf_false_3_100_mip.json | 4 +- ...rameters_maxMargin_ampere_highPSTcost.json | 4 +- 137 files changed, 367 insertions(+), 515 deletions(-) delete mode 100644 ra-optimisation/rao-api/src/test/resources/RaoParametersWithCurStopCriterionError_v2.json create mode 100644 tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us7-2.json diff --git a/docs/parameters.md b/docs/parameters.md index 926f485e48..b9cd8e0051 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -51,34 +51,13 @@ These parameters (objective-function) configure the remedial action optimisation - **SECURE**: the search-tree will stop as soon as it finds a solution where the minimum margin is positive. *Note: if the best possible minimum margin is negative, both stop criterion will return the same solution.* -#### curative-stop-criterion -- **Expected value**: one of the following: - - "MIN_OBJECTIVE" - - "SECURE" - - "PREVENTIVE_OBJECTIVE" - - "PREVENTIVE_OBJECTIVE_AND_SECURE" -- **Default value**: "MIN_OBJECTIVE" -- **Usage**: stop criterion for the curative RAO search-tree. - - **MIN_OBJECTIVE**: the search-tree will maximize the minimum margin until it converges to a - maximum value, or until another stop criterion has been reached (e.g. [max-curative-search-tree-depth](#max-curative-search-tree-depth)). - - **SECURE**: the search-tree will stop as soon as it finds a solution where the minimum margin is positive. - - **PREVENTIVE_OBJECTIVE**: the search-tree will stop as soon as the preventive RAO's objective value is reached, - and improved by at least ["curative-rao-min-obj-improvement"](#curative-min-obj-improvement). - - **PREVENTIVE_OBJECTIVE_AND_SECURE**: the search-tree will stop as soon as the preventive RAO's objective value is - reached, and improved by at least ["curative-rao-min-obj-improvement"](#curative-min-obj-improvement), and all - margins are positive. - - *The values "PREVENTIVE_OBJECTIVE" and "PREVENTIVE_OBJECTIVE_AND_SECURE" allow you to speed up the curative RAO - without deteriorating the final solution (minimum margin over all perimeters). However, using them means the flow-based - domain is not maximised for all perimeters.* - #### curative-min-obj-improvement - **Expected value**: numeric value, where the unit is that of the objective function - **Default value**: 0 - **Usage**: used as a minimum improvement of the preventive RAO objective value for the curative RAO stop criterion, when it is set to PREVENTIVE_OBJECTIVE or PREVENTIVE_OBJECTIVE_AND_SECURE. -#### optimize-curative-if-preventive-unsecure +#### enforce-curative-security - **Expected value**: true/false - **Default value**: false - **Usage**: if this parameter is set to true, OpenRAO will continue optimizing curative states even if preventive state @@ -314,7 +293,7 @@ These parameters (second-preventive-rao) tune the behaviour of the [second preve during curative RAO - **POSSIBLE_CURATIVE_IMPROVEMENT**: a 2nd preventive RAO is run only if it is possible to improve a curative perimeter, i.e. if the curative RAO stop criterion on at least one contingency is not reached. - This depends on the value of parameter [curative-stop-criterion](#curative-stop-criterion): + This depends on the value of parameter [preventive-stop-criterion](#preventive-stop-criterion): - **SECURE**: 2nd preventive RAO is run if one curative perimeter is not secure after optimisation - **PREVENTIVE_OBJECTIVE**: 2nd preventive RAO is run if one curative perimeter reached an objective function value after optimisation that is worse than the preventive perimeter's (decreased by [curative-min-obj-improvement](#curative-min-obj-improvement)) @@ -575,8 +554,7 @@ Zones are seperated by + or -. "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE", - "optimize-curative-if-preventive-unsecure" : true + "enforce-curative-security" : true }, "range-actions-optimization" : { "max-mip-iterations" : 5, @@ -693,7 +671,6 @@ Based on PowSyBl's [configuration mechanism](inv:powsyblcore:std:doc#user/config rao-objective-function: type: MAX_MIN_MARGIN_IN_AMPERE preventive-stop-criterion: SECURE - curative-stop-criterion: SECURE rao-range-actions-optimization: max-mip-iterations: 5 diff --git a/python-util/rao_parameter_modification.py b/python-util/rao_parameter_modification.py index 55a3acac51..a7f709ab6d 100644 --- a/python-util/rao_parameter_modification.py +++ b/python-util/rao_parameter_modification.py @@ -6,35 +6,114 @@ import os import json +from json import JSONDecodeError +import yaml -root_directory = os.path.join(os.getcwd(), "..") +current_directory = os.getcwd() +tag_by_file_type = {"json": "objective-function", "yaml": "rao-objective-function"} + def rao_parameters_file(file_path): correct_version = False - obj_fun = False - if file_path.endswith(".json") or file_path.endswith(".yml"): + score = 0 + if "target" not in file_path and (file_path.endswith(".json") or file_path.endswith(".yml")): + ftype = "json" if file_path.endswith(".json") else "yaml" with open(os.path.join(dirpath, filename), 'r') as file: for line in file: - if "objective-function" in line: - obj_fun = True if '"version" : "2.4"' in line or '"version" : "2.5"' in line: correct_version = True - if correct_version and obj_fun: + 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: + score += 1 + if correct_version and score >= 2: return True return False +def read_data(file_path) -> tuple[dict, str]: + if file_path.endswith(".json"): + with open(file_path, 'r') as file: + try: + return json.load(file), "json" + except JSONDecodeError as je: + print("in file " + file_path) + raise je + if file_path.endswith(".yml"): + with open(file_path, 'r') as file: + return yaml.safe_load(file), "yaml" # ["rao-parameters"] + +def extract_leading_whitespace(line): + leading_whitespace = "" + for char in line: + if char.isspace(): + leading_whitespace += char + else: + break + return leading_whitespace + +def write_data(new_data, file_path, file_type): + with open(file_path, 'r') as file: + lines = file.readlines() + lines_to_write = [] + inside_obj_fun_to_replace = False + for line in lines: + if tag_by_file_type[file_type] in line and tag_by_file_type[file_type] in new_data: + leading_whitespace = extract_leading_whitespace(line) + inside_obj_fun_to_replace = True + if inside_obj_fun_to_replace and ((file_type == "json" and "}" in line) or (file_type == "yaml" and line == "\n")): + obj_fun_str = f'"{tag_by_file_type[file_type]}" : ' + obj_function_as_str_lines(new_data, file_type) + for new_line in obj_fun_str.splitlines(True): + lines_to_write.append(leading_whitespace + new_line) + inside_obj_fun_to_replace = False + elif not inside_obj_fun_to_replace: + lines_to_write.append(line) + with open(file_path, 'w') as file: + file.writelines(lines_to_write) + + +def obj_function_as_str_lines(new_data, file_type): + if file_type == "json": + return json.dumps(new_data[tag_by_file_type[file_type]], indent=2, separators=(',', ' : ')) + ',\n' + else: + return yaml.dump(new_data[tag_by_file_type[file_type]], default_flow_style=False) + '\n' + + + +def new_rao_param(data: dict, file_path: str, file_type: str) -> dict: + try: + old_obj_fun = data[tag_by_file_type[file_type]] + 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) + except KeyError as ke: + raise KeyError("in file " + file_path) from ke + data[tag_by_file_type[file_type]] = new_obj_fun + return data + + -for dirpath, dirnames, filenames in os.walk(root_directory): - for filename in filenames: - file_path = os.path.join(dirpath, filename) - if rao_parameters_file(file_path): - print("file to change : " + file_path) - lines = None - if file_path.endswith(".json"): - with open(file_path, 'r') as file: - lines = file.readlines() - lines = [line.replace('"version" : "2.4"', '"version" : "2.5"') for line in lines if "forbid-cost-increase" not in line] - if lines is not None: - with open(file_path, 'w') as file: - file.writelines(lines) +if __name__ == "__main__": + base_dir = os.path.join(current_directory, "..") + print(base_dir) + for dirpath, dirnames, filenames in os.walk(base_dir): + for filename in filenames: + file_path = os.path.join(dirpath, filename) + if rao_parameters_file(file_path): + data, file_type = read_data(file_path) + new_rao_params = new_rao_param(data, file_path, file_type) + write_data(new_rao_params, file_path, file_type) diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java index 35a0261247..fa0bcae7af 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java @@ -27,8 +27,7 @@ private RaoParametersCommons() { public static final String TYPE = "type"; public static final String CURATIVE_MIN_OBJ_IMPROVEMENT = "curative-min-obj-improvement"; public static final String PREVENTIVE_STOP_CRITERION = "preventive-stop-criterion"; - public static final String CURATIVE_STOP_CRITERION = "curative-stop-criterion"; - public static final String OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE = "optimize-curative-if-preventive-unsecure"; + public static final String ENFORCE_CURATIVE_SECURITY = "enforce-curative-security"; // range actions optimization parameters public static final String RANGE_ACTIONS_OPTIMIZATION = "range-actions-optimization"; diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java index af4ae6b069..34f8a0809d 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java @@ -28,9 +28,8 @@ static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) thr jsonGenerator.writeObjectFieldStart(OBJECTIVE_FUNCTION); jsonGenerator.writeObjectField(TYPE, parameters.getObjectiveFunctionParameters().getType()); jsonGenerator.writeObjectField(PREVENTIVE_STOP_CRITERION, parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()); - jsonGenerator.writeObjectField(CURATIVE_STOP_CRITERION, parameters.getObjectiveFunctionParameters().getCurativeStopCriterion()); jsonGenerator.writeNumberField(CURATIVE_MIN_OBJ_IMPROVEMENT, parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement()); - jsonGenerator.writeBooleanField(OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE, parameters.getObjectiveFunctionParameters().getOptimizeCurativeIfPreventiveUnsecure()); + jsonGenerator.writeBooleanField(ENFORCE_CURATIVE_SECURITY, parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()); jsonGenerator.writeEndObject(); } @@ -43,16 +42,13 @@ static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) thro case PREVENTIVE_STOP_CRITERION: raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(stringToPreventiveStopCriterion(jsonParser.nextTextValue())); break; - case CURATIVE_STOP_CRITERION: - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(stringToCurativeStopCriterion(jsonParser.nextTextValue())); - break; case CURATIVE_MIN_OBJ_IMPROVEMENT: jsonParser.nextToken(); raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(jsonParser.getValueAsDouble()); break; - case OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE: + case ENFORCE_CURATIVE_SECURITY: jsonParser.nextToken(); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(jsonParser.getBooleanValue()); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(jsonParser.getBooleanValue()); break; default: throw new OpenRaoException(String.format("Cannot deserialize objective function parameters: unexpected field in %s (%s)", OBJECTIVE_FUNCTION, jsonParser.getCurrentName())); @@ -76,12 +72,4 @@ private static ObjectiveFunctionParameters.PreventiveStopCriterion stringToPreve } } - private static ObjectiveFunctionParameters.CurativeStopCriterion stringToCurativeStopCriterion(String string) { - try { - return ObjectiveFunctionParameters.CurativeStopCriterion.valueOf(string); - } catch (IllegalArgumentException e) { - throw new OpenRaoException(String.format("Unknown curative stop criterion: %s", string)); - } - } - } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ObjectiveFunctionParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ObjectiveFunctionParameters.java index 2b0aee4dca..133d4217d6 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 @@ -24,14 +24,12 @@ public class ObjectiveFunctionParameters { private static final ObjectiveFunctionType DEFAULT_OBJECTIVE_FUNCTION = ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT; private static final double DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT = 0; private static final PreventiveStopCriterion DEFAULT_PREVENTIVE_STOP_CRITERION = PreventiveStopCriterion.SECURE; - private static final CurativeStopCriterion DEFAULT_CURATIVE_STOP_CRITERION = CurativeStopCriterion.MIN_OBJECTIVE; - private static final boolean DEFAULT_OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE = false; + private static final boolean DEFAULT_ENFORCE_CURATIVE_SECURITY = false; // Attributes private ObjectiveFunctionType type = DEFAULT_OBJECTIVE_FUNCTION; private double curativeMinObjImprovement = DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT; private PreventiveStopCriterion preventiveStopCriterion = DEFAULT_PREVENTIVE_STOP_CRITERION; - private CurativeStopCriterion curativeStopCriterion = DEFAULT_CURATIVE_STOP_CRITERION; - private boolean optimizeCurativeIfPreventiveUnsecure = DEFAULT_OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE; + private boolean enforceCurativeSecurity = DEFAULT_ENFORCE_CURATIVE_SECURITY; // Enum public enum ObjectiveFunctionType { @@ -60,13 +58,6 @@ public enum PreventiveStopCriterion { SECURE } - public enum CurativeStopCriterion { - MIN_OBJECTIVE, // only stop after minimizing objective - SECURE, //stop when objective is strictly negative - PREVENTIVE_OBJECTIVE, // stop when preventive objective is reached, or bested by curativeRaoMinObjImprovement - PREVENTIVE_OBJECTIVE_AND_SECURE // stop when preventive objective is reached or bested by curativeRaoMinObjImprovement, and the situation is secure - } - // Getters and setters public ObjectiveFunctionType getType() { return type; @@ -88,20 +79,12 @@ public PreventiveStopCriterion getPreventiveStopCriterion() { return preventiveStopCriterion; } - public CurativeStopCriterion getCurativeStopCriterion() { - return curativeStopCriterion; - } - - public void setCurativeStopCriterion(CurativeStopCriterion curativeStopCriterion) { - this.curativeStopCriterion = curativeStopCriterion; - } - - public boolean getOptimizeCurativeIfPreventiveUnsecure() { - return optimizeCurativeIfPreventiveUnsecure; + public boolean getEnforceCurativeSecurity() { + return enforceCurativeSecurity; } - public void setOptimizeCurativeIfPreventiveUnsecure(boolean optimizeCurativeIfPreventiveUnsecure) { - this.optimizeCurativeIfPreventiveUnsecure = optimizeCurativeIfPreventiveUnsecure; + public void setEnforceCurativeSecurity(boolean enforceCurativeSecurity) { + this.enforceCurativeSecurity = enforceCurativeSecurity; } public static ObjectiveFunctionParameters load(PlatformConfig platformConfig) { @@ -114,9 +97,7 @@ public static ObjectiveFunctionParameters load(PlatformConfig platformConfig) { parameters.setCurativeMinObjImprovement(config.getDoubleProperty(CURATIVE_MIN_OBJ_IMPROVEMENT, DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT)); parameters.setPreventiveStopCriterion(config.getEnumProperty(PREVENTIVE_STOP_CRITERION, PreventiveStopCriterion.class, DEFAULT_PREVENTIVE_STOP_CRITERION)); - parameters.setCurativeStopCriterion(config.getEnumProperty(CURATIVE_STOP_CRITERION, CurativeStopCriterion.class, - DEFAULT_CURATIVE_STOP_CRITERION)); - parameters.setOptimizeCurativeIfPreventiveUnsecure(config.getBooleanProperty(OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE, DEFAULT_OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE)); + parameters.setEnforceCurativeSecurity(config.getBooleanProperty(ENFORCE_CURATIVE_SECURITY, DEFAULT_ENFORCE_CURATIVE_SECURITY)); }); return parameters; } diff --git a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/json/JsonRaoParametersTest.java b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/json/JsonRaoParametersTest.java index 27d7fdfdef..1894204992 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 @@ -54,9 +54,8 @@ void roundTrip() throws IOException { // Objective Function parameters parameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE); parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE); parameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(983); - parameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + parameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // RangeActionsOptimization parameters parameters.getRangeActionsOptimizationParameters().setMaxMipIterations(30); parameters.getRangeActionsOptimizationParameters().setPstPenaltyCost(10); @@ -176,7 +175,7 @@ void testFailOnOldVersion() { } @ParameterizedTest - @ValueSource(strings = {"LoopFlowError", "PrevStopCriterionError", "CurStopCriterionError", "WrongField"}) + @ValueSource(strings = {"LoopFlowError", "PrevStopCriterionError", "WrongField"}) void importNokTest(String source) { InputStream inputStream = getClass().getResourceAsStream("/RaoParametersWith" + source + "_v2.json"); assertThrows(OpenRaoException.class, () -> JsonRaoParameters.read(inputStream)); diff --git a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java index 90ad9a330d..6383571cc9 100644 --- a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java +++ b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java @@ -25,6 +25,7 @@ /** * @author Godelaine de Montmorillon {@literal } */ + class RaoParametersConfigTest { private PlatformConfig mockedPlatformConfig; private InMemoryPlatformConfig platformCfg; @@ -43,8 +44,7 @@ void checkObjectiveFunctionConfig() { objectiveFunctionModuleConfig.setStringProperty("type", "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE"); objectiveFunctionModuleConfig.setStringProperty("curative-min-obj-improvement", Objects.toString(123.0)); objectiveFunctionModuleConfig.setStringProperty("preventive-stop-criterion", "MIN_OBJECTIVE"); - objectiveFunctionModuleConfig.setStringProperty("curative-stop-criterion", "PREVENTIVE_OBJECTIVE"); - objectiveFunctionModuleConfig.setStringProperty("optimize-curative-if-preventive-unsecure", "true"); + objectiveFunctionModuleConfig.setStringProperty("enforce-curative-security", "false"); RaoParameters parameters = new RaoParameters(); RaoParameters.load(parameters, platformCfg); @@ -52,8 +52,7 @@ void checkObjectiveFunctionConfig() { assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); assertEquals(123, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); - assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); - assertTrue(objectiveFunctionParameters.getOptimizeCurativeIfPreventiveUnsecure()); + assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); } @Test 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 ef6b62e36f..776e9999e8 100644 --- a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersYamlConfigTest.java +++ b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersYamlConfigTest.java @@ -27,6 +27,7 @@ /** * @author Godelaine de Montmorillon {@literal } */ + class RaoParametersYamlConfigTest extends AbstractSerDeTest { static final double DOUBLE_TOLERANCE = 1e-6; @@ -45,7 +46,7 @@ void testConfigWithExtensions() throws IOException { assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); - assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); + assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); assertEquals(2, rangeActionsOptimizationParameters.getMaxMipIterations(), DOUBLE_TOLERANCE); @@ -127,8 +128,7 @@ void testConfigWithoutExtensions() throws IOException { assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); - assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); - assertTrue(objectiveFunctionParameters.getOptimizeCurativeIfPreventiveUnsecure()); + assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); assertEquals(2, rangeActionsOptimizationParameters.getMaxMipIterations(), DOUBLE_TOLERANCE); @@ -197,7 +197,7 @@ void testConfigWithPartialExtensions() throws IOException { assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT, objectiveFunctionParameters.getType()); assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); - assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); + assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); assertEquals(10, rangeActionsOptimizationParameters.getMaxMipIterations(), DOUBLE_TOLERANCE); diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json index 0422d7c1e6..30c532ab6c 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json @@ -3,9 +3,8 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE_AND_SECURE", "curative-min-obj-improvement" : 983.0, - "optimize-curative-if-preventive-unsecure" : true + "enforce-curative-security" : true }, "range-actions-optimization" : { "max-mip-iterations" : 30, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithCurStopCriterionError_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithCurStopCriterionError_v2.json deleted file mode 100644 index ecdda18e3e..0000000000 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithCurStopCriterionError_v2.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "version" : "2.5", - "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "WRONG", - "curative-stop-criterion" : "MIN_OBJECTIVE", - "curative-min-obj-improvement" : 0.0 - }, - "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } - }, - "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], - "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false - }, - "not-optimized-cnecs" : { - "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false - }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.8", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "extensions" : { - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "FIXED_PTDF", - "constraint-adjustment-coefficient" : 0.0, - "violation-cost" : 0.0, - "countries" : [ ] - } - } -} \ No newline at end of file diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json index 299d44dcb6..800323d649 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json @@ -3,9 +3,8 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json index 1ffbec315d..ebbbf7e5c8 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json @@ -3,7 +3,6 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json index 8f4fba3851..d15bec1b7e 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json @@ -2,8 +2,7 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "WRONG", + "preventive-stop-criterion" : "WRONG", "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json index d9e9896e4d..9f8e1a8dfb 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json @@ -3,7 +3,6 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withExtensions.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withExtensions.json index adbd34a32e..66b09077ba 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 @@ -3,9 +3,8 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE", "curative-min-obj-improvement" : 3.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 2, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withOLFParams.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withOLFParams.json index d2c0f17e04..5bba5b5e63 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 @@ -3,9 +3,8 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withPartialExtensions.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withPartialExtensions.json index 6f26d8e352..e0c79ea5c8 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 @@ -3,9 +3,8 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE", "curative-min-obj-improvement" : 3.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withoutExtensions.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_config_withoutExtensions.json index fabde397b7..252c132c93 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 @@ -3,9 +3,8 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE", "curative-min-obj-improvement" : 3.0, - "optimize-curative-if-preventive-unsecure" : true + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 2, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json index 34c57510e4..071ce5977c 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 @@ -2,7 +2,8 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "MIN_OBJECTIVE", + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json index c05a509bd9..b9782070b1 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json @@ -3,9 +3,8 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", "curative-min-obj-improvement" : 0.0, - "optimize-curative-if-preventive-unsecure" : false + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml b/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml index f2413d6201..dda8abd801 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml @@ -1,7 +1,6 @@ rao-objective-function: type: MAX_MIN_MARGIN_IN_AMPERE preventive-stop-criterion: MIN_OBJECTIVE - curative-stop-criterion: PREVENTIVE_OBJECTIVE curative-min-obj-improvement: 3.0 rao-range-actions-optimization: diff --git a/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml b/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml index 53a2794f9e..3a37e14d7e 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml @@ -1,6 +1,5 @@ rao-objective-function: preventive-stop-criterion: MIN_OBJECTIVE - curative-stop-criterion: PREVENTIVE_OBJECTIVE curative-min-obj-improvement: 3.0 rao-range-actions-optimization: diff --git a/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml b/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml index 229f5ada7e..e0d7d35028 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml @@ -1,9 +1,8 @@ rao-objective-function: type: MAX_MIN_MARGIN_IN_AMPERE preventive-stop-criterion: MIN_OBJECTIVE - curative-stop-criterion: PREVENTIVE_OBJECTIVE curative-min-obj-improvement: 3.0 - optimize-curative-if-preventive-unsecure: true + enforce-curative-security: false rao-range-actions-optimization: max-mip-iterations: 2 diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java index ac63d981de..e03aecb6ab 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java @@ -195,8 +195,8 @@ public CompletableFuture run() { private boolean shouldStopOptimisationIfPreventiveUnsecure(double preventiveOptimalCost) { return raoParameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE) - && preventiveOptimalCost > 0 - && !raoParameters.getObjectiveFunctionParameters().getOptimizeCurativeIfPreventiveUnsecure(); + && preventiveOptimalCost > 0 + && !raoParameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity(); } /** @@ -216,8 +216,8 @@ private boolean secondPreventiveImprovesResults(RaoResult secondPreventiveRaoRes double secondPreventiveCost = secondPreventiveRaoResults.getCost(curativeInstant); if (secondPreventiveCost > firstPreventiveCost) { BUSINESS_LOGS.info("Second preventive step has increased the overall cost from {} (functional: {}, virtual: {}) to {} (functional: {}, virtual: {}). Falling back to previous solution:", - formatDoubleBasedOnMargin(firstPreventiveCost, -firstPreventiveCost), formatDoubleBasedOnMargin(mergedRaoResults.getFunctionalCost(curativeInstant), -firstPreventiveCost), formatDoubleBasedOnMargin(mergedRaoResults.getVirtualCost(curativeInstant), -firstPreventiveCost), - formatDoubleBasedOnMargin(secondPreventiveCost, -secondPreventiveCost), formatDoubleBasedOnMargin(secondPreventiveRaoResults.getFunctionalCost(curativeInstant), -secondPreventiveCost), formatDoubleBasedOnMargin(secondPreventiveRaoResults.getVirtualCost(curativeInstant), -secondPreventiveCost)); + formatDoubleBasedOnMargin(firstPreventiveCost, -firstPreventiveCost), formatDoubleBasedOnMargin(mergedRaoResults.getFunctionalCost(curativeInstant), -firstPreventiveCost), formatDoubleBasedOnMargin(mergedRaoResults.getVirtualCost(curativeInstant), -firstPreventiveCost), + formatDoubleBasedOnMargin(secondPreventiveCost, -secondPreventiveCost), formatDoubleBasedOnMargin(secondPreventiveRaoResults.getFunctionalCost(curativeInstant), -secondPreventiveCost), formatDoubleBasedOnMargin(secondPreventiveRaoResults.getVirtualCost(curativeInstant), -secondPreventiveCost)); return false; } return true; 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 553edabb9f..26efe5a081 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 @@ -101,30 +101,20 @@ boolean shouldRunSecondPreventiveRao(OptimizationResult firstPreventiveResult, C // only compare initial cost with the curative costs return false; } - if (raoParameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE) - && firstPreventiveResult.getCost() > 0) { - // in case of curative optimization even if preventive unsecure (see parameter optimize-curative-if-preventive-unsecure) - // we do not want to run a second preventive that would not be able to fix the situation, to save time - BUSINESS_LOGS.info("First preventive RAO was not able to fix all preventive constraints, second preventive RAO cancelled to save computation time."); - return false; + ObjectiveFunctionParameters.PreventiveStopCriterion preventiveStopCriterion = raoParameters.getObjectiveFunctionParameters().getPreventiveStopCriterion(); + if (preventiveStopCriterion.equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE)) { + if (firstPreventiveResult.getCost() > 0) { + // in case of curative optimization even if preventive unsecure (see parameter enforce-curative-security) + // we do not want to run a second preventive that would not be able to fix the situation, to save time + BUSINESS_LOGS.info("First preventive RAO was not able to fix all preventive constraints, second preventive RAO cancelled to save computation time."); + return false; + } + // Run 2nd preventive RAO if one perimeter of the curative optimization is unsecure + return isAnyResultUnsecure(curativeRaoResults); + } else { // MIN_OBJECTIVE + // Run 2nd preventive RAO if the final result has a worse cost than the preventive perimeter + return isFinalCostWorseThanPreventive(raoParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), firstPreventiveResult, postFirstRaoResult, lastCurativeInstant); } - ObjectiveFunctionParameters.CurativeStopCriterion curativeStopCriterion = raoParameters.getObjectiveFunctionParameters().getCurativeStopCriterion(); - return switch (curativeStopCriterion) { - case MIN_OBJECTIVE -> - // Run 2nd preventive RAO in all cases - true; - case SECURE -> - // Run 2nd preventive RAO if one perimeter of the curative optimization is unsecure - isAnyResultUnsecure(curativeRaoResults); - case PREVENTIVE_OBJECTIVE -> - // Run 2nd preventive RAO if the final result has a worse cost than the preventive perimeter - isFinalCostWorseThanPreventive(raoParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), firstPreventiveResult, postFirstRaoResult, lastCurativeInstant); - case PREVENTIVE_OBJECTIVE_AND_SECURE -> - // Run 2nd preventive RAO if the final result has a worse cost than the preventive perimeter or is unsecure - isAnyResultUnsecure(curativeRaoResults) || isFinalCostWorseThanPreventive(raoParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), firstPreventiveResult, postFirstRaoResult, lastCurativeInstant); - default -> - throw new OpenRaoException(String.format("Unknown curative RAO stop criterion: %s", curativeStopCriterion)); - }; } /** diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java index 300af61bb1..256bbab297 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java @@ -53,27 +53,20 @@ public static TreeParameters buildForAutomatonPerimeter(RaoParameters parameters } public static TreeParameters buildForCurativePerimeter(RaoParameters parameters, Double preventiveOptimizedCost) { - StopCriterion stopCriterion; + StopCriterion stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; double targetObjectiveValue; - switch (parameters.getObjectiveFunctionParameters().getCurativeStopCriterion()) { + switch (parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()) { case MIN_OBJECTIVE: - stopCriterion = StopCriterion.MIN_OBJECTIVE; - targetObjectiveValue = 0.0; + targetObjectiveValue = preventiveOptimizedCost - parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(); + if (parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()) { + targetObjectiveValue = Math.min(targetObjectiveValue, 0); + } break; case SECURE: - stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; targetObjectiveValue = 0.0; break; - case PREVENTIVE_OBJECTIVE: - stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; - targetObjectiveValue = preventiveOptimizedCost - parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(); - break; - case PREVENTIVE_OBJECTIVE_AND_SECURE: - stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; - targetObjectiveValue = Math.min(preventiveOptimizedCost - parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), 0); - break; default: - throw new OpenRaoException("Unknown curative stop criterion: " + parameters.getObjectiveFunctionParameters().getCurativeStopCriterion()); + throw new OpenRaoException("Unknown preventive stop criterion: " + parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()); } RangeActionsOptimizationParameters.RaRangeShrinking raRangeShrinking = parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking(); boolean shouldShrinkRaRange = raRangeShrinking.equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO) || @@ -87,8 +80,7 @@ public static TreeParameters buildForCurativePerimeter(RaoParameters parameters, public static TreeParameters buildForSecondPreventivePerimeter(RaoParameters parameters) { boolean raRangeShrinking = parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking().equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); - if (parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE) - && !parameters.getObjectiveFunctionParameters().getCurativeStopCriterion().equals(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE)) { + if (parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE)) { return new TreeParameters(StopCriterion.AT_TARGET_OBJECTIVE_VALUE, 0.0, // secure parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), diff --git a/ra-optimisation/search-tree-rao/src/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 dc2af081f7..4737ac8e9c 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 @@ -426,7 +426,7 @@ void curativeOptimizationShouldNotBeDoneIfPreventiveUnsecure() throws IOExceptio RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(false); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -439,7 +439,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveSecure() throws IOException { RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(false); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -451,7 +451,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveMinMarginNegative() throws IOEx setup("small-network-2P.uct", "small-crac-to-check-curative-optimization-if-preventive-secure.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(false); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -464,7 +464,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveUnsecureAndAssociatedParameterS RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -477,7 +477,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveSecureAndAssociatedParameterSet RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -489,7 +489,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveMinMarginNegativeAndAssociatedP setup("small-network-2P.uct", "small-crac-to-check-curative-optimization-if-preventive-secure.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -501,7 +501,7 @@ void curativeStopCriterionReachedSkipsPerimeterBuilding() throws IOException { setup("small-network-2P.uct", "small-crac-purely-virtual-curative.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_secure.json")); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO, if not skipping, then tap to -15, since skipping, it stays at preventive optimization value (-12) RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java index 92ce142dd3..8ade5dbfe8 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java @@ -277,13 +277,9 @@ void testShouldRunSecondPreventiveRaoSimple() { parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.DISABLED); assertFalse(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, null, 0)); - // CurativeStopCriterion.MIN_OBJECTIVE + // PreventiveStopCriterion.SECURE, secure case parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); - assertTrue(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, null, 0)); - - // CurativeStopCriterion.SECURE, secure case - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.SECURE); + parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); Mockito.doReturn(-1.).when(optimizationResult1).getFunctionalCost(); Mockito.doReturn(-10.).when(optimizationResult2).getFunctionalCost(); Mockito.doReturn(0.).when(optimizationResult1).getVirtualCost(); @@ -322,8 +318,8 @@ void testShouldRunSecondPreventiveRaoAdvanced() { when(preventiveResult.getCost()).thenReturn(-500.); CastorSecondPreventive castorSecondPreventive = new CastorSecondPreventive(crac, parameters, network, null, null, null); - // CurativeStopCriterion.PREVENTIVE_OBJECTIVE - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE); + // PreventiveStopCriterion.MIN_OBJECTIVE + parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); setCost(preventiveResult, -100.); // case 1 : final cost is better than preventive (cost < preventive cost - minObjImprovement) when(postFirstPreventiveRaoResult.getCost(curativeInstant)).thenReturn(-200.); @@ -334,30 +330,6 @@ void testShouldRunSecondPreventiveRaoAdvanced() { // case 3 : final cost > preventive cost - minObjImprovement when(postFirstPreventiveRaoResult.getCost(curativeInstant)).thenReturn(-109.); assertTrue(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, postFirstPreventiveRaoResult, 0)); - - // CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE); - // case 1 : all curatives are better than preventive (cost <= preventive cost - minObjImprovement), SECURE - setCost(optimizationResult1, -200.); - setCost(optimizationResult2, -300.); - when(postFirstPreventiveRaoResult.getCost(curativeInstant)).thenReturn(-200.); - assertFalse(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, postFirstPreventiveRaoResult, 0)); - setCost(optimizationResult1, -110.); - when(postFirstPreventiveRaoResult.getCost(curativeInstant)).thenReturn(-110.); - assertFalse(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, postFirstPreventiveRaoResult, 0)); - // case 2 : all curatives are better than preventive (cost < preventive cost - minObjImprovement), UNSECURE - setCost(preventiveResult, -500.); - setCost(optimizationResult1, -200.); - when(postFirstPreventiveRaoResult.getCost(curativeInstant)).thenReturn(0.); - assertTrue(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, postFirstPreventiveRaoResult, 0)); - setCost(optimizationResult1, 10.); - when(postFirstPreventiveRaoResult.getCost(curativeInstant)).thenReturn(10.); - assertTrue(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, postFirstPreventiveRaoResult, 0)); - // case 3 : one curative has cost > preventive cost - minObjImprovement, SECURE - setCost(preventiveResult, -100.); - setCost(optimizationResult1, -109.); - when(postFirstPreventiveRaoResult.getCost(curativeInstant)).thenReturn(-109.); - assertTrue(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, postFirstPreventiveRaoResult, 0)); } @Test @@ -369,7 +341,7 @@ void testShouldRunSecondPreventiveRaoTime() { Collection curativeResults = Set.of(optimizationResult1, optimizationResult2); parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); + // Default objective function parameters are enough for SecondPreventiveRaoParameters to be true if there is enough time CastorSecondPreventive castorSecondPreventive = new CastorSecondPreventive(crac, parameters, network, null, null, java.time.Instant.now().plusSeconds(200)); // Enough time @@ -390,7 +362,7 @@ void testShouldRunSecondPreventiveRaoCostIncrease() { Collection curativeResults = Set.of(optimizationResult1, optimizationResult2); parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.COST_INCREASE); - parameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); + // Default objective function parameters are enough for SecondPreventiveRaoParameters to be true if cost at curative allows it RaoResult postFirstRaoResult = Mockito.mock(RaoResult.class); when(postFirstRaoResult.getCost(null)).thenReturn(-100.); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java index 8c1f0eb3fe..060027af85 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java @@ -64,22 +64,9 @@ void testPreventive() { assertTrue(treeParameters.raRangeShrinking()); } - @Test - void testCurativeMinObjective() { - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); - raoParameters.getNotOptimizedCnecsParameters().setDoNotOptimizeCurativeCnecsForTsosWithoutCras(false); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.DISABLED); - TreeParameters treeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, 100.0); - - assertEquals(TreeParameters.StopCriterion.MIN_OBJECTIVE, treeParameters.stopCriterion()); - assertEquals(2, treeParameters.leavesInParallel()); - assertEquals(6, treeParameters.maximumSearchDepth()); - assertFalse(treeParameters.raRangeShrinking()); - } - @Test void testCurativeSecureStopCriterion() { - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); raoParameters.getMultithreadingParameters().setCurativeLeavesInParallel(16); raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); TreeParameters treeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, 100.0); @@ -93,7 +80,8 @@ void testCurativeSecureStopCriterion() { @Test void testCurativePreventiveObjectiveStopCriterion() { - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(35); raoParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(0); raoParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(0); @@ -110,7 +98,8 @@ void testCurativePreventiveObjectiveStopCriterion() { @Test void testCurativePreventiveObjectiveAndSecureStopCriterion() { - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE); + raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(35); // limited by secure @@ -139,7 +128,7 @@ void testCurativePreventiveObjectiveAndSecureStopCriterion() { void testSecondPreventive() { // test with min objective raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.DISABLED); TreeParameters treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); @@ -150,7 +139,7 @@ void testSecondPreventive() { // test with secure raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); @@ -162,18 +151,18 @@ void testSecondPreventive() { // other combinations raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); - assertEquals(TreeParameters.StopCriterion.MIN_OBJECTIVE, treeParameters.stopCriterion()); + assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); assertEquals(4, treeParameters.leavesInParallel()); assertEquals(6, treeParameters.maximumSearchDepth()); assertTrue(treeParameters.raRangeShrinking()); // still another combination raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getObjectiveFunctionParameters().setCurativeStopCriterion(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE_AND_SECURE); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); raoParameters.getMultithreadingParameters().setPreventiveLeavesInParallel(8); raoParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(15); raoParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(5); diff --git a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_2P_v2.json b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_2P_v2.json index 4bcc3ef4db..78ed0b746d 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_DC.json b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_DC.json index d5e79c99bd..7d97a8c79b 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_oneIteration_v2.json b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_oneIteration_v2.json index 38af7218b2..9a228dae04 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_secure.json b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_secure.json index ad65ede1cd..90c796da81 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_7.feature b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_7.feature index 22cbfb1074..974e79f278 100644 --- a/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_7.feature +++ b/tests/src/test/resources/com/powsybl/openrao/tests/features/epic15_specific_network_elements/US15_7.feature @@ -17,6 +17,7 @@ Feature: US 15.7: Injection setpoint with absolute and relative target Scenario: US 15.7.2: Curative search tree RAO with absolute injectionSetpoint curative ra Given network file is "common/TestCase12Nodes.uct" Given crac file is "epic15/cse_crac_1_curative_ra.xml" + Given configuration file is "epic15/RaoParameters_ep15us7-2.json" When I launch search_tree_rao at "2021-04-30 22:30" Then 0 remedial actions are used in preventive And the remedial action "cra_1" is used after "outage_1" at "curative" diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_default.json b/tests/src/test/resources/files/configurations/common/RaoParameters_default.json index f45bccb8f6..54d5831edb 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_default.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_default.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere.json index bd86a1b087..f946c1265c 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_mip.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_mip.json index 18aeb43ced..3a87baebe4 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_withFallback.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_ampere_withFallback.json index 11f37c9f79..909fefb026 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_ac.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_ac.json index 399f0e4823..2d2ea1f6d3 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc.json index 17aa66eef2..7a2b0d023f 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json b/tests/src/test/resources/files/configurations/common/RaoParameters_maxMargin_megawatt_dc_withLoopFlows.json index 04be142e7c..3bc0c4a84f 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere.json b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere.json index c9e2b82287..d5e1320257 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere_withFallback.json b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_ampere_withFallback.json index fd487ecacc..70f96d7d9a 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_ac.json b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_ac.json index 5c6202fde6..72ceef349e 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_dc.json b/tests/src/test/resources/files/configurations/common/RaoParameters_posMargin_megawatt_dc.json index 039ccf7775..4f346521ea 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json b/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json index 6e5f5c6f0e..337acd27a4 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/common/RaoParameters_simple_AC_loopflow.json b/tests/src/test/resources/files/configurations/common/RaoParameters_simple_AC_loopflow.json index 2ccf092538..923cbb912b 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/epic10/RaoParameters_relMargin_megawatt.json b/tests/src/test/resources/files/configurations/epic10/RaoParameters_relMargin_megawatt.json index eb1c314b5f..1f87dddf6e 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json index 94823d453b..ed8c046153 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json index 2a5e6a0a50..7ad0f13faf 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json b/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json index 8e6f8e0225..29c70396fa 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json b/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json index f15fbb3d31..565a41b6f1 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin180.json b/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin180.json index c15888d393..9f439d027b 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json b/tests/src/test/resources/files/configurations/epic11/RaoParameters_maxMargin_megawatt_ac_mnecDimin20.json index d83fcc6597..e6760eb3dd 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic11/RaoParameters_posMargin_ampere_mnecDiminMinusInf.json b/tests/src/test/resources/files/configurations/epic11/RaoParameters_posMargin_ampere_mnecDiminMinusInf.json index ec6869a5a1..b4e04266be 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json index 1559db9162..e4333c32cd 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json index 70d06af30e..bcccd0a781 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json index e4e14b37db..0f497d4d3a 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_11.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_11.json index 3f874d10cb..877618c0db 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 @@ -4,7 +4,7 @@ "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_2.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_13_6_2.json index 8267ce1a5b..7b05d9c7f2 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_300_secure.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_300_secure.json index 9877e663ab..835f554a88 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 @@ -4,7 +4,7 @@ "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 300.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE_AND_SECURE" + "enforce-curative-security" : true }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_500.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_500.json index eb0fcdc9fa..efee8f5ef1 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 @@ -4,7 +4,7 @@ "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 500.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_628.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_best_preventive_by_628.json index 310fa200f5..f1e0b5f530 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 @@ -4,7 +4,7 @@ "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 628.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json index 4bcd2e354c..ed6070a0a9 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json index 650ca44b1f..77c173b955 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_2p_global.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_2p_global.json index 62a0a12c23..dbbda62c30 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold.json index ac57dd11e5..e33afb2390 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold_12.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_maxMargin_ampere_absolute_threshold_12.json index 872622a915..3175286422 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_relMargin_ampere.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_relMargin_ampere.json index 814b3adffb..792d71a696 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic13/RaoParameters_stop_curative_at_preventive.json b/tests/src/test/resources/files/configurations/epic13/RaoParameters_stop_curative_at_preventive.json index 750e190141..1dacc9d575 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 @@ -4,7 +4,7 @@ "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-2.json index 6bd88615fd..2c148ed2a9 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-4.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-4.json index 86b24c56c4..ed7997dee5 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-1.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-1.json index 4ae52f1333..c7be9e5775 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-2.json index a1a261658e..af8adfad33 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-3-3.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us11-5-3-3.json index faf195c545..2280689477 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json index 0caf50c0a4..9b0111d9f4 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json index 619048ab81..60649946b0 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json index 37bee2f618..e36ff9693f 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json index fa7f516fc3..ba086344c8 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json index de6bb291b8..474ece869a 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json index b342ec4aeb..1f98ae478c 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json index b62006e0fc..5163474191 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json index ece67003bf..7475d2daf3 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json index ece67003bf..7475d2daf3 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json index 33a70428d6..36a6c76481 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json index 7be7b2d665..2c30a7029f 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json index 7be7b2d665..2c30a7029f 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us7-2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us7-2.json new file mode 100644 index 0000000000..f6435f0428 --- /dev/null +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us7-2.json @@ -0,0 +1,7 @@ +{ + "version" : "2.5", + "objective-function" : { + "preventive-stop-criterion" : "MIN_OBJECTIVE", + "curative-min-obj-improvement" : 10000.0 + } +} \ No newline at end of file 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 3d4a6533fc..fa17158d51 100644 --- a/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json +++ b/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_10_10&11.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_10_10&11.json index 3d8df46e53..ee42664592 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9.json index 5b33107bec..9e20f5043a 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9_bis.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_19_11_9_bis.json index 95138ef84c..bf6624a935 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_dc_discrete.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_dc_discrete.json index c5ac7c6d31..c064eadbe8 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_ampere_shareCra.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_ampere_shareCra.json index d806a66959..c5bc1fd805 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_megawatt_shareCra.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxMargin_megawatt_shareCra.json index 683c788d60..12b99c7fef 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra.json index a741808d75..bc712485b0 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra_mip.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_ampere_shareCra_mip.json index 6c1e5ad214..1948a0657f 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra.json index 0fe8706bec..41e026fbf1 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra_mip.json b/tests/src/test/resources/files/configurations/epic19/RaoParameters_maxRelMargin_megawatt_shareCra_mip.json index 9904e03010..8d3e7ae83a 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_4.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_4.json index d2c84cf807..81e4f73afc 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 @@ -4,7 +4,7 @@ "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_1.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_1.json index 42f84d3e39..80a40d6c57 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_2.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_20_6_2.json index bd8fcefbdd..25e390318c 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_MW_DC_withLF_with2P.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_MW_DC_withLF_with2P.json index b140383053..c0042d30a5 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 @@ -4,7 +4,7 @@ "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 50.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE_AND_SECURE" + "enforce-curative-security" : true }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_2p_if_cost_increase.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_2p_if_cost_increase.json index b914550ed7..1821c2965e 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_forbid_cost_increase.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_forbid_cost_increase.json index bd86a1b087..f946c1265c 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_second_preventive.json b/tests/src/test/resources/files/configurations/epic20/RaoParameters_maxMargin_ampere_second_preventive.json index ca6265b397..febce2b3f2 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_ac_divergence.json b/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_ac_divergence.json index 60b4d7c477..bd40b180b6 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_ac_divergence.json b/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_ac_divergence.json index 1b95b4d32b..a51e1fcc02 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_differentFallbackCost.json b/tests/src/test/resources/files/configurations/epic4/RaoParameters_posMargin_ampere_withFallback_differentFallbackCost.json index 1ec2e9698f..c040661518 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 20, diff --git a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact190.json b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact190.json index a021239045..b3c2d3bf90 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact195.json b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_absoluteMinImpact195.json index fdfd674f8e..10077f3a4b 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_maxDepth.json b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_maxDepth.json index 37dab04520..bd265fb42a 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_relativeMinImpact.json b/tests/src/test/resources/files/configurations/epic5/RaoParameters_maxMargin_relativeMinImpact.json index b4ab1e6470..931b553b76 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_10_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_10_100.json index 5538785330..1758d7ad39 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100.json index b3b02f9607..1ce7cf7d44 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_BE_NL.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_BE_NL.json index 5155e886a1..1c3d36def3 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_NL.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_NL.json index 694ea72f00..8dfb7d47e7 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_lfAugmentation.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_false_5_100_lfAugmentation.json index aabbc0056c..0d9d5ed929 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_true_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_ac_lf_true_5_100.json index 045bd0f42b..770854062b 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_accurate_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_accurate_5_100.json index 95f2050a45..ca22728162 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_10_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_10_100.json index 97c5a8a9cb..6aa35a76f7 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_false_5_100.json index 6ca3089e6a..05688feda9 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_inBetween_5_100.json b/tests/src/test/resources/files/configurations/epic7/RaoParameters_maxMargin_mw_dc_lf_inBetween_5_100.json index 1086b79451..83a76ff7d8 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_search_tree.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_search_tree.json index 756e48d25c..67cb497029 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure.json index 4949a354f0..e4bbaf265b 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure_2PRAO.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_12_secure_2PRAO.json index c1457f5861..862f32bbc7 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_13_1.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_13_1.json index c088e2934b..8902463dda 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_1.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_1.json index cf41d51c42..6dbc8caf08 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_12.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_12.json index 665d802f8c..af49829956 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_3.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_3.json index 517f2e21ff..766a206c5f 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_6.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_6.json index 17e235efad..33168b4a28 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_7.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_case_91_1_7.json index b08396edea..ea5bbc7870 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree.json index 29d1fb763e..688bf1eeca 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree_2_threads.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_interrupt_search_tree_2_threads.json index 776c8e7812..ae6394a4a4 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 @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "preventive-stop-criterion" : "SECURE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100.json index 0f2c178a94..949b331f5d 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100_mip.json b/tests/src/test/resources/files/configurations/epic91/RaoParameters_maxMargin_mw_ac_lf_false_3_100_mip.json index 6b05a4eaa3..37bec14dce 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, diff --git a/tests/src/test/resources/files/configurations/rao1/RaoParameters_maxMargin_ampere_highPSTcost.json b/tests/src/test/resources/files/configurations/rao1/RaoParameters_maxMargin_ampere_highPSTcost.json index 2c03926ed8..3d157d4667 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 @@ -2,9 +2,9 @@ "version" : "2.5", "objective-function" : { "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "enforce-curative-security" : false }, "range-actions-optimization" : { "max-mip-iterations" : 10, From a61875c1647a685034d35bebb4b77f382e014091 Mon Sep 17 00:00:00 2001 From: Philippe Edwards Date: Fri, 24 Jan 2025 10:05:30 +0100 Subject: [PATCH 2/4] update some parameters for cucumber tests Signed-off-by: Philippe Edwards --- .../epic92/RaoParameters_dc_minObjective_discretePst.json | 3 +-- .../epic92/RaoParameters_dc_minObjective_discretePst_2P.json | 3 +-- .../epic93/RaoParameters_minCost_megawatt_dc.json | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json index 429d8f3a12..2c00e57800 100644 --- a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json +++ b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MIN_COST_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "MIN_OBJECTIVE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json index 891a14e739..c25ad7c25a 100644 --- a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json +++ b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MIN_COST_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "MIN_OBJECTIVE" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic93/RaoParameters_minCost_megawatt_dc.json b/tests/src/test/resources/files/configurations/epic93/RaoParameters_minCost_megawatt_dc.json index 7fe363781e..a772715845 100644 --- a/tests/src/test/resources/files/configurations/epic93/RaoParameters_minCost_megawatt_dc.json +++ b/tests/src/test/resources/files/configurations/epic93/RaoParameters_minCost_megawatt_dc.json @@ -3,8 +3,7 @@ "objective-function" : { "type" : "MIN_COST_IN_MEGAWATT", "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "preventive-stop-criterion" : "MIN_OBJECTIVE" }, "range-actions-optimization" : { "max-mip-iterations" : 10, From 625a0d9ed362867b9b12c36a0456d2797f5daefc Mon Sep 17 00:00:00 2001 From: Philippe Edwards Date: Fri, 24 Jan 2025 11:20:37 +0100 Subject: [PATCH 3/4] fix tests by increasing curative-min-obj-improvement Signed-off-by: Philippe Edwards --- .../epic92/RaoParameters_dc_minObjective_discretePst.json | 2 +- .../epic92/RaoParameters_dc_minObjective_discretePst_2P.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json index 2c00e57800..83b62f4078 100644 --- a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json +++ b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json @@ -2,7 +2,7 @@ "version" : "2.5", "objective-function" : { "type" : "MIN_COST_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE" }, "range-actions-optimization" : { diff --git a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json index c25ad7c25a..ab1b1a5777 100644 --- a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json +++ b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json @@ -2,7 +2,7 @@ "version" : "2.5", "objective-function" : { "type" : "MIN_COST_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, + "curative-min-obj-improvement" : 10000.0, "preventive-stop-criterion" : "MIN_OBJECTIVE" }, "range-actions-optimization" : { From abe16e40a15e3ece8fcbce09143d4166d652788f Mon Sep 17 00:00:00 2001 From: pjeanmarie <72982611+pjeanmarie@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:34:48 +0100 Subject: [PATCH 4/4] Rao parameters separate unit from objective function type (#1197) * Move unit out of objective function type * Merge content of preventive stop criterion into type * Move implem specific rao parameters into extensions * The object multithreading parameters should be the same than its input, so it contains one parameter available-cpus * Upgrade rao parameters version to 3.0 * Separate previous extensions in business/search-tree as optional * Rename to avoid having same class name in rao parameters and its extension * Separate rao parameters doc in multiple pages * change python script to be able to do all the changes to parameters --------- Signed-off-by: Pauline Jean-Marie Co-authored-by: Philippe Edwards --- .../com/powsybl/openrao/commons/Unit.java | 9 + .../io/cne/core/CoreCneCnecsCreatorTest.java | 6 +- docs/castor/linear-problem.md | 2 +- .../max-min-relative-margin-filler.md | 2 +- docs/output-data/core-cne/java-api.md | 6 +- docs/parameters.md | 741 +++--------------- docs/parameters/business-parameters.md | 230 ++++++ .../implementation-specific-parameters.md | 532 +++++++++++++ docs/tutorial.md | 6 +- python-util/rao_parameter_modification.py | 270 +++++-- .../openrao/raoapi/RaoParametersCommons.java | 47 +- .../raoapi/json/JsonLoopFlowParameters.java | 73 ++ .../raoapi/json/JsonMnecParameters.java | 50 ++ .../json/JsonMultiThreadingParameters.java | 59 -- .../json/JsonNotOptimizedCnecsParameters.java | 12 +- .../json/JsonObjectiveFunctionParameters.java | 23 +- ...sonRangeActionsOptimizationParameters.java | 100 +-- .../json/JsonRelativeMarginsParameters.java | 62 ++ .../json/JsonTopoOptimizationParameters.java | 53 +- .../json/RaoParametersDeserializer.java | 22 +- .../raoapi/json/RaoParametersSerializer.java | 8 +- ...owAndSensitivityComputationParameters.java | 18 +- .../extensions/JsonLoopFlowParameters.java | 60 ++ .../JsonLoopFlowParametersExtension.java | 105 --- .../json/extensions/JsonMnecParameters.java | 57 ++ .../JsonMnecParametersExtension.java | 80 -- .../JsonMultiThreadingParameters.java | 45 ++ .../JsonObjectiveFunctionParameters.java | 43 + .../JsonOpenRaoSearchTreeParameters.java | 112 +++ ...sonRangeActionsOptimizationParameters.java | 122 +++ .../JsonRelativeMarginsParameters.java | 55 ++ ...sonRelativeMarginsParametersExtension.java | 95 --- .../JsonSecondPreventiveRaoParameters.java | 23 +- .../JsonTopoOptimizationParameters.java | 89 +++ .../raoapi/parameters/LoopFlowParameters.java | 60 ++ .../raoapi/parameters/MnecParameters.java | 44 ++ .../parameters/MultithreadingParameters.java | 74 -- .../ObjectiveFunctionParameters.java | 61 +- .../raoapi/parameters/ParametersUtil.java | 4 +- .../RangeActionsOptimizationParameters.java | 194 +---- .../raoapi/parameters/RaoParameters.java | 103 ++- ...on.java => RelativeMarginsParameters.java} | 42 +- .../TopoOptimizationParameters.java | 69 -- .../LoadFlowAndSensitivityParameters.java | 40 +- .../LoopFlowParametersConfigLoader.java | 53 -- .../MnecParametersConfigLoader.java | 49 -- .../extensions/MultithreadingParameters.java | 51 ++ .../OpenRaoSearchTreeParameters.java | 110 +++ ...enRaoSearchTreeParametersConfigLoader.java | 63 ++ ...RelativeMarginsParametersConfigLoader.java | 50 -- ...a => SearchTreeRaoLoopFlowParameters.java} | 46 +- ....java => SearchTreeRaoMnecParameters.java} | 38 +- ...rchTreeRaoObjectiveFunctionParameters.java | 50 ++ ...RaoRangeActionsOptimizationParameters.java | 244 ++++++ ...earchTreeRaoRelativeMarginsParameters.java | 58 ++ ...archTreeRaoTopoOptimizationParameters.java | 150 ++++ .../SecondPreventiveRaoParameters.java | 28 +- .../raoapi/json/JsonRaoParametersTest.java | 137 ++-- .../parameters/RaoParametersConfigTest.java | 234 +++--- .../RaoParametersConsistencyTest.java | 99 +-- .../RaoParametersYamlConfigTest.java | 259 +++--- .../test/resources/RaoParametersError_v2.json | 2 +- .../test/resources/RaoParametersSet_v2.json | 173 ++-- .../RaoParametersWithExtension_v2.json | 74 +- .../RaoParametersWithLoopFlowError_v2.json | 139 ++-- .../RaoParametersWithObjFuncTypeError_v2.json | 88 +++ ...rametersWithPrevStopCriterionError_v2.json | 139 ++-- .../RaoParametersWithWrongField_v2.json | 123 +-- .../RaoParameters_config_withExtensions.json | 331 ++++---- .../RaoParameters_config_withOLFParams.json | 289 +++---- ...rameters_config_withPartialExtensions.json | 319 ++++---- ...aoParameters_config_withoutExtensions.json | 154 +--- .../resources/RaoParameters_default_v2.json | 46 +- .../resources/RaoParameters_update_v2.json | 40 +- .../src/test/resources/RaoParameters_v2.json | 74 +- .../test/resources/config_withExtensions.yml | 82 +- .../config_withOpenLoadFlowExtension.yml | 2 +- .../config_withPartialExtensions.yml | 56 +- .../resources/config_withoutExtensions.yml | 46 +- ra-optimisation/search-tree-rao/pom.xml | 5 + .../castor/algorithm/AutomatonSimulator.java | 16 +- .../algorithm/CastorContingencyScenarios.java | 6 +- .../algorithm/CastorFullOptimization.java | 14 +- .../algorithm/CastorSecondPreventive.java | 31 +- .../PrePerimeterSensitivityAnalysis.java | 29 +- .../searchtreerao/commons/RaoLogger.java | 29 +- .../searchtreerao/commons/RaoUtil.java | 32 +- .../searchtreerao/commons/ToolProvider.java | 29 +- .../AbstractObjectiveFunctionCreator.java | 2 +- ...ivityAnalysisObjectiveFunctionCreator.java | 5 +- .../ObjectiveFunctionCreator.java | 57 +- .../LoopFlowViolationCostEvaluator.java | 7 +- .../MnecViolationCostEvaluator.java | 7 +- .../AbstractOptimizationPerimeter.java | 29 +- .../parameters/NetworkActionParameters.java | 15 +- .../commons/parameters/TreeParameters.java | 84 +- .../algorithms/IteratingLinearOptimizer.java | 9 +- .../fillers/AbstractCoreProblemFiller.java | 33 +- .../fillers/CostCoreProblemFiller.java | 8 +- .../fillers/DiscretePstTapFiller.java | 2 +- .../fillers/MarginCoreProblemFiller.java | 6 +- .../algorithms/fillers/MaxLoopFlowFiller.java | 15 +- .../fillers/MaxMinRelativeMarginFiller.java | 4 +- .../algorithms/fillers/MnecFiller.java | 15 +- .../linearproblem/LinearProblem.java | 4 +- .../linearproblem/LinearProblemBuilder.java | 39 +- .../linearproblem/OpenRaoMPSolver.java | 18 +- .../IteratingLinearOptimizerParameters.java | 109 ++- .../searchtree/algorithms/Leaf.java | 4 + .../searchtree/algorithms/SearchTree.java | 22 +- .../parameters/SearchTreeParameters.java | 132 +++- .../algorithm/AutomatonSimulatorTest.java | 8 +- .../algorithm/CastorFullOptimizationTest.java | 47 +- .../algorithm/CastorSecondPreventiveTest.java | 29 +- .../PrePerimeterSensitivityAnalysisTest.java | 51 +- .../searchtreerao/commons/RaoLoggerTest.java | 34 +- .../searchtreerao/commons/RaoUtilTest.java | 43 +- .../commons/ToolProviderTest.java | 14 +- .../ObjectiveFunctionTest.java | 48 +- .../LoopFlowViolationCostEvaluatorTest.java | 14 +- .../MnecViolationCostEvaluatorTest.java | 22 +- .../RemedialActionCostEvaluatorImplTest.java | 6 +- .../CurativeOptimizationPerimeterTest.java | 2 - .../GlobalOptimizationPerimeterTest.java | 4 +- .../PreventiveOptimizationPerimeterTest.java | 9 +- .../NetworkActionParametersTest.java | 19 +- .../parameters/TreeParametersTest.java | 87 +- .../IteratingLinearOptimizerTest.java | 16 +- .../algorithms/LinearProblemBuilderTest.java | 61 +- .../algorithms/LinearProblemTest.java | 4 +- .../ContinuousRangeActionGroupFillerTest.java | 13 +- .../fillers/CostCoreProblemFillerTest.java | 46 +- .../fillers/DiscretePstGroupFillerTest.java | 13 +- .../fillers/DiscretePstTapFillerTest.java | 13 +- .../fillers/MarginCoreProblemFillerTest.java | 52 +- .../fillers/MaxLoopFlowFillerTest.java | 83 +- .../fillers/MaxMinMarginFillerTest.java | 22 +- .../MaxMinRelativeMarginFillerTest.java | 34 +- .../algorithms/fillers/MnecFillerTest.java | 66 +- .../PowerGradientConstraintFillerTest.java | 8 +- .../fillers/RaUsageLimitsFillerTest.java | 41 +- ...mizedCnecFillerMarginDecreaseRuleTest.java | 24 +- .../linearproblem/OpenRaoMPSolverTest.java | 16 +- .../searchtree/algorithms/SearchTreeTest.java | 3 +- .../parameters/SearchTreeParametersTest.java | 39 +- .../parameters/RaoParameters_2P_v2.json | 184 ++--- .../parameters/RaoParameters_DC.json | 185 ++--- .../RaoParameters_dc_minObjective.json | 211 +++-- .../RaoParameters_oneIteration_v2.json | 184 ++--- .../parameters/RaoParameters_secure.json | 185 ++--- .../openrao/tests/steps/CommonTestData.java | 6 +- .../tests/steps/SearchTreeRaoSteps.java | 7 +- .../openrao/tests/utils/CneHelper.java | 12 +- .../powsybl/openrao/tests/utils/RaoUtils.java | 4 +- .../common/RaoParameters_default.json | 238 +++--- .../RaoParameters_maxMargin_ampere.json | 134 ++-- .../RaoParameters_maxMargin_ampere_mip.json | 134 ++-- ...ameters_maxMargin_ampere_withFallback.json | 134 ++-- .../RaoParameters_maxMargin_megawatt_ac.json | 134 ++-- .../RaoParameters_maxMargin_megawatt_dc.json | 134 ++-- ...s_maxMargin_megawatt_dc_withLoopFlows.json | 150 ++-- .../RaoParameters_posMargin_ampere.json | 142 ++-- ...ameters_posMargin_ampere_withFallback.json | 134 ++-- .../RaoParameters_posMargin_megawatt_ac.json | 134 ++-- .../RaoParameters_posMargin_megawatt_dc.json | 134 ++-- .../RaoParameters_securityAnalysis.json | 196 ++--- .../RaoParameters_simple_AC_loopflow.json | 150 ++-- .../RaoParameters_relMargin_megawatt.json | 144 ++-- .../epic10/conf_ep10us2case1.json | 144 ++-- .../epic10/conf_ep10us2case2.json | 144 ++-- .../epic10/conf_ep10us3case1.json | 144 ++-- .../epic10/conf_ep10us4case1.json | 144 ++-- ...rs_maxMargin_megawatt_ac_mnecDimin180.json | 134 ++-- ...ers_maxMargin_megawatt_ac_mnecDimin20.json | 134 ++-- ...rs_posMargin_ampere_mnecDiminMinusInf.json | 134 ++-- .../raoParametersSweIDCC_minObjective.json | 182 +++-- ...ametersSweIDCC_minObjectiveDisabled2P.json | 182 +++-- ...etersSweIDCC_minObjectiveWithGlobal2P.json | 182 +++-- .../epic13/RaoParameters_13_6_11.json | 134 ++-- .../epic13/RaoParameters_13_6_2.json | 134 ++-- ...ameters_best_preventive_by_300_secure.json | 134 ++-- .../RaoParameters_best_preventive_by_500.json | 134 ++-- .../RaoParameters_best_preventive_by_628.json | 134 ++-- .../epic13/RaoParameters_ep13us6case8.json | 134 ++-- .../epic13/RaoParameters_ep13us7case6.json | 150 ++-- ...Parameters_maxMargin_ampere_2p_global.json | 134 ++-- ...s_maxMargin_ampere_absolute_threshold.json | 134 ++-- ...axMargin_ampere_absolute_threshold_12.json | 134 ++-- .../RaoParameters_relMargin_ampere.json | 144 ++-- ...arameters_stop_curative_at_preventive.json | 134 ++-- .../epic15/RaoParameters_ep15us11-2.json | 134 ++-- .../epic15/RaoParameters_ep15us11-4.json | 134 ++-- .../epic15/RaoParameters_ep15us11-5-1.json | 182 +++-- .../epic15/RaoParameters_ep15us11-5-2.json | 182 +++-- .../epic15/RaoParameters_ep15us11-5-3-3.json | 182 +++-- .../epic15/RaoParameters_ep15us13case1.json | 134 ++-- .../epic15/RaoParameters_ep15us13case10.json | 134 ++-- .../epic15/RaoParameters_ep15us13case2.json | 134 ++-- .../epic15/RaoParameters_ep15us13case5.json | 134 ++-- .../epic15/RaoParameters_ep15us13case6.json | 134 ++-- .../epic15/RaoParameters_ep15us13case7.json | 134 ++-- .../epic15/RaoParameters_ep15us13case8.json | 134 ++-- .../epic15/RaoParameters_ep15us17case10.json | 134 ++-- .../epic15/RaoParameters_ep15us17case11.json | 134 ++-- .../epic15/RaoParameters_ep15us17case12.json | 134 ++-- .../epic15/RaoParameters_ep15us17case2.json | 182 +++-- .../epic15/RaoParameters_ep15us17case6.json | 182 +++-- .../epic15/RaoParameters_ep15us7-2.json | 12 +- .../raoParametersSweIDCC_withoutPsts.json | 182 +++-- .../epic19/RaoParameters_19_10_10&11.json | 134 ++-- .../epic19/RaoParameters_19_11_9.json | 184 ++--- .../epic19/RaoParameters_19_11_9_bis.json | 184 ++--- .../epic19/RaoParameters_dc_discrete.json | 184 ++--- ...oParameters_maxMargin_ampere_shareCra.json | 134 ++-- ...arameters_maxMargin_megawatt_shareCra.json | 134 ++-- ...rameters_maxRelMargin_ampere_shareCra.json | 144 ++-- ...ters_maxRelMargin_ampere_shareCra_mip.json | 144 ++-- ...meters_maxRelMargin_megawatt_shareCra.json | 144 ++-- ...rs_maxRelMargin_megawatt_shareCra_mip.json | 144 ++-- .../epic20/RaoParameters_20_4.json | 134 ++-- .../epic20/RaoParameters_20_6_1.json | 182 +++-- .../epic20/RaoParameters_20_6_2.json | 184 ++--- ...ameters_maxMargin_MW_DC_withLF_with2P.json | 150 ++-- ..._maxMargin_ampere_2p_if_cost_increase.json | 134 ++-- ...maxMargin_ampere_forbid_cost_increase.json | 134 ++-- ...rs_maxMargin_ampere_second_preventive.json | 134 ++-- ...meters_posMargin_ampere_ac_divergence.json | 196 ++--- ...gin_ampere_withFallback_ac_divergence.json | 196 ++--- ...re_withFallback_differentFallbackCost.json | 196 ++--- ...meters_maxMargin_absoluteMinImpact190.json | 134 ++-- ...meters_maxMargin_absoluteMinImpact195.json | 134 ++-- .../RaoParameters_maxMargin_maxDepth.json | 134 ++-- ...arameters_maxMargin_relativeMinImpact.json | 134 ++-- ...eters_maxMargin_mw_ac_lf_false_10_100.json | 150 ++-- ...meters_maxMargin_mw_ac_lf_false_5_100.json | 150 ++-- ..._maxMargin_mw_ac_lf_false_5_100_BE_NL.json | 150 ++-- ...ers_maxMargin_mw_ac_lf_false_5_100_NL.json | 150 ++-- ...n_mw_ac_lf_false_5_100_lfAugmentation.json | 150 ++-- ...ameters_maxMargin_mw_ac_lf_true_5_100.json | 150 ++-- ...ers_maxMargin_mw_dc_lf_accurate_5_100.json | 150 ++-- ...eters_maxMargin_mw_dc_lf_false_10_100.json | 150 ++-- ...meters_maxMargin_mw_dc_lf_false_5_100.json | 150 ++-- ...rs_maxMargin_mw_dc_lf_inBetween_5_100.json | 150 ++-- .../RaoParameters_case_91_12_search_tree.json | 134 ++-- .../RaoParameters_case_91_12_secure.json | 134 ++-- ...RaoParameters_case_91_12_secure_2PRAO.json | 134 ++-- .../epic91/RaoParameters_case_91_13_1.json | 134 ++-- .../epic91/RaoParameters_case_91_1_1.json | 134 ++-- .../epic91/RaoParameters_case_91_1_12.json | 134 ++-- .../epic91/RaoParameters_case_91_1_3.json | 134 ++-- .../epic91/RaoParameters_case_91_1_6.json | 134 ++-- .../epic91/RaoParameters_case_91_1_7.json | 134 ++-- .../RaoParameters_interrupt_search_tree.json | 134 ++-- ...eters_interrupt_search_tree_2_threads.json | 134 ++-- ...meters_maxMargin_mw_ac_lf_false_3_100.json | 150 ++-- ...rs_maxMargin_mw_ac_lf_false_3_100_mip.json | 150 ++-- .../epic92/RaoParameters_dc_minObjective.json | 211 +++-- ...arameters_dc_minObjective_discretePst.json | 238 +++--- ...meters_dc_minObjective_discretePst_2P.json | 238 +++--- ...oParameters_dc_minObjective_maxDepth1.json | 211 +++-- .../RaoParameters_margin_dc_minObjective.json | 211 +++-- .../RaoParameters_minCost_megawatt_dc.json | 189 +++-- ...rameters_maxMargin_ampere_highPSTcost.json | 134 ++-- 263 files changed, 14596 insertions(+), 12368 deletions(-) create mode 100644 docs/parameters/business-parameters.md create mode 100644 docs/parameters/implementation-specific-parameters.md create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonLoopFlowParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonMnecParameters.java delete mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonMultiThreadingParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonRelativeMarginsParameters.java rename ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/{ => extensions}/JsonLoadFlowAndSensitivityComputationParameters.java (68%) create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoopFlowParameters.java delete mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoopFlowParametersExtension.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMnecParameters.java delete mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMnecParametersExtension.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMultiThreadingParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonObjectiveFunctionParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonOpenRaoSearchTreeParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRangeActionsOptimizationParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRelativeMarginsParameters.java delete mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRelativeMarginsParametersExtension.java rename ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/{ => extensions}/JsonSecondPreventiveRaoParameters.java (65%) create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonTopoOptimizationParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/LoopFlowParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/MnecParameters.java delete mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/MultithreadingParameters.java rename ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/{extensions/RelativeMarginsParametersExtension.java => RelativeMarginsParameters.java} (55%) rename ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/{ => extensions}/LoadFlowAndSensitivityParameters.java (68%) delete mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoopFlowParametersConfigLoader.java delete mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MnecParametersConfigLoader.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MultithreadingParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/OpenRaoSearchTreeParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/OpenRaoSearchTreeParametersConfigLoader.java delete mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/RelativeMarginsParametersConfigLoader.java rename ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/{LoopFlowParametersExtension.java => SearchTreeRaoLoopFlowParameters.java} (59%) rename ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/{MnecParametersExtension.java => SearchTreeRaoMnecParameters.java} (56%) create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoObjectiveFunctionParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoRangeActionsOptimizationParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoRelativeMarginsParameters.java create mode 100644 ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoTopoOptimizationParameters.java rename ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/{ => extensions}/SecondPreventiveRaoParameters.java (68%) create mode 100644 ra-optimisation/rao-api/src/test/resources/RaoParametersWithObjFuncTypeError_v2.json 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.md b/docs/castor/linear-problem.md index fde4c139fb..54092e2f7b 100644 --- a/docs/castor/linear-problem.md +++ b/docs/castor/linear-problem.md @@ -65,7 +65,7 @@ $$\begin{equation} \max MM - \sum_{lra \in \mathcal{LRA}} \Delta_{lra} c^{LRA} \end{equation}$$ -with $MM$ the minimum margin, $\mathcal{LRA}$ the set of LRAs, $\Delta_{lra}$ the variation of setpoint of the LRA $lra$, and $c^{LRA}$ the penalty cost (see [pst-penalty-cost](/parameters.md#pst-penalty-cost), [hvdc-penalty-cost](/parameters.md#hvdc-penalty-cost), and [injection-ra-penalty-cost](/parameters.md#injection-ra-penalty-cost)). +with $MM$ the minimum margin, $\mathcal{LRA}$ the set of LRAs, $\Delta_{lra}$ the variation of setpoint of the LRA $lra$, and $c^{LRA}$ the penalty cost (see [pst-ra-min-impact-threshold](/parameters.md#pst-ra-min-impact-threshold), [hvdc-ra-min-impact-threshold](/parameters.md#hvdc-ra-min-impact-threshold), and [injection-ra-min-impact-threshold](/parameters.md#injection-ra-min-impact-threshold)). This way, if two solutions provide (almost) the same minimum margin, the problem will favor the one that changes the setpoints the least. 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..e2b0652110 100644 --- a/docs/parameters.md +++ b/docs/parameters.md @@ -1,547 +1,34 @@ # Parameters +```{toctree} +:hidden: +parameters/business-parameters.md +parameters/implementation-specific-parameters.md +``` + ## Introduction -The RAO parameters allow tuning the RAO: -- to choose the **business objective function** of the RAO (maximize min margin, get a positive margin, ...) -- to activate/deactivate optional business **features** -- to fine-tune the search algorithm, improve **performance** and/or **quality** of results +The RAO parameters allow tuning the RAO. + +It contains **business parameters** (see [business-parameters](/parameters/business_parameters)) which allow +to choose the business objective function of the RAO (maximize min margin, get a positive margin, ...), +to activate/deactivate optional business features, etc. + +It also contains **extensions** which are **implementation specific parameters** +(see [implementation-specific-parameters](/parameters/implementation-specific-parameters)), in particular the open +rao search tree extension. These extensions allow to fine-tune the search algorithm, improve performance and/or +quality of results. RAO parameters can be constructed using: - The Java API (see [source code](https://github.com/powsybl/powsybl-open-rao/blob/main/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RaoParameters.java)) - A JSON file (see [example](#examples)) - A PowSyBl configuration file (see [example](#examples)) -## Global parameters - -These parameters should be always set in the RAO parameters file or object. - -### Objective function parameters - -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" -- **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 - (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. - -#### preventive-stop-criterion -- **Expected value**: one of the following: - - "MIN_OBJECTIVE" - - "SECURE" -- **Default value**: "SECURE" -- **Usage**: Stop criterion of the preventive RAO search-tree. - - **MIN_OBJECTIVE**: the search-tree will maximize the minimum margin until it converges to a - maximum value, or until another stop criterion has been reached (e.g. [max-preventive-search-tree-depth](#max-preventive-search-tree-depth)). - - **SECURE**: the search-tree will stop as soon as it finds a solution where the minimum margin is positive. - *Note: if the best possible minimum margin is negative, both stop criterion will return the same solution.* - -#### curative-min-obj-improvement -- **Expected value**: numeric value, where the unit is that of the objective function -- **Default value**: 0 -- **Usage**: used as a minimum improvement of the preventive RAO objective value for the curative RAO stop criterion, - when it is set to PREVENTIVE_OBJECTIVE or PREVENTIVE_OBJECTIVE_AND_SECURE. - -#### enforce-curative-security -- **Expected value**: true/false -- **Default value**: false -- **Usage**: if this parameter is set to true, OpenRAO will continue optimizing curative states even if preventive state - is unsecure. - If this parameter is set to false, OpenRAO will stop after preventive if preventive state is unsecure and won't try to - improve curative states. - - *Note: Only applied when ["preventive-stop-criterion"](#preventive-stop-criterion) is set to SECURE. In this case, if preventive was unsecure, -second preventive won't be run, even if curative cost is higher, in order to save computation time* - -### Range actions optimisation parameters -These parameters (range-actions-optimization) tune the [linear optimiser](/castor/linear-problem.md) used to optimise range actions. -(See [Modelling CNECs and range actions](/castor/linear-problem/core-problem-filler.md)) - -#### max-mip-iterations -- **Expected value**: integer -- **Default value**: 10 -- **Usage**: defines the maximum number of iterations to be executed by the iterating linear optimiser of the RAO. - One iteration of the iterating linear optimiser includes: the resolution of one linear problem (MIP), an update of the - network with the optimal PST taps found in the linear problem, a security analysis of the updated network and an - assessment of the objective function based on the results of the security analysis. - The linear problem relies on sensitivity coefficients to estimate the flows on each CNEC, and those estimations might - not be perfect when several PSTs taps are significantly changed. When the linear optimisation problem makes a (n+1)th - iteration, it refines its solution with new sensitivity coefficients, which better describe the neighbourhood of the - solution found in iteration (n). - Note that the linear optimisation problems usually "converge" with very few iterations (1 to 4 iterations). - -#### pst-model -- **Expected value**: one of the following: - - "CONTINUOUS" - - "APPROXIMATED_INTEGERS" -- **Default value**: "CONTINUOUS" -- **Usage**: the method to model PSTs in the linear problem: - - **CONTINUOUS**: PSTs are represented by their angle set-points; the set-points are continuous optimisation variables - and OpenRAO rounds the result to the best tap (around the optimal set-point) after optimisation. This approach is not - very precise but does not create integer optimisation variables; thus it is quicker to solve, especially with - open-source solvers. - - **APPROXIMATED_INTEGERS**: a PST is represented by its tap positions, and these tap positions are considered - proportional to the PST's angle set-point (hence the "approximated" adjective). Thus, these tap positions can be - used as a multiplier of the sensitivity values when representing the impact of the PST on CNECs. This approach is - more precise and thus has the advantage of better respecting Loop-Flow and MNEC constraints. But it introduces - integer variables (tap positions) and can be harder to solve. - See [Using integer variables for PST taps](/castor/linear-problem/discrete-pst-tap-filler.md). - -#### pst-penalty-cost -- **Expected value**: numeric value, unit: unit of the objective function / ° (per degree) -- **Default value**: 0.01 -- **Usage**: the pst-penalty-cost represents the cost of changing the PST set-points, it is used within the linear - optimisation problem of the RAO, where, for each PST, the following term is added to the objective function: - *pst-penalty-cost $$\times |\alpha - \alpha_{0}|$$*, where *$$\alpha$$* is the optimized angle of the PST, and - *$$\alpha_{0}$$* the angle in its initial position. - If several solutions are equivalent (e.g. with the same min margin), a strictly positive pst penalty cost will favour - the ones with the PST taps the closest to the initial situation. - -#### pst-sensitivity-threshold -- **Expected value**: numeric value, unit: MW / ° (per degree) -- **Default value**: 0.0 -- **Usage**: the pst sensitivity coefficients which are below the pst-sensitivity-threshold will be considered equal to - zero by the linear optimisation problem. Filtering some small sensitivity coefficients have the two following perks - for the RAO: - - it decreases the complexity of the optimisation problem by reducing significantly the number of non-zero elements - - it can avoid changes of PST set-points when they only allow to earn a few MW on the margins of some CNECs. - -#### hvdc-penalty-cost -- **Expected value**: numeric value, unit: unit of the objective function / MW -- **Default value**: 0.001 -- **Usage**: the hvdc-penalty-cost represents the cost of changing the HVDC set-points, it is used within the linear - optimisation problem of the RAO, where, for each HVDC, the following term is added to the objective function: - *hvdc-penalty-cost x |P - P0|*, where *P* is the optimized target power of the HVDC, and *P0* the initial target - power. - If several solutions are equivalent (e.g. with the same min margin), a strictly positive hvdc penalty cost will favour - the ones with the HVDC set-points the closest to the initial situation. - -#### hvdc-sensitivity-threshold -- **Expected value**: numeric value, unit: MW / MW -- **Default value**: 0.0 -- **Usage**: the hvdc sensitivity coefficients which are below the hvdc-sensitivity-threshold will be considered equal - to zero by the linear optimisation problem. Filtering some of the small sensitivity coefficients have the two - following perks regarding the RAO: - - it decreases the complexity of the optimisation problem by reducing significantly the number of non-null elements - - it can avoid changes of HVDC set-points when they only allow to earn a few MW on the margins of some CNECs. - -#### injection-ra-penalty-cost -- **Expected value**: numeric value, unit: unit of the objective function / MW -- **Default value**: 0.001 -- **Usage**: the injection-ra-penalty-cost represents the cost of changing the injection set-points, it is used within the linear - optimisation problem of the RAO, in the same way as the two types of RangeAction above. - -#### injection-ra-sensitivity-threshold -- **Expected value**: numeric value, unit: MW / MW -- **Default value**: 0.0 -- **Usage**: the injection sensitivity coefficients which are below the injection-ra-sensitivity-threshold will be - considered equal to zero by the linear optimisation problem. - The perks are the same as the two parameters above. - -#### ra-range-shrinking -- **Expected value**: one of the following: - - "DISABLED" - - "ENABLED" - - "ENABLED_IN_FIRST_PRAO_AND_CRAO" -- **Default value**: "DISABLED" -- **Usage**: CASTOR makes the approximation that range action sensitivities on CNECs are linear. However, in - active+reactive computations, this approximation may be incorrect. The linear problem can thus find a worse solution - than in its previous iteration. - - **DISABLED**: if this situation occurs, the linear problem stops and returns the previous solution, - see this schema : [Linear Remedial Actions Optimisation](/castor/linear-problem.md#algorithm). - - **ENABLED**: this introduces two new behaviors to the iterating linear optimiser: - 1. If the linear problem finds a solution worse than in its previous iteration, it continues iterating. - When stop condition is met ([max-mip-iterations](#max-mip-iterations) reached, or two successive iterations have - the same optimal RA set-points), then the problem returns the best solution it has found. - 2. At each new iteration, the range action's allowed range shrinks according to equations [described here](/castor/linear-problem/core-problem-filler.md#shrinking-the-allowed-range). - These equations have been chosen to force the linear problem convergence while allowing the RA to go - back to its initial solution if needed. - - **ENABLED_IN_FIRST_PRAO_AND_CRAO**: - same as **ENABLED** but only for first preventive and curative RAO. This parameter value has been introduced because - sensitivity computations in the second preventive RAO can be slow (due to the larger optimization perimeter), thus - computation time loss may outweigh the gains of RA range shrinking. - -#### linear-optimization-solver -These are parameters that tune the solver used to solve the MIP problem. - -##### solver -- **Expected value**: one of the following: - - "CBC" - - "SCIP" - - "XPRESS" -- **Default value**: "CBC" -- **Usage**: the solver called for optimising the linear problem. - Note that theoretically all solvers supported by OR-Tools can be called, but the OpenRAO interface only allows CBC - (open-source), SCIP (commercial) and XPRESS (commercial) for the moment. - If needed, other solvers can be easily added. - -##### relative-mip-gap -- **Expected value**: double -- **Default value**: 0.0001 -- **Usage**: the relative MILP (Mixed-Integer-Linear-Programming) target gap. - During branch-and-bound algorithm (only in MILP case), the solver will stop branching when this relative gap is - reached between the best found objective function and the estimated objective function best bound. - -##### solver-specific-parameters - -- **Expected value**: String, space-separated parameters (keys and values) understandable by OR-Tools (for example "key1 - value1 key2 value2") -- **Default value**: empty -- **Usage**: this can be used to set solver-specific parameters, when the OR-Tools API and its generic parameters are - not enough. - -### Network actions optimisation parameters -These parameters (topological-actions-optimization) tune the [search-tree algorithm](/castor.md#algorithm) -when searching for the best network actions. - -#### max-preventive-search-tree-depth -- **Expected value**: integer -- **Default value**: 2^32 -1 (max integer value) -- **Usage**: maximum search-tree depth for preventive optimization. - Applies to the preventive RAO. - -#### max-auto-search-tree-depth -- **Expected value**: integer -- **Default value**: 2^32 -1 (max integer value) -- **Usage**: maximum search-tree depth for the optimization of available auto network actions. - -#### max-curative-search-tree-depth -- **Expected value**: integer -- **Default value**: 2^32 -1 (max integer value) -- **Usage**: maximum search-tree depth for curative optimization. - Applies separately to each perimeter-specific curative RAO. - -#### predefined-combinations -- **Expected value**: an array containing sets of network action IDs -- **Default value**: empty -- **Usage**: this parameter contains hints for the search-tree RAO, consisting of combinations of multiple network - actions that the user considers interesting to test together during the RAO. - These combinations will be tested in the first search depth of the search-tree - -![Search-tree-with-combinations](/_static/img/Search-tree-with-combinations.png){.forced-white-background} - -#### absolute-minimum-impact-threshold -- **Expected value**: numeric value, where the unit is that of the objective function -- **Default value**: 0.0 -- **Usage**: if a topological action improves the objective function by x, and x is smaller than this parameter, the - effectiveness of this topological action will be considered inconsequential, and it will not be retained by the - search-tree. - The absolute-minimum-impact-threshold can therefore fill two purposes: - - do not retain in the optimal solution of the RAO remedial actions with a negligible impact - - speed up the computation by avoiding the few final depths which only slightly improve the solution. - -#### relative-minimum-impact-threshold -- **Expected value**: numeric value, percentage defined between 0 and 1 (1 = 100%) -- **Default value**: 0.0 -- **Usage**: behaves like [absolute-minimum-impact-threshold](#absolute-minimum-impact-threshold), but the - threshold here is defined as a coefficient of the objective function value of the previous depth. In depth (n+1), if a - topological action improves the objective function by x, with x < solution(depth(n)) x relative-minimum-impact-threshold, - it will not be retained by the search-tree. - -#### skip-actions-far-from-most-limiting-element -- **Expected value**: true/false -- **Default value**: false -- **Usage**: whether the RAO should skip evaluating topological actions that are geographically far from the most - limiting element at the time of the evaluation. Proximity is defined by the number of country boundaries separating - the element from the topological action (see [max-number-of-boundaries-for-skipping-actions](#max-number-of-boundaries-for-skipping-actions)). - Setting this to true allows you to speed up the search tree RAO, while keeping a good precision, since topological - actions that are far from the most limiting element have almost no impact on the minimum margin. - -#### max-number-of-boundaries-for-skipping-actions -- **Expected value**: integer (>= 0) -- **Default value**: 2 -- **Usage**: the maximum number of country boundaries between the most limiting element and the topological actions that - shall be evaluated. The most limiting element is defined as the element with the minimum margin at **the time of this - evaluation**. - If the most limiting element has nodes in two countries, the smallest distance is considered. - If the value is set to zero, only topological actions in the same country as the most limiting element will be - evaluated in the search-tree. - If the value is set to 1, topological actions from direct neighbors will also be considered, etc. - *Note that the topology of the network is automatically deduced from the network file: countries sharing tie lines are - considered direct neighbors; dangling lines are not considered linked (ie BE and DE are not considered neighbors, even - though they share the Alegro line)* - -### Second preventive RAO parameters -These parameters (second-preventive-rao) tune the behaviour of the [second preventive RAO](/castor/rao-steps.md#second-preventive-rao). - -#### execution-condition -- **Expected value**: one of the following: - - "DISABLED" - - "COST_INCREASE" - - "POSSIBLE_CURATIVE_IMPROVEMENT" -- **Default value**: "DISABLED" -- **Usage**: configures whether a 2nd preventive RAO should be run after the curative RAO. - *Note: if there are automatons, and if a 2nd preventive RAO is run, then a 2nd automaton RAO is also run* - - **DISABLED**: 2nd preventive RAO is not run - - **COST_INCREASE**: a 2nd preventive RAO is run if the RAO's overall cost has increased after optimisation compared to - before optimisation; for example due to a curative CNEC margin decreased in 1st preventive RAO and not reverted - during curative RAO - - **POSSIBLE_CURATIVE_IMPROVEMENT**: a 2nd preventive RAO is run only if it is possible to improve a curative perimeter, - i.e. if the curative RAO stop criterion on at least one contingency is not reached. - This depends on the value of parameter [preventive-stop-criterion](#preventive-stop-criterion): - - **SECURE**: 2nd preventive RAO is run if one curative perimeter is not secure after optimisation - - **PREVENTIVE_OBJECTIVE**: 2nd preventive RAO is run if one curative perimeter reached an objective function value - after optimisation that is worse than the preventive perimeter's (decreased by [curative-min-obj-improvement](#curative-min-obj-improvement)) - - **PREVENTIVE_OBJECTIVE_AND_SECURE**: 2nd preventive RAO is run if one of the two conditions above is satisfied - - **MIN_OBJECTIVE**: 2nd preventive RAO is always run, trying to improve the minimum margin even more - -#### re-optimize-curative-range-actions -- **Expected value**: true/false -- **Default value**: false -- **Usage**: - - **false**: the 2nd preventive RAO will optimize only the preventive remedial actions, keeping **all** optimal - curative remedial actions selected during the curative RAO. - - **true**: the 2nd preventive RAO will optimize preventive remedial actions **and** curative range actions, keeping - only the optimal curative **topological** actions computed in the curative RAO. - -#### hint-from-first-preventive-rao -- **Expected value**: true/false -- **Default value**: false -- **Usage**: if set to true, the RAO will use the optimal combination of network actions found in the first preventive - RAO, as a predefined combination ("hint") to test at the first search depth of the second preventive RAO. This way, - if this combination is optimal in the 2nd preventive RAO as well, getting to the optimal solution will be much faster. -### CNECs that should not be optimised -These parameters (not-optimized-cnecs) allow the activation of region-specific features, that de-activate the -optimisation of specific CNECs in specific conditions. - -#### do-not-optimize-curative-cnecs-for-tsos-without-cras -- **Expected value**: true/false -- **Default value**: false -- **Usage**: if this parameter is set to true, the RAO will detect TSOs not sharing any curative remedial actions (in - the CRAC). During the curative RAO, these TSOs' CNECs will not be taken into account in the minimum margin objective - function, unless the applied curative remedial actions decrease their margins (compared to their margins before - applying any curative action). - If it is set to false, all CNECs are treated equally in the curative RAO. - This parameter has no effect on the preventive RAO. - This parameter should be set to true for CORE CC. - -### Load-flow and sensitivity computation parameters -These parameters (load-flow-and-sensitivity-computation) configure the load-flow and sensitivity computations providers -from inside the RAO. - -#### load-flow-provider -- **Expected value**: String, should refer to a [PowSyBl load flow provider implementation](inv:powsyblcore:std:doc#simulation/loadflow/index) -- **Default value**: "OpenLoadFlow" (see [OpenLoadFlow](inv:powsyblopenloadflow:std:doc#index)) -- **Usage**: the name of the load flow provider to use when a load flow is needed - -#### sensitivity-provider -- **Expected value**: String, should refer to a [PowSyBl sensitivity provider implementation](inv:powsyblcore:std:doc#simulation/sensitivity/index) -- **Default value**: "OpenLoadFlow" (see [OpenLoadFlow](inv:powsyblopenloadflow:std:doc#index)) -- **Usage**: the name of the sensitivity provider to use in the RAO - -#### sensitivity-failure-over-cost -- **Expected value**: numeric value, where the unit is that of the objective function -- **Default value**: 10000.0 -- **Usage**: if the systematic sensitivity analysis fails (= diverged) due to a combination of remedial actions, its -objective function assessment will be penalized by this value. In other words, the criterion for this combination of RA -will be (e.g.) : minMargin - sensitivity-failure-over-cost. -If this parameter is strictly positive, the RAO will discriminate the combinations of RA for which the systematic -analysis didn't converge. The RAO might therefore put aside the solution with the best objective-function if it has -lead to a sensitivity failure, and instead propose a solution whose objective-function is worse, but whose associated -network is converging for all contingency scenarios. - -#### sensitivity-parameters -- **Expected value**: SensitivityComputationParameters ([PowSyBl](inv:powsyblcore:std:doc#simulation/sensitivity/configuration) configuration) -- **Default value**: PowSyBl's default value (it is generally a bad idea to keep the default value for this parameter) -- **Usage**: sensitivity-parameters is the configuration of the PowSyBl sensitivity engine, which is used within OpenRAO. -The underlying "load-flow-parameters" is also used whenever an explicit pure load-flow computation is needed. - -### Multi-threading parameters -These parameters (multi-threading) allow you to run a RAO making the most out of your computation resources. - -#### contingency-scenarios-in-parallel -- **Expected value**: integer -- **Default value**: 1 -- **Usage**: number of contingency scenarios (auto + curative instants) to optimise in parallel. - This parameter should therefore not exceed the number of cores of the computer on which the computation is made. - *Note that the more contingencies are optimised in parallel, the more RAM is required by the RAO, and that the performance - of the RAO might significantly decrease on a machine with limited memory resources.* - -#### preventive-leaves-in-parallel -- **Expected value**: integer -- **Default value**: 1 -- **Usage**: this parameter sets the number of combination of remedial actions that the search-tree will investigate in - parallel during the preventive RAO. - It should therefore not exceed the number of cores of the computer on which the computation is made. - *Note that the more leaves are optimised in parallel, the more RAM is required by the RAO, and that the performance - of the RAO might significantly decrease on a machine with limited memory resources.* - -#### auto-leaves-in-parallel -- **Expected value**: integer -- **Default value**: 1 -- **Usage**: this parameter sets the number of combination of remedial actions that the search-tree will investigate in - parallel during the automaton RAO. - It is separated from [preventive-leaves-in-parallel](#preventive-leaves-in-parallel) and [curative-leaves-in-parallel](#curative-leaves-in-parallel) - because during the curative RAO we also have the option to parallelize the contingency scenarios, so a compromise should be found. It is generally - best to set this parameter to 1 and to maximize [contingency-scenarios-in-parallel](#contingency-scenarios-in-parallel). Besides, there are generally fewer available auto remedial action than curative remedial actions. - -#### curative-leaves-in-parallel -- **Expected value**: integer -- **Default value**: 1 -- **Usage**: this parameter sets the number of combination of remedial actions that the search-tree will investigate in - parallel during the curative RAO. - It is separated from [preventive-leaves-in-parallel](#preventive-leaves-in-parallel) because during the curative RAO - we also have the option to parallelize the contingency scenarios, so a compromise should be found. It is generally - best to set this parameter to 1 and to maximize [contingency-scenarios-in-parallel](#contingency-scenarios-in-parallel). - -## Extensions -The following extensions can be added to RaoParameters when needed, in order to activate specific RAO features. - -### Loop-flow extension -Adding a LoopFlowParameters extension to RaoParameters will activate [loop-flow constraints](/castor/special-features/loop-flows.md). -(The RAO will monitor the loop-flows on CNECs that have a LoopFlowThreshold extension.) -The following parameters tune these constraints. -See also: [Modelling loop-flows and their virtual cost](/castor/linear-problem/max-loop-flow-filler.md) - -#### acceptable-increase -- **Expected value**: numeric values, in MEGAWATT unit -- **Default value**: 0.0 MW -- **Usage**: the increase of the initial loop-flow that is allowed by the optimisation. That is to say, the optimisation - bounds the loop-flow on CNECs by: - *LFcnec ≤ max(MaxLFcnec , InitLFcnec + acceptableAugmentation)* - With *LFcnec* the loop-flow on the CNEC after optimisation, *MaxLFcnec* is the CNEC loop-flow threshold, *InitLFcnec* - the initial loop-flow on the cnec, and *acceptableAugmentation* the so-called "loop-flow-acceptable-augmentation" - coefficient. - If this constraint cannot be respected and the loop-flow exceeds the aforementioned threshold, the objective function - associated to this situation will be penalized (see also [violation-cost](#violation-cost)) - -#### ptdf-approximation -- **Expected value**: one of the following: - - "FIXED_PTDF" - - "UPDATE_PTDF_WITH_TOPO" - - "UPDATE_PTDF_WITH_TOPO_AND_PST" -- **Default value**: "FIXED_PTDF" -- **Usage**: defines the frequency at which the PTDFs will be updated for the loop-flow computation. - This parameter enables to set the desired trade-off between the accuracy of the loop-flow computation, and the - computation time of the RAO. - - **FIXED_PTDF**: the PTDFs are computed only once at the beginning of the RAO. - - **UPDATE_PTDF_WITH_TOPO**: the PTDFs are re-computed for each new combination of topological actions (i.e. - for each new node of the search-tree). - - **UPDATE_PTDF_WITH_TOPO_AND_PST**: the PTDFs are re-computed for each new combination of topological action and for - each new combination of PST taps (i.e. for each iteration of the linear optimisation). - *Note that this option is only relevant in AC-loadflow mode, as the UPDATE_PTDF_WITH_TOPO already maximizes accuracy in DC.* - -#### constraint-adjustment-coefficient -- **Expected value**: numeric values, in MEGAWATT unit -- **Default value**: 0.0 MW -- **Usage**: this parameter acts as a margin which tightens, in the linear optimisation problem of RAO, the bounds of the - loop-flow constraints. It conceptually behaves as the coefficient *cAdjustment* from the constraint below: - *abs(LoopFlow(cnec)) <= LoopFlowThreshold - cAdjustment* - This parameter is a safety margin that can absorb some approximations made in the linear - optimisation problem of the RAO (non-integer PSTs taps, flows approximated by sensitivity coefficients, etc.), and - therefore increase the probability that the loop-flow constraints which are respected in the linear optimisation - problem, remain respected once the loop-flows are re-computed without the linear approximations. - -#### violation-cost -- **Expected value**: numeric values, unit = unit of the objective function per MEGAWATT -- **Default value**: 10.0 -- **Usage**: this parameter is the cost of each excess of loop-flow. That is to say, if the loop-flows on one or several - CNECs exceed the loop-flow threshold, a penalty will be added in the objective function of the RAO equal to: - *violation-cost x sum{cnec} excess-loop-flow(cnec)* - -#### countries -- **Expected value**: array of country codes "XX" -- **Default value**: all countries encountered -- **Usage**: list of countries for which loop-flows should be limited accordingly to the specified constraints. If not - present, all countries encountered in the input files will be considered. Note that a cross-border line will have its - loop-flows monitored if at least one of its two sides is in a country from this list. - Example of this parameter : [ "BE", "NL" ] if you want to monitor loop-flows in and out of Belgium and the - Netherlands. - -### MNEC extension -Adding a MnecParameters extension to RaoParameters will activate [MNEC constraints](/castor/linear-problem/mnec-filler.md). -(The RAO will only monitor CNECs that are only ["monitored"](/input-data/crac/json.md#cnecs)). -The following parameters tune these constraints. -See also: [Modelling MNECs and their virtual cost](/castor/linear-problem/mnec-filler.md) - -#### acceptable-margin-decrease -- **Expected value**: numeric values, in MEGAWATT unit -- **Default value**: 50 MW (required by CORE CC methodology) -- **Usage**: the decrease of the initial margin that is allowed by the optimisation on MNECs. - In other words, it defines the bounds for the margins on the MNECs by - *Mcnec ≥ max(0, m0cnec − acceptableDiminution)* - With *Mcnec* the margin on the cnec after optimisation, *m0cnec* the initial margin on the cnec, and - *acceptableDiminution* the so-called "acceptable-margin-decrease" coefficient. - For the CORE CC calculation, the ACER methodology fixes this coefficient at 50 MW. - For CSE CC calculation, setting this parameter to -99999 allows the MNEC constraints to consider - the thresholds in the CRAC only. - -#### violation-cost -- **Expected value**: numeric values, no unit (it applies as a multiplier for the constraint violation inside the - objective function) -- **Default value**: 10.0 (same as [loop-flow violation cost](#violation-cost)) -- **Usage**: the penalty cost associated to the violation of a MNEC constraint. - In order to avoid optimisation infeasibility, the MNEC constraints are soft: they can be violated. These violations - are penalized by a significant cost, in order to guide the optimiser towards a solution where - if possible - all - MNECs' constraints are respected. The penalty injected in the objective function is equal to the violation (difference - between actual margin and least acceptable margin) multiplied by this parameter. - -#### constraint-adjustment-coefficient -- **Expected value**: numeric values, in MEGAWATT unit -- **Default value**: 0.0 -- **Usage**: this coefficient is here to mitigate the approximation made by the linear optimisation (approximation = use - of sensitivities to linearize the flows, rounding of the PST taps). - *Mcnec ≥ max(0 , m0cnec - acceptableDiminution) + constraintAdjustment* - With *constraintAdjustment* the so-called "constraint-adjustment-coefficient". - It tightens the MNEC constraint, in order to take some margin for that constraint to stay respected once the - approximations are removed (i.e. taps have been rounded and real flow calculated) - -### Relative margins extension -Adding a RelativeMarginsParameters extension is mandatory when [objective function is relative](#type). -See also: [Modelling the maximum minimum relative margin objective function](/castor/linear-problem/max-min-relative-margin-filler.md) - -#### ptdf-boundaries -- **Expected value**: array of zone-to-zone PTDF computation definition, expressed as an equation. -Zones are defined by their 2-character code or their 16-character EICode, inside **{ }** characters. -Zones are seperated by + or -. - All combinations are allowed: country codes, EIC, a mix. -- **Default value**: empty array -- **Usage**: contains the boundaries on which the PTDF absolute sums should be computed (and added to the denominator of - the relative RAM). - For example, in the SWE case, it should be equal to [ "{FR}-{ES}", "{ES}-{PT}" ]. - For CORE, we should use all the CORE region boundaries (all countries seperated by a - sign) plus Alegro's special - equation: "{BE}-{22Y201903144---9}-{DE}+{22Y201903145---4}" - -#### ptdf-approximation -- **Expected value**: one of the following: - - "FIXED_PTDF" - - "UPDATE_PTDF_WITH_TOPO" - - "UPDATE_PTDF_WITH_TOPO_AND_PST" -- **Default value**: "FIXED_PTDF" -- **Usage**: defines the frequency at which the PTDFs will be updated for the relative margins computation. - This parameter enables to set the desired trade-off between the accuracy of the relative margins computation, and the - computation time of the RAO. - - **FIXED_PTDF**: the PTDFs are computed only once at the beginning of the RAO. - - **UPDATE_PTDF_WITH_TOPO**: the PTDFs are re-computed for each new combination of topological actions (i.e. - for each new node of the search-tree). - - **UPDATE_PTDF_WITH_TOPO_AND_PST**: the PTDFs are re-computed for each new combination of topological action and for - each new combination of PST taps (i.e. for each iteration of the linear optimisation). - *Note that this option is only relevant in AC-loadflow mode, as the UPDATE_PTDF_WITH_TOPO already maximizes accuracy in DC.* +## Examples -#### ptdf-sum-lower-bound -- **Expected value**: numeric value, no unit (homogeneous to PTDFs) -- **Default value**: 0.01 -- **Usage**: PTDF absolute sums are used as a denominator in the objective function. In order to prevent the objective - function from diverging to infinity (resulting in unbounded problems), the denominator should be prevented from - getting close to zero. This parameter acts as a lower bound to the denominator. +Examples of rao parameters with business and implementation specific parameters -## Examples > ⚠️ **NOTE** > The following examples in json and yaml are not equivalent @@ -549,101 +36,107 @@ Zones are seperated by + or -. :::{group-tab} JSON ~~~json { - "version" : "2.4", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", + "type" : "SECURE_FLOW", + "unit" : "A", "enforce-curative-security" : true }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 0.0, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 0.0, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 0.0, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : "THREADS 10 MAXTIME 3000" - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2, - "max-auto-search-tree-depth" : 1, - "max-curative-search-tree-depth" : 2, - "predefined-combinations" : [ "na1 + na2", "na4 + na5 + na6"], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 4, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : true + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-over-cost" : 0.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "DC_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : true, - "noGeneratorReactiveLimits" : false, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ "TR", "BE", "SI", "CH", "AL", "ES", "SK", "BA", "RO", "PT", "DE", "AT", "FR", "CZ", "ME", "NL", "PL", "GR", "IT", "UA", "HU", "BG", "MK", "HR", "RS" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "plausibleActivePowerLimit" : 10000.0, - "minPlausibleTargetVoltage" : 0.5, - "maxPlausibleTargetVoltage" : 1.5, - "maxNewtonRaphsonIterations" : 100, - "newtonRaphsonConvEpsPerEq" : 1.0E-3, - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "throwsExceptionInCaseOfSlackDistributionFailure" : false, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "addRatioToLinesWithDifferentNominalVoltageAtBothEnds" : true, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "reactiveRangeCheckMode" : "MAX" + "extensions" : { + "open-rao-search-tree-parameters": { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 0.0, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 0.0, + "injection-ra-sensitivity-threshold" : 0.0, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : "THREADS 10 MAXTIME 3000" + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2, + "max-auto-search-tree-depth" : 1, + "max-curative-search-tree-depth" : 2, + "predefined-combinations" : [ "na1 + na2", "na4 + na5 + na6"], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "multi-threading" : { + "available-cpus" : 4 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : true + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-over-cost" : 0.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "DC_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : true, + "noGeneratorReactiveLimits" : false, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : false, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ "TR", "BE", "SI", "CH", "AL", "ES", "SK", "BA", "RO", "PT", "DE", "AT", "FR", "CZ", "ME", "NL", "PL", "GR", "IT", "UA", "HU", "BG", "MK", "HR", "RS" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "plausibleActivePowerLimit" : 10000.0, + "minPlausibleTargetVoltage" : 0.5, + "maxPlausibleTargetVoltage" : 1.5, + "maxNewtonRaphsonIterations" : 100, + "newtonRaphsonConvEpsPerEq" : 1.0E-3, + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "throwsExceptionInCaseOfSlackDistributionFailure" : false, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "addRatioToLinesWithDifferentNominalVoltageAtBothEnds" : true, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "reactiveRangeCheckMode" : "MAX" + } + } } } } - } - }, - "extensions" : { + }, "loop-flow-parameters" : { "acceptable-increase" : 10.0, "ptdf-approximation" : "FIXED_PTDF", @@ -669,19 +162,25 @@ 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 - preventive-stop-criterion: SECURE + type: SECURE_FLOW + unit: AMPERE rao-range-actions-optimization: + pst-ra-min-impact-threshold: 0.01 + +search-tree-range-actions-optimization: max-mip-iterations: 5 - pst-penalty-cost: 0.01 pst-sensitivity-threshold: 0.01 pst-model: APPROXIMATED_INTEGERS -rao-linear-optimization-solver: +search-tree-linear-optimization-solver: solver: CBC rao-topological-actions-optimization: + relative-minimum-impact-threshold: 0.0 + absolute-minimum-impact-threshold: 2.0 + +search-tree-topological-actions-optimization: max-preventive-search-tree-depth: 3 max-auto-search-tree-depth: 2 max-curative-search-tree-depth: 3 @@ -689,12 +188,10 @@ rao-topological-actions-optimization: relative-minimum-impact-threshold: 0.0 absolute-minimum-impact-threshold: 2.0 -rao-multi-threading: - contingency-scenarios-in-parallel: 4 - preventive-leaves-in-parallel: 4 - curative-leaves-in-parallel: 1 +search-tree-multi-threading: + available-cpus: 4 -rao-second-preventive-rao: +search-tree-second-preventive-rao: execution-condition: POSSIBLE_CURATIVE_IMPROVEMENT re-optimize-curative-range-actions: true hint-from-first-preventive-rao: true @@ -702,7 +199,7 @@ rao-second-preventive-rao: rao-not-optimized-cnecs: do-not-optimize-curative-cnecs-for-tsos-without-cras: false -rao-load-flow-and-sensitivity-computation: +search-tree-load-flow-and-sensitivity-computation: load-flow-provider: OpenLoadFlow sensitivity-provider: OpenLoadFlow diff --git a/docs/parameters/business-parameters.md b/docs/parameters/business-parameters.md new file mode 100644 index 0000000000..add12755a9 --- /dev/null +++ b/docs/parameters/business-parameters.md @@ -0,0 +1,230 @@ +# Business parameters + +## Rao parameters + +RAO parameters to tune the RAO (not implementation specific). + +### Objective function parameters + +These parameters (objective-function) configure the remedial action optimisation's objective function. + +#### type +- **Expected value**: one of the following: + - "SECURE_FLOW" + - "MAX_MIN_MARGIN" + - "MAX_MIN_RELATIVE_MARGIN" +- **Default value**: "SECURE_FLOW" +- **Usage**: this parameter sets the objective function of the RAO. For now, the existing objective function are: + - **SECURE_FLOW**: The search-tree will stop as soon as it finds a solution where the minimum margin is positive. + - **MAX_MIN_MARGIN**: the search-tree will maximize the minimum margin until it converges to a + maximum value, or until another stop criterion has been reached (e.g. [max-preventive-search-tree-depth](#max-preventive-search-tree-depth)). + - **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. + +#### 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)). + +#### enforce-curative-security +- **Expected value**: true/false +- **Default value**: false +- **Usage**: if this parameter is set to true, OpenRAO will continue optimizing curative states even if preventive state + is unsecure. + If this parameter is set to false, OpenRAO will stop after preventive if preventive state is unsecure and won't try to + improve curative states. + + *Note: Only applied when ["type"](#type) is set to SECURE_FLOW. In this case, if preventive was unsecure, +second preventive won't be run, even if curative cost is higher, in order to save computation time* + +### Range actions optimisation parameters +These parameters (range-actions-optimization) tune the [linear optimiser](/castor/linear-problem.md) used to optimise range actions. +(See [Modelling CNECs and range actions](/castor/linear-problem/core-problem-filler.md)) + +#### pst-ra-min-impact-threshold +- **Expected value**: numeric value, unit: unit of the objective function / ° (per degree) +- **Default value**: 0.01 +- **Usage**: the pst-ra-min-impact-threshold represents the cost of changing the PST set-points, it is used within the linear + optimisation problem of the RAO, where, for each PST, the following term is added to the objective function: + $pst\text{-}ra\text{-}min\text{-}impact\text{-}threshold \times |\alpha - \alpha_{0}|$, where $\alpha$ is the optimized angle of the PST, and + $\alpha_{0}$ the angle in its initial position. + If several solutions are equivalent (e.g. with the same min margin), a strictly positive pst-ra-min-impact-threshold will favour + the ones with the PST taps the closest to the initial situation. + +#### hvdc-ra-min-impact-threshold +- **Expected value**: numeric value, unit: unit of the objective function / MW +- **Default value**: 0.001 +- **Usage**: the hvdc-ra-min-impact-threshold represents the cost of changing the HVDC set-points, it is used within the linear + optimisation problem of the RAO, where, for each HVDC, the following term is added to the objective function: + $hvdc\text{-}ra\text{-}min\text{-}impact\text{-}threshold \times |P - P_{0}|$, where $P$ is the optimized target power of the HVDC, and $P_{0}$ the initial target + power. + If several solutions are equivalent (e.g. with the same min margin), a strictly positive hvdc-ra-min-impact-threshold will favour + the ones with the HVDC set-points the closest to the initial situation. + +#### injection-ra-min-impact-threshold +- **Expected value**: numeric value, unit: unit of the objective function / MW +- **Default value**: 0.001 +- **Usage**: the injection-ra-min-impact-threshold represents the cost of changing the injection set-points, it is used within the linear + optimisation problem of the RAO, in the same way as the two types of RangeAction above. + +### Network actions optimisation parameters +These parameters (topological-actions-optimization) tune the [search-tree algorithm](/castor.md#algorithm) +when searching for the best network actions. + +#### absolute-minimum-impact-threshold +- **Expected value**: numeric value, where the unit is that of the objective function +- **Default value**: 0.0 +- **Usage**: if a topological action improves the objective function by x, and x is smaller than this parameter, the + effectiveness of this topological action will be considered inconsequential, and it will not be retained by the + search-tree. + The absolute-minimum-impact-threshold can therefore fill two purposes: + - do not retain in the optimal solution of the RAO remedial actions with a negligible impact + - speed up the computation by avoiding the few final depths which only slightly improve the solution. + +#### relative-minimum-impact-threshold +- **Expected value**: numeric value, percentage defined between 0 and 1 (1 = 100%) +- **Default value**: 0.0 +- **Usage**: behaves like [absolute-minimum-impact-threshold](#absolute-minimum-impact-threshold), but the + threshold here is defined as a coefficient of the objective function value of the previous depth. In depth (n+1), if a + topological action improves the objective function by $x$, with $x < solution(depth(n)) \times relative\text{-}minimum\text{-}impact\text{-}threshold$, + it will not be retained by the search-tree. + +### CNECs that should not be optimised +These parameters (not-optimized-cnecs) allow the activation of region-specific features, that de-activate the +optimisation of specific CNECs in specific conditions. + +#### do-not-optimize-curative-cnecs-for-tsos-without-cras +- **Expected value**: true/false +- **Default value**: false +- **Usage**: if this parameter is set to true, the RAO will detect TSOs not sharing any curative remedial actions (in + the CRAC). During the curative RAO, these TSOs' CNECs will not be taken into account in the minimum margin objective + function, unless the applied curative remedial actions decrease their margins (compared to their margins before + applying any curative action). + If it is set to false, all CNECs are treated equally in the curative RAO. + This parameter has no effect on the preventive RAO. + This parameter should be set to true for CORE CC. + +### Loop-flow optional parameter +Adding a LoopFlowParameters to RaoParameters will activate [loop-flow constraints](/castor/special-features/loop-flows.md). +(The RAO will monitor the loop-flows on CNECs that have a LoopFlowThreshold extension.) +The following parameters tune some of these constraints, the one which are not implementation specific. +See also: [Modelling loop-flows and their virtual cost](/castor/linear-problem/max-loop-flow-filler.md) + +#### acceptable-increase +- **Expected value**: numeric values, in MEGAWATT unit +- **Default value**: 0.0 MW +- **Usage**: the increase of the initial loop-flow that is allowed by the optimisation. That is to say, the optimisation + bounds the loop-flow on CNECs by: + *LFcnec ≤ max(MaxLFcnec , InitLFcnec + acceptableAugmentation)* + With *LFcnec* the loop-flow on the CNEC after optimisation, *MaxLFcnec* is the CNEC loop-flow threshold, *InitLFcnec* + the initial loop-flow on the cnec, and *acceptableAugmentation* the so-called "loop-flow-acceptable-augmentation" + coefficient. + If this constraint cannot be respected and the loop-flow exceeds the aforementioned threshold, the objective function + associated to this situation will be penalized (see also [violation-cost](#violation-cost)) + +#### countries +- **Expected value**: array of country codes "XX" +- **Default value**: all countries encountered +- **Usage**: list of countries for which loop-flows should be limited accordingly to the specified constraints. If not + present, all countries encountered in the input files will be considered. Note that a cross-border line will have its + loop-flows monitored if at least one of its two sides is in a country from this list. + Example of this parameter : [ "BE", "NL" ] if you want to monitor loop-flows in and out of Belgium and the + Netherlands. + +### MNEC optional parameter +Adding a MnecParameters to RaoParameters will activate [MNEC constraints](/castor/linear-problem/mnec-filler.md). +(The RAO will only monitor CNECs that are only ["monitored"](/input-data/crac/json.md#cnecs)). +The following parameters tune some of these constraints, the one which are not implementation specific. +See also: [Modelling MNECs and their virtual cost](/castor/linear-problem/mnec-filler.md) + +#### acceptable-margin-decrease +- **Expected value**: numeric values, in MEGAWATT unit +- **Default value**: 50 MW (required by CORE CC methodology) +- **Usage**: the decrease of the initial margin that is allowed by the optimisation on MNECs. + In other words, it defines the bounds for the margins on the MNECs by + *Mcnec ≥ max(0, m0cnec − acceptableDiminution)* + With *Mcnec* the margin on the cnec after optimisation, *m0cnec* the initial margin on the cnec, and + *acceptableDiminution* the so-called "acceptable-margin-decrease" coefficient. + For the CORE CC calculation, the ACER methodology fixes this coefficient at 50 MW. + For CSE CC calculation, setting this parameter to -99999 allows the MNEC constraints to consider + the thresholds in the CRAC only. + +### Relative margins optional parameter +Adding a RelativeMarginsParameters is mandatory when [objective function is relative](#type). +The following parameters tune some constraints, the one which are not implementation specific. +See also: [Modelling the maximum minimum relative margin objective function](/castor/linear-problem/max-min-relative-margin-filler.md) + +#### ptdf-boundaries +- **Expected value**: array of zone-to-zone PTDF computation definition, expressed as an equation. + Zones are defined by their 2-character code or their 16-character EICode, inside **{ }** characters. + Zones are seperated by + or -. + All combinations are allowed: country codes, EIC, a mix. +- **Default value**: empty array +- **Usage**: contains the boundaries on which the PTDF absolute sums should be computed (and added to the denominator of + the relative RAM). + For example, in the SWE case, it should be equal to [ "{FR}-{ES}", "{ES}-{PT}" ]. + For CORE, we should use all the CORE region boundaries (all countries seperated by a - sign) plus Alegro's special + equation: "{BE}-{22Y201903144---9}-{DE}+{22Y201903145---4}" + +## Examples +> ⚠️ **NOTE** +> The following examples in json and yaml are not equivalent + +::::{tabs} +:::{group-tab} JSON +~~~json +{ + "version" : "3.0", + "objective-function" : { + "type" : "SECURE_FLOW", + "unit" : "A", + "enforce-curative-security" : true + }, + "range-actions-optimization" : { + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 + }, + "topological-actions-optimization" : { + "relative-minimum-impact-threshold" : 0.0, + "absolute-minimum-impact-threshold" : 1.0 + }, + "not-optimized-cnecs" : { + "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false + } +} +~~~ +::: +:::{group-tab} iTools +Based on PowSyBl's [configuration mechanism](inv:powsyblcore:std:doc#user/configuration/index). +~~~yaml +rao-objective-function: + type: SECURE_FLOW + unit: AMPERE + +rao-range-actions-optimization: + pst-ra-min-impact-threshold: 0.01 + +rao-topological-actions-optimization: + relative-minimum-impact-threshold: 0.0 + absolute-minimum-impact-threshold: 2.0 + +search-tree-multi-threading: + available-cpus: 4 + +search-tree-second-preventive-rao: + execution-condition: POSSIBLE_CURATIVE_IMPROVEMENT + re-optimize-curative-range-actions: true + hint-from-first-preventive-rao: true + +rao-not-optimized-cnecs: + do-not-optimize-curative-cnecs-for-tsos-without-cras: false +~~~ +::: +:::: diff --git a/docs/parameters/implementation-specific-parameters.md b/docs/parameters/implementation-specific-parameters.md new file mode 100644 index 0000000000..7b7bd738c8 --- /dev/null +++ b/docs/parameters/implementation-specific-parameters.md @@ -0,0 +1,532 @@ +# Implementation specific parameters + +## Rao parameters Extensions + +Used to configure RAO implementation specific parameters + +### Open Rao Search Tree Parameters extension + +This extension is used to configure Open RAO specific parameters for search tree algorithms + +#### Objective function parameters + +##### curative-min-obj-improvement +- **Expected value**: numeric value, where the unit is that of the objective function +- **Default value**: 0 +- **Usage**: used as a minimum improvement of the preventive RAO objective value for the curative RAO objective value, + when [type](#type) is set to MAX_MIN_MARGIN or MAX_MIN_RELATIVE_MARGIN. + +#### Range actions optimisation parameters +These parameters (range-actions-optimization) tune the [linear optimiser](/castor/linear-problem.md) used to optimise range actions. +(See [Modelling CNECs and range actions](/castor/linear-problem/core-problem-filler.md)) + +##### max-mip-iterations +- **Expected value**: integer +- **Default value**: 10 +- **Usage**: defines the maximum number of iterations to be executed by the iterating linear optimiser of the RAO. + One iteration of the iterating linear optimiser includes: the resolution of one linear problem (MIP), an update of the + network with the optimal PST taps found in the linear problem, a security analysis of the updated network and an + assessment of the objective function based on the results of the security analysis. + The linear problem relies on sensitivity coefficients to estimate the flows on each CNEC, and those estimations might + not be perfect when several PSTs taps are significantly changed. When the linear optimisation problem makes a (n+1)th + iteration, it refines its solution with new sensitivity coefficients, which better describe the neighbourhood of the + solution found in iteration (n). + Note that the linear optimisation problems usually "converge" with very few iterations (1 to 4 iterations). + +##### pst-model +- **Expected value**: one of the following: + - "CONTINUOUS" + - "APPROXIMATED_INTEGERS" +- **Default value**: "CONTINUOUS" +- **Usage**: the method to model PSTs in the linear problem: + - **CONTINUOUS**: PSTs are represented by their angle set-points; the set-points are continuous optimisation variables + and OpenRAO rounds the result to the best tap (around the optimal set-point) after optimisation. This approach is not + very precise but does not create integer optimisation variables; thus it is quicker to solve, especially with + open-source solvers. + - **APPROXIMATED_INTEGERS**: a PST is represented by its tap positions, and these tap positions are considered + proportional to the PST's angle set-point (hence the "approximated" adjective). Thus, these tap positions can be + used as a multiplier of the sensitivity values when representing the impact of the PST on CNECs. This approach is + more precise and thus has the advantage of better respecting Loop-Flow and MNEC constraints. But it introduces + integer variables (tap positions) and can be harder to solve. + See [Using integer variables for PST taps](/castor/linear-problem/discrete-pst-tap-filler.md). + +##### pst-sensitivity-threshold +- **Expected value**: numeric value, unit: MW / ° (per degree) +- **Default value**: 0.0 +- **Usage**: the pst sensitivity coefficients which are below the pst-sensitivity-threshold will be considered equal to + zero by the linear optimisation problem. Filtering some small sensitivity coefficients have the two following perks + for the RAO: + - it decreases the complexity of the optimisation problem by reducing significantly the number of non-zero elements + - it can avoid changes of PST set-points when they only allow to earn a few MW on the margins of some CNECs. + +##### hvdc-sensitivity-threshold +- **Expected value**: numeric value, unit: MW / MW +- **Default value**: 0.0 +- **Usage**: the hvdc sensitivity coefficients which are below the hvdc-sensitivity-threshold will be considered equal + to zero by the linear optimisation problem. Filtering some of the small sensitivity coefficients have the two + following perks regarding the RAO: + - it decreases the complexity of the optimisation problem by reducing significantly the number of non-null elements + - it can avoid changes of HVDC set-points when they only allow to earn a few MW on the margins of some CNECs. + +##### injection-ra-sensitivity-threshold +- **Expected value**: numeric value, unit: MW / MW +- **Default value**: 0.0 +- **Usage**: the injection sensitivity coefficients which are below the injection-ra-sensitivity-threshold will be + considered equal to zero by the linear optimisation problem. + The perks are the same as the two parameters above. + +##### ra-range-shrinking +- **Expected value**: one of the following: + - "DISABLED" + - "ENABLED" + - "ENABLED_IN_FIRST_PRAO_AND_CRAO" +- **Default value**: "DISABLED" +- **Usage**: CASTOR makes the approximation that range action sensitivities on CNECs are linear. However, in + active+reactive computations, this approximation may be incorrect. The linear problem can thus find a worse solution + than in its previous iteration. + - **DISABLED**: if this situation occurs, the linear problem stops and returns the previous solution, + see this schema : [Linear Remedial Actions Optimisation](/castor/linear-problem.md#algorithm). + - **ENABLED**: this introduces two new behaviors to the iterating linear optimiser: + 1. If the linear problem finds a solution worse than in its previous iteration, it continues iterating. + When stop condition is met ([max-mip-iterations](#max-mip-iterations) reached, or two successive iterations have + the same optimal RA set-points), then the problem returns the best solution it has found. + 2. At each new iteration, the range action's allowed range shrinks according to equations [described here](/castor/linear-problem/core-problem-filler.md#shrinking-the-allowed-range). + These equations have been chosen to force the linear problem convergence while allowing the RA to go + back to its initial solution if needed. + - **ENABLED_IN_FIRST_PRAO_AND_CRAO**: + same as **ENABLED** but only for first preventive and curative RAO. This parameter value has been introduced because + sensitivity computations in the second preventive RAO can be slow (due to the larger optimization perimeter), thus + computation time loss may outweigh the gains of RA range shrinking. + +##### linear-optimization-solver +These are parameters that tune the solver used to solve the MIP problem. + +###### solver +- **Expected value**: one of the following: + - "CBC" + - "SCIP" + - "XPRESS" +- **Default value**: "CBC" +- **Usage**: the solver called for optimising the linear problem. + Note that theoretically all solvers supported by OR-Tools can be called, but the OpenRAO interface only allows CBC + (open-source), SCIP (commercial) and XPRESS (commercial) for the moment. + If needed, other solvers can be easily added. + +###### relative-mip-gap +- **Expected value**: double +- **Default value**: 0.0001 +- **Usage**: the relative MILP (Mixed-Integer-Linear-Programming) target gap. + During branch-and-bound algorithm (only in MILP case), the solver will stop branching when this relative gap is + reached between the best found objective function and the estimated objective function best bound. + +###### solver-specific-parameters + +- **Expected value**: String, space-separated parameters (keys and values) understandable by OR-Tools (for example "key1 + value1 key2 value2") +- **Default value**: empty +- **Usage**: this can be used to set solver-specific parameters, when the OR-Tools API and its generic parameters are + not enough. + +#### Network actions optimisation parameters +These parameters (topological-actions-optimization) tune the [search-tree algorithm](/castor.md#algorithm) +when searching for the best network actions. + +##### max-preventive-search-tree-depth +- **Expected value**: integer +- **Default value**: 2^32 -1 (max integer value) +- **Usage**: maximum search-tree depth for preventive optimization. + Applies to the preventive RAO. + +##### max-auto-search-tree-depth +- **Expected value**: integer +- **Default value**: 2^32 -1 (max integer value) +- **Usage**: maximum search-tree depth for the optimization of available auto network actions. + +##### max-curative-search-tree-depth +- **Expected value**: integer +- **Default value**: 2^32 -1 (max integer value) +- **Usage**: maximum search-tree depth for curative optimization. + Applies separately to each perimeter-specific curative RAO. + +##### predefined-combinations +- **Expected value**: an array containing sets of network action IDs +- **Default value**: empty +- **Usage**: this parameter contains hints for the search-tree RAO, consisting of combinations of multiple network + actions that the user considers interesting to test together during the RAO. + These combinations will be tested in the first search depth of the search-tree + +![Search-tree-with-combinations](/_static/img/Search-tree-with-combinations.png){.forced-white-background} + +##### skip-actions-far-from-most-limiting-element +- **Expected value**: true/false +- **Default value**: false +- **Usage**: whether the RAO should skip evaluating topological actions that are geographically far from the most + limiting element at the time of the evaluation. Proximity is defined by the number of country boundaries separating + the element from the topological action (see [max-number-of-boundaries-for-skipping-actions](#max-number-of-boundaries-for-skipping-actions)). + Setting this to true allows you to speed up the search tree RAO, while keeping a good precision, since topological + actions that are far from the most limiting element have almost no impact on the minimum margin. + +##### max-number-of-boundaries-for-skipping-actions +- **Expected value**: integer (>= 0) +- **Default value**: 2 +- **Usage**: the maximum number of country boundaries between the most limiting element and the topological actions that + shall be evaluated. The most limiting element is defined as the element with the minimum margin at **the time of this + evaluation**. + If the most limiting element has nodes in two countries, the smallest distance is considered. + If the value is set to zero, only topological actions in the same country as the most limiting element will be + evaluated in the search-tree. + If the value is set to 1, topological actions from direct neighbors will also be considered, etc. + *Note that the topology of the network is automatically deduced from the network file: countries sharing tie lines are + considered direct neighbors; dangling lines are not considered linked (ie BE and DE are not considered neighbors, even + though they share the Alegro line)* + +#### Second preventive RAO parameters +These parameters (second-preventive-rao) tune the behaviour of the [second preventive RAO](/castor/rao-steps.md#second-preventive-rao). + +##### execution-condition +- **Expected value**: one of the following: + - "DISABLED" + - "COST_INCREASE" + - "POSSIBLE_CURATIVE_IMPROVEMENT" +- **Default value**: "DISABLED" +- **Usage**: configures whether a 2nd preventive RAO should be run after the curative RAO. + *Note: if there are automatons, and if a 2nd preventive RAO is run, then a 2nd automaton RAO is also run* + - **DISABLED**: 2nd preventive RAO is not run + - **COST_INCREASE**: a 2nd preventive RAO is run if the RAO's overall cost has increased after optimisation compared to + before optimisation; for example due to a curative CNEC margin decreased in 1st preventive RAO and not reverted + during curative RAO + - **POSSIBLE_CURATIVE_IMPROVEMENT**: a 2nd preventive RAO is run only if it is possible to improve a curative perimeter, + i.e. if the curative RAO stop criterion on at least one contingency is not reached. + This depends on the value of parameter [type](#type): + - **SECURE_FLOW**: 2nd preventive RAO is run if one curative perimeter is not secure after optimisation + - **MAX_MIN_MARGIN** or **MAX_MIN_RELATIVE_MARGIN**: 2nd preventive RAO is run if one curative perimeter reached an objective function value + after optimisation that is worse than the preventive perimeter's (decreased by [curative-min-obj-improvement](#curative-min-obj-improvement)) + +##### re-optimize-curative-range-actions +- **Expected value**: true/false +- **Default value**: false +- **Usage**: + - **false**: the 2nd preventive RAO will optimize only the preventive remedial actions, keeping **all** optimal + curative remedial actions selected during the curative RAO. + - **true**: the 2nd preventive RAO will optimize preventive remedial actions **and** curative range actions, keeping + only the optimal curative **topological** actions computed in the curative RAO. + +##### hint-from-first-preventive-rao +- **Expected value**: true/false +- **Default value**: false +- **Usage**: if set to true, the RAO will use the optimal combination of network actions found in the first preventive + RAO, as a predefined combination ("hint") to test at the first search depth of the second preventive RAO. This way, + if this combination is optimal in the 2nd preventive RAO as well, getting to the optimal solution will be much faster. + +#### CNECs that should not be optimised +These parameters (not-optimized-cnecs) allow the activation of region-specific features, that de-activate the +optimisation of specific CNECs in specific conditions. + +##### do-not-optimize-curative-cnecs-for-tsos-without-cras +- **Expected value**: true/false +- **Default value**: false +- **Usage**: if this parameter is set to true, the RAO will detect TSOs not sharing any curative remedial actions (in + the CRAC). During the curative RAO, these TSOs' CNECs will not be taken into account in the minimum margin objective + function, unless the applied curative remedial actions decrease their margins (compared to their margins before + applying any curative action). + If it is set to false, all CNECs are treated equally in the curative RAO. + This parameter has no effect on the preventive RAO. + This parameter should be set to true for CORE CC. + +#### Load-flow and sensitivity computation parameters +These parameters (load-flow-and-sensitivity-computation) configure the load-flow and sensitivity computations providers +from inside the RAO. + +##### load-flow-provider +- **Expected value**: String, should refer to a [PowSyBl load flow provider implementation](inv:powsyblcore:std:doc#simulation/loadflow/index) +- **Default value**: "OpenLoadFlow" (see [OpenLoadFlow](inv:powsyblopenloadflow:std:doc#index)) +- **Usage**: the name of the load flow provider to use when a load flow is needed + +##### sensitivity-provider +- **Expected value**: String, should refer to a [PowSyBl sensitivity provider implementation](inv:powsyblcore:std:doc#simulation/sensitivity/index) +- **Default value**: "OpenLoadFlow" (see [OpenLoadFlow](inv:powsyblopenloadflow:std:doc#index)) +- **Usage**: the name of the sensitivity provider to use in the RAO + +##### sensitivity-failure-over-cost +- **Expected value**: numeric value, where the unit is that of the objective function +- **Default value**: 10000.0 +- **Usage**: if the systematic sensitivity analysis fails (= diverged) due to a combination of remedial actions, its + objective function assessment will be penalized by this value. In other words, the criterion for this combination of RA + will be (e.g.) : minMargin - sensitivity-failure-over-cost. + If this parameter is strictly positive, the RAO will discriminate the combinations of RA for which the systematic + analysis didn't converge. The RAO might therefore put aside the solution with the best objective-function if it has + lead to a sensitivity failure, and instead propose a solution whose objective-function is worse, but whose associated + network is converging for all contingency scenarios. + +##### sensitivity-parameters +- **Expected value**: SensitivityComputationParameters ([PowSyBl](inv:powsyblcore:std:doc#simulation/sensitivity/configuration) configuration) +- **Default value**: PowSyBl's default value (it is generally a bad idea to keep the default value for this parameter) +- **Usage**: sensitivity-parameters is the configuration of the PowSyBl sensitivity engine, which is used within OpenRAO. + The underlying "load-flow-parameters" is also used whenever an explicit pure load-flow computation is needed. + +#### Multi-threading parameters +These parameters (multi-threading) allow you to run a RAO making the most out of your computation resources. + +##### available-cpus +- **Expected value**: integer +- **Default value**: 1 +- **Usage**: It should not exceed the number of cores of the computer on which the computation is made. + Then it is used for: + - number of contingency scenarios (auto + curative instants) to optimise in parallel. + - number of combination of remedial actions that the search-tree will investigate in + parallel during the preventive RAO and automaton RAO. + *Note that the more available cpus is configured, the more RAM is required by the RAO, and that the performance + of the RAO might significantly decrease on a machine with limited memory resources.* + +#### Loop-flow optional parameter +Adding a LoopFlowParameters to OpenRaoSearchTreeParameters will activate [loop-flow constraints](/castor/special-features/loop-flows.md). +(The RAO will monitor the loop-flows on CNECs that have a LoopFlowThreshold extension.) +The following parameters tune some of these constraints, the one which are implementation specific. +See also: [Modelling loop-flows and their virtual cost](/castor/linear-problem/max-loop-flow-filler.md) + +##### ptdf-approximation +- **Expected value**: one of the following: + - "FIXED_PTDF" + - "UPDATE_PTDF_WITH_TOPO" + - "UPDATE_PTDF_WITH_TOPO_AND_PST" +- **Default value**: "FIXED_PTDF" +- **Usage**: defines the frequency at which the PTDFs will be updated for the loop-flow computation. + This parameter enables to set the desired trade-off between the accuracy of the loop-flow computation, and the + computation time of the RAO. + - **FIXED_PTDF**: the PTDFs are computed only once at the beginning of the RAO. + - **UPDATE_PTDF_WITH_TOPO**: the PTDFs are re-computed for each new combination of topological actions (i.e. + for each new node of the search-tree). + - **UPDATE_PTDF_WITH_TOPO_AND_PST**: the PTDFs are re-computed for each new combination of topological action and for + each new combination of PST taps (i.e. for each iteration of the linear optimisation). + *Note that this option is only relevant in AC-loadflow mode, as the UPDATE_PTDF_WITH_TOPO already maximizes accuracy in DC.* + +##### constraint-adjustment-coefficient +- **Expected value**: numeric values, in MEGAWATT unit +- **Default value**: 0.0 MW +- **Usage**: this parameter acts as a margin which tightens, in the linear optimisation problem of RAO, the bounds of the + loop-flow constraints. It conceptually behaves as the coefficient *cAdjustment* from the constraint below: + *abs(LoopFlow(cnec)) <= LoopFlowThreshold - cAdjustment* + This parameter is a safety margin that can absorb some approximations made in the linear + optimisation problem of the RAO (non-integer PSTs taps, flows approximated by sensitivity coefficients, etc.), and + therefore increase the probability that the loop-flow constraints which are respected in the linear optimisation + problem, remain respected once the loop-flows are re-computed without the linear approximations. + +##### violation-cost +- **Expected value**: numeric values, unit = unit of the objective function per MEGAWATT +- **Default value**: 10.0 +- **Usage**: this parameter is the cost of each excess of loop-flow. That is to say, if the loop-flows on one or several + CNECs exceed the loop-flow threshold, a penalty will be added in the objective function of the RAO equal to: + *violation-cost x sum{cnec} excess-loop-flow(cnec)* + +#### MNEC optional parameter +Adding a MnecParameters to OpenRaoSearchTreeParameters will activate [MNEC constraints](/castor/linear-problem/mnec-filler.md). +(The RAO will only monitor CNECs that are only ["monitored"](/input-data/crac/json.md#cnecs)). +The following parameters tune some of these constraints, the one which are implementation specific. +See also: [Modelling MNECs and their virtual cost](/castor/linear-problem/mnec-filler.md) + +##### violation-cost +- **Expected value**: numeric values, no unit (it applies as a multiplier for the constraint violation inside the + objective function) +- **Default value**: 10.0 (same as [loop-flow violation cost](#violation-cost)) +- **Usage**: the penalty cost associated to the violation of a MNEC constraint. + In order to avoid optimisation infeasibility, the MNEC constraints are soft: they can be violated. These violations + are penalized by a significant cost, in order to guide the optimiser towards a solution where - if possible - all + MNECs' constraints are respected. The penalty injected in the objective function is equal to the violation (difference + between actual margin and least acceptable margin) multiplied by this parameter. + +##### constraint-adjustment-coefficient +- **Expected value**: numeric values, in MEGAWATT unit +- **Default value**: 0.0 +- **Usage**: this coefficient is here to mitigate the approximation made by the linear optimisation (approximation = use + of sensitivities to linearize the flows, rounding of the PST taps). + *Mcnec ≥ max(0 , m0cnec - acceptableDiminution) + constraintAdjustment* + With *constraintAdjustment* the so-called "constraint-adjustment-coefficient". + It tightens the MNEC constraint, in order to take some margin for that constraint to stay respected once the + approximations are removed (i.e. taps have been rounded and real flow calculated) + +#### Relative margins optional parameter +Adding a RelativeMarginsParameters is mandatory when [objective function is relative](#type). +The following parameters tune the constraints which are implementation specific. +See also: [Modelling the maximum minimum relative margin objective function](/castor/linear-problem/max-min-relative-margin-filler.md) + +##### ptdf-approximation +- **Expected value**: one of the following: + - "FIXED_PTDF" + - "UPDATE_PTDF_WITH_TOPO" + - "UPDATE_PTDF_WITH_TOPO_AND_PST" +- **Default value**: "FIXED_PTDF" +- **Usage**: defines the frequency at which the PTDFs will be updated for the relative margins computation. + This parameter enables to set the desired trade-off between the accuracy of the relative margins computation, and the + computation time of the RAO. + - **FIXED_PTDF**: the PTDFs are computed only once at the beginning of the RAO. + - **UPDATE_PTDF_WITH_TOPO**: the PTDFs are re-computed for each new combination of topological actions (i.e. + for each new node of the search-tree). + - **UPDATE_PTDF_WITH_TOPO_AND_PST**: the PTDFs are re-computed for each new combination of topological action and for + each new combination of PST taps (i.e. for each iteration of the linear optimisation). + *Note that this option is only relevant in AC-loadflow mode, as the UPDATE_PTDF_WITH_TOPO already maximizes accuracy in DC.* + +##### ptdf-sum-lower-bound +- **Expected value**: numeric value, no unit (homogeneous to PTDFs) +- **Default value**: 0.01 +- **Usage**: PTDF absolute sums are used as a denominator in the objective function. In order to prevent the objective + function from diverging to infinity (resulting in unbounded problems), the denominator should be prevented from + getting close to zero. This parameter acts as a lower bound to the denominator. + +## Examples +> ⚠️ **NOTE** +> The following examples in json and yaml are not equivalent + +::::{tabs} +:::{group-tab} JSON +~~~json +{ + "version" : "3.0", + "extensions" : { + "open-rao-search-tree-parameters": { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 0.0, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 0.0, + "injection-ra-sensitivity-threshold" : 0.0, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : "THREADS 10 MAXTIME 3000" + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2, + "max-auto-search-tree-depth" : 1, + "max-curative-search-tree-depth" : 2, + "predefined-combinations" : [ "na1 + na2", "na4 + na5 + na6"], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "multi-threading" : { + "available-cpus" : 4 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : true + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-over-cost" : 0.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "DC_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : true, + "noGeneratorReactiveLimits" : false, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : false, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ "TR", "BE", "SI", "CH", "AL", "ES", "SK", "BA", "RO", "PT", "DE", "AT", "FR", "CZ", "ME", "NL", "PL", "GR", "IT", "UA", "HU", "BG", "MK", "HR", "RS" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "plausibleActivePowerLimit" : 10000.0, + "minPlausibleTargetVoltage" : 0.5, + "maxPlausibleTargetVoltage" : 1.5, + "maxNewtonRaphsonIterations" : 100, + "newtonRaphsonConvEpsPerEq" : 1.0E-3, + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "throwsExceptionInCaseOfSlackDistributionFailure" : false, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "addRatioToLinesWithDifferentNominalVoltageAtBothEnds" : true, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "reactiveRangeCheckMode" : "MAX" + } + } + } + } + } + }, + "loop-flow-parameters" : { + "acceptable-increase" : 10.0, + "ptdf-approximation" : "FIXED_PTDF", + "constraint-adjustment-coefficient" : 10.0, + "violation-cost" : 10.0, + "countries" : [ "FR", "ES", "PT" ] + }, + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0, + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 1.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{FR}-{BE}", "{FR}-{DE}", "{BE}-{NL}", "{NL}-{DE}", "{DE}-{PL}", "{DE}-{CZ}", "{DE}-{AT}", "{PL}-{CZ}", "{PL}-{SK}", "{CZ}-{SK}", "{CZ}-{AT}", "{AT}-{HU}", "{AT}-{SI}", "{SI}-{HR}", "{SK}-{HU}", "{HU}-{RO}", "{HU}-{HR}", "{BE}-{22Y201903144---9}-{DE}+{22Y201903145---4}" ], + "ptdf-approximation" : "FIXED_PTDF", + "ptdf-sum-lower-bound" : 0.01 + } + } +} +~~~ +::: +:::{group-tab} iTools +Based on PowSyBl's [configuration mechanism](inv:powsyblcore:std:doc#user/configuration/index). +~~~yaml +search-tree-range-actions-optimization: + max-mip-iterations: 5 + pst-sensitivity-threshold: 0.01 + pst-model: APPROXIMATED_INTEGERS + +search-tree-linear-optimization-solver: + solver: CBC + +search-tree-topological-actions-optimization: + max-preventive-search-tree-depth: 3 + max-auto-search-tree-depth: 2 + max-curative-search-tree-depth: 3 + predefined-combinations: [ "{na1}+{na2}", "{na3}+{na4}+{na5}" ] + relative-minimum-impact-threshold: 0.0 + absolute-minimum-impact-threshold: 2.0 + +search-tree-multi-threading: + available-cpus: 4 + +search-tree-second-preventive-rao: + execution-condition: POSSIBLE_CURATIVE_IMPROVEMENT + re-optimize-curative-range-actions: true + hint-from-first-preventive-rao: true + +search-tree-load-flow-and-sensitivity-computation: + load-flow-provider: OpenLoadFlow + sensitivity-provider: OpenLoadFlow + +load-flow-default-parameters: + voltageInitMode: DC_VALUES + balanceType: PROPORTIONAL_TO_GENERATION_P + countriesToBalance: AL,AT,BA,BE,BG,CH,CZ,DE,ES,FR,GR,HR,HU,IT,ME,MK,NL,PL,PT,RO,RS,SI,SK,UA + update parameters to version 2.0 phaseShifterRegulationOn: true + +open-loadflow-default-parameters: + minPlausibleTargetVoltage: 0.5 + maxPlausibleTargetVoltage: 1.5 + plausibleActivePowerLimit: 10000 + newtonRaphsonConvEpsPerEq : 1.0E-2 +~~~ +::: +:::: 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..7604e3fbde 100644 --- a/python-util/rao_parameter_modification.py +++ b/python-util/rao_parameter_modification.py @@ -6,114 +6,224 @@ import os import json +import re from json import JSONDecodeError -import yaml current_directory = os.getcwd() - -tag_by_file_type = {"json": "objective-function", "yaml": "rao-objective-function"} - def rao_parameters_file(file_path): + # do not work with yaml yet correct_version = False - score = 0 - if "target" not in file_path and (file_path.endswith(".json") or file_path.endswith(".yml")): - ftype = "json" if file_path.endswith(".json") else "yaml" + has_rao_param_name = False + if "target" not in file_path and (file_path.endswith(".json")): with open(os.path.join(dirpath, filename), 'r') as file: for line in file: - if '"version" : "2.4"' in line or '"version" : "2.5"' in line: - correct_version = True - if tag_by_file_type[ftype] in line: - score += 1 - if "MAX_MIN_MARGIN_IN" in line or "MAX_MIN_RELATIVE_MARGIN_IN" in line: - score += 1 - if correct_version and score >= 2: + if '"version" : "2.4"' in line or '"version" : "2.5"' in line or '"version": "2.4"' in line or '"version": "2.5"': return True return False -def read_data(file_path) -> tuple[dict, str]: - if file_path.endswith(".json"): - with open(file_path, 'r') as file: - try: - return json.load(file), "json" - except JSONDecodeError as je: - print("in file " + file_path) - raise je - if file_path.endswith(".yml"): - with open(file_path, 'r') as file: - return yaml.safe_load(file), "yaml" # ["rao-parameters"] - -def extract_leading_whitespace(line): - leading_whitespace = "" - for char in line: - if char.isspace(): - leading_whitespace += char - else: - break - return leading_whitespace -def write_data(new_data, file_path, file_type): +# do not work with yaml yet +def read_data(file_path) -> dict: with open(file_path, 'r') as file: - lines = file.readlines() - lines_to_write = [] - inside_obj_fun_to_replace = False - for line in lines: - if tag_by_file_type[file_type] in line and tag_by_file_type[file_type] in new_data: - leading_whitespace = extract_leading_whitespace(line) - inside_obj_fun_to_replace = True - if inside_obj_fun_to_replace and ((file_type == "json" and "}" in line) or (file_type == "yaml" and line == "\n")): - obj_fun_str = f'"{tag_by_file_type[file_type]}" : ' + obj_function_as_str_lines(new_data, file_type) - for new_line in obj_fun_str.splitlines(True): - lines_to_write.append(leading_whitespace + new_line) - inside_obj_fun_to_replace = False - elif not inside_obj_fun_to_replace: - lines_to_write.append(line) - with open(file_path, 'w') as file: - file.writelines(lines_to_write) - - -def obj_function_as_str_lines(new_data, file_type): - if file_type == "json": - return json.dumps(new_data[tag_by_file_type[file_type]], indent=2, separators=(',', ' : ')) + ',\n' - else: - return yaml.dump(new_data[tag_by_file_type[file_type]], default_flow_style=False) + '\n' - - - -def new_rao_param(data: dict, file_path: str, file_type: str) -> dict: + try: + return json.load(file) + except JSONDecodeError as je: + print("in file " + file_path) + raise je + + +class SpecialJSONEncoder(json.JSONEncoder): + """A JSON Encoder closer to actual rao parameter json format""" + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.indentation_level = 0 + + def encode(self, o): + """Encode JSON object *o* with respect to single line lists.""" + + if isinstance(o, (list, tuple)): + if len(o) == 0: + return "[ ]" + else: + return "[ " + ", ".join(self.encode(el) for el in o) + " ]" + + elif isinstance(o, dict): + self.indentation_level += 1 + output = [self.indent_str + f"{json.dumps(k)} : {self.encode(v)}" for k, v in o.items()] + self.indentation_level -= 1 + return "{\n" + ",\n".join(output) + "\n" + self.indent_str + "}" + + elif isinstance(o, float): + pattern = r'(\d+).?(\d*)e-0(\d+)' + + def python_to_java_sci(match): + return f"{match.group(1)}{'.0' if not any(match.group(2)) else ('.' + match.group(2))}E-{match.group(3)}" + + float_as_str = re.sub(pattern, python_to_java_sci, str(o)) + if float_as_str == "0.0001": + return "1.0E-4" + return float_as_str + + else: + return json.dumps(o) + + @property + def indent_str(self) -> str: + return " " * self.indentation_level * self.indent + + def iterencode(self, o, **kwargs): + """Required to also work with `json.dump`.""" + return self.encode(o) + + +def new_rao_param(data: dict, file_path: str) -> dict: try: - old_obj_fun = data[tag_by_file_type[file_type]] - 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" + # update version + data["version"] = "3.0" + + # remove forbid-cost-increase + if "forbid-cost-increase" in data["objective-function"]: + del data["objective-function"]["forbid-cost-increase"] + + # set enforce-curative-security and curative-min-obj-improvement + prev_secure = "preventive-stop-criterion" not in data["objective-function"] or data["objective-function"]["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"] + if "optimize-curative-if-preventive-unsecure" in data["objective-function"]: + data["objective-function"]["enforce-curative-security"] = data["objective-function"]["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") + cur_secure = "curative-stop-criterion" in data["objective-function"] and data["objective-function"]["curative-stop-criterion"] in ("SECURE", "PREVENTIVE_OBJECTIVE_AND_SECURE") if cur_secure: - new_obj_fun["enforce-curative-security"] = True + data["objective-function"]["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" + data["objective-function"]["enforce-curative-security"] = False + cur_min = "curative-stop-criterion" in data["objective-function"] and data["objective-function"]["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) + data["objective-function"]["curative-min-obj-improvement"] = 10000.0 + if "curative-stop-criterion" in data["objective-function"]: + del data["objective-function"]["curative-stop-criterion"] + if "optimize-curative-if-preventive-unsecure" in data["objective-function"]: + del data["objective-function"]["optimize-curative-if-preventive-unsecure"] + + # separate unit from objective function type + if "type" in data["objective-function"]: + if "MEGAWATT" in data["objective-function"]["type"]: + data["objective-function"]["unit"] = "MW" + elif "AMPERE" in data["objective-function"]["type"]: + data["objective-function"]["unit"] = "A" + if "MAX_MIN_MARGIN" in data["objective-function"]["type"]: + data["objective-function"]["type"] = "MAX_MIN_MARGIN" + elif "MAX_MIN_RELATIVE_MARGIN" in data["objective-function"]["type"]: + data["objective-function"]["type"] = "MAX_MIN_RELATIVE_MARGIN" + elif "MIN_COST" in data["objective-function"]["type"]: + data["objective-function"]["type"] = "MIN_COST" + + # merge preventive stop criterion in type + if prev_secure and ("type" in data["objective-function"] or "preventive-stop-criterion" in data["objective-function"]): + data["objective-function"]["type"] = "SECURE_FLOW" + elif not prev_secure and "type" not in data["objective-function"]: + data["objective-function"]["type"] = "MAX_MIN_MARGIN" + if "preventive-stop-criterion" in data["objective-function"]: + del data["objective-function"]["preventive-stop-criterion"] + + # separate business and implem parameters + move_to_extension(data, "objective-function", ["curative-min-obj-improvement"]) + move_to_extension(data, "range-actions-optimization", + ["max-mip-iterations", "pst-sensitivity-threshold", "pst-model", + "hvdc-sensitivity-threshold", "injection-ra-sensitivity-threshold", + "ra-range-shrinking", "linear-optimization-solver"]) + move_to_extension(data, "topological-actions-optimization", + ["max-preventive-search-tree-depth", "max-auto-search-tree-depth", + "max-curative-search-tree-depth", "predefined-combinations", + "skip-actions-far-from-most-limiting-element", + "max-number-of-boundaries-for-skipping-actions"]) + move_to_extension(data, "second-preventive-rao") + move_to_extension(data, "load-flow-and-sensitivity-computation") + if "range-actions-optimization" in data: + new_names = {"pst-penalty-cost": "pst-ra-min-impact-threshold", + "hvdc-penalty-cost": "hvdc-ra-min-impact-threshold", + "injection-ra-penalty-cost": "injection-ra-min-impact-threshold"} + data["range-actions-optimization"] = {new_names[k] if k in new_names else k: v for k, v in + data["range-actions-optimization"].items()} + if "multi-threading" in data and any(data["multi-threading"]): + data["multi-threading"] = {"available-cpus": max(v for k, v in data["multi-threading"].items() if k in ("contingency-scenarios-in-parallel", "preventive-leaves-in-parallel"))} + move_to_extension(data, "multi-threading") + + # put back extensions into rao parameters + if "extensions" in data: + move_back_to_rao_param(data, "mnec-parameters", ["acceptable-margin-decrease"]) + move_back_to_rao_param(data, "relative-margins-parameters", ["ptdf-boundaries"]) + move_back_to_rao_param(data, "loop-flow-parameters", ["acceptable-increase", "countries"]) + if "extensions" in data: + extensions = data["extensions"] + # put extensions at the end: + del data["extensions"] + data["extensions"] = extensions except KeyError as ke: raise KeyError("in file " + file_path) from ke - data[tag_by_file_type[file_type]] = new_obj_fun return data +def move_to_extension(data: dict, name_level1: str, names_level2: list = None): + if name_level1 in data: + param_level_1: dict = data[name_level1] + if names_level2 is None: + st_params = get_or_create_st_params(data) + st_params[name_level1] = param_level_1 + del data[name_level1] + else: + if any(set(names_level2).intersection(param_level_1.keys())): + st_params = get_or_create_st_params(data) + if name_level1 not in st_params: + st_params[name_level1] = {} + for name_level_2 in names_level2: + if name_level_2 in param_level_1: + st_params[name_level1][name_level_2] = param_level_1[name_level_2] + del param_level_1[name_level_2] + if not any(param_level_1): + del data[name_level1] + +def move_back_to_rao_param(data: dict, name_level1: str, names_level2_for_rao: list = None): + if name_level1 in data["extensions"]: + param_level_1: dict = data["extensions"][name_level1] + for name_level2 in param_level_1.keys(): + if name_level2 in names_level2_for_rao: + rao_name_level1 = get_or_create_params(data, name_level1) + rao_name_level1[name_level2] = param_level_1[name_level2] + else: + st_params = get_or_create_st_params(data) + ext_name_level1 = get_or_create_params(st_params, name_level1) + ext_name_level1[name_level2] = param_level_1[name_level2] + del data["extensions"][name_level1] + + +def get_or_create_params(data: dict, name_level1: str) -> dict: + if name_level1 not in data: + data[name_level1] = {} + return data[name_level1] + + +def get_or_create_st_params(data: dict) -> dict: + if "extensions" not in data: + data["extensions"] = {} + if "open-rao-search-tree-parameters" not in data["extensions"]: + data["extensions"]["open-rao-search-tree-parameters"] = {} + return data["extensions"]["open-rao-search-tree-parameters"] + + +def write_data(): + with open(file_path, 'w') as f: + json.dump(new_rao_params, f, indent=2, separators=(',', ' : '), cls=SpecialJSONEncoder) +# do not work with yaml yet if __name__ == "__main__": - base_dir = os.path.join(current_directory, "..") + base_dir = os.path.join(current_directory) print(base_dir) for dirpath, dirnames, filenames in os.walk(base_dir): for filename in filenames: file_path = os.path.join(dirpath, filename) if rao_parameters_file(file_path): - data, file_type = read_data(file_path) - new_rao_params = new_rao_param(data, file_path, file_type) - write_data(new_rao_params, file_path, file_type) + old_rao_param = read_data(file_path) + new_rao_params = new_rao_param(old_rao_param, file_path) + write_data() 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..ea173439a4 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/RaoParametersCommons.java @@ -16,7 +16,7 @@ public final class RaoParametersCommons { private RaoParametersCommons() { } - public static final String RAO_PARAMETERS_VERSION = "2.5"; + public static final String RAO_PARAMETERS_VERSION = "3.0"; // header public static final String VERSION = "version"; @@ -24,24 +24,28 @@ private RaoParametersCommons() { // objective function parameters public static final String OBJECTIVE_FUNCTION = "objective-function"; public static final String OBJECTIVE_FUNCTION_SECTION = "rao-objective-function"; + public static final String ST_OBJECTIVE_FUNCTION_SECTION = "search-tree-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"; // range actions optimization parameters public static final String RANGE_ACTIONS_OPTIMIZATION = "range-actions-optimization"; public static final String RANGE_ACTIONS_OPTIMIZATION_SECTION = "rao-range-actions-optimization"; + public static final String ST_RANGE_ACTIONS_OPTIMIZATION_SECTION = "search-tree-range-actions-optimization"; + public static final String MAX_MIP_ITERATIONS = "max-mip-iterations"; - public static final String PST_PENALTY_COST = "pst-penalty-cost"; + public static final String PST_RA_MIN_IMPACT_THRESHOLD = "pst-ra-min-impact-threshold"; public static final String PST_SENSITIVITY_THRESHOLD = "pst-sensitivity-threshold"; public static final String PST_MODEL = "pst-model"; - public static final String HVDC_PENALTY_COST = "hvdc-penalty-cost"; + public static final String HVDC_RA_MIN_IMPACT_THRESHOLD = "hvdc-ra-min-impact-threshold"; public static final String HVDC_SENSITIVITY_THRESHOLD = "hvdc-sensitivity-threshold"; - public static final String INJECTION_RA_PENALTY_COST = "injection-ra-penalty-cost"; + public static final String INJECTION_RA_MIN_IMPACT_THRESHOLD = "injection-ra-min-impact-threshold"; public static final String INJECTION_RA_SENSITIVITY_THRESHOLD = "injection-ra-sensitivity-threshold"; public static final String LINEAR_OPTIMIZATION_SOLVER = "linear-optimization-solver"; - public static final String LINEAR_OPTIMIZATION_SOLVER_SECTION = "rao-linear-optimization-solver"; + public static final String LINEAR_OPTIMIZATION_SOLVER_SECTION = "search-tree-linear-optimization-solver"; public static final String SOLVER = "solver"; public static final String RELATIVE_MIP_GAP = "relative-mip-gap"; public static final String SOLVER_SPECIFIC_PARAMETERS = "solver-specific-parameters"; @@ -50,6 +54,8 @@ private RaoParametersCommons() { // topological actions optimization parameters public static final String TOPOLOGICAL_ACTIONS_OPTIMIZATION = "topological-actions-optimization"; public static final String TOPOLOGICAL_ACTIONS_OPTIMIZATION_SECTION = "rao-topological-actions-optimization"; + public static final String ST_TOPOLOGICAL_ACTIONS_OPTIMIZATION_SECTION = "search-tree-topological-actions-optimization"; + public static final String MAX_PREVENTIVE_SEARCH_TREE_DEPTH = "max-preventive-search-tree-depth"; public static final String MAX_AUTO_SEARCH_TREE_DEPTH = "max-auto-search-tree-depth"; public static final String MAX_CURATIVE_SEARCH_TREE_DEPTH = "max-curative-search-tree-depth"; @@ -61,38 +67,24 @@ private RaoParametersCommons() { // Multi-threading parameters public static final String MULTI_THREADING = "multi-threading"; - public static final String MULTI_THREADING_SECTION = "rao-multi-threading"; - public static final String CONTINGENCY_SCENARIOS_IN_PARALLEL = "contingency-scenarios-in-parallel"; - public static final String PREVENTIVE_LEAVES_IN_PARALLEL = "preventive-leaves-in-parallel"; - public static final String AUTO_LEAVES_IN_PARALLEL = "auto-leaves-in-parallel"; - public static final String CURATIVE_LEAVES_IN_PARALLEL = "curative-leaves-in-parallel"; + public static final String MULTI_THREADING_SECTION = "search-tree-multi-threading"; + public static final String AVAILABLE_CPUS = "available-cpus"; // Second Preventive RAO parameters public static final String SECOND_PREVENTIVE_RAO = "second-preventive-rao"; - public static final String SECOND_PREVENTIVE_RAO_SECTION = "rao-second-preventive-rao"; + public static final String SECOND_PREVENTIVE_RAO_SECTION = "search-tree-second-preventive-rao"; public static final String EXECUTION_CONDITION = "execution-condition"; public static final String RE_OPTIMIZE_CURATIVE_RANGE_ACTIONS = "re-optimize-curative-range-actions"; public static final String HINT_FROM_FIRST_PREVENTIVE_RAO = "hint-from-first-preventive-rao"; - // RA usage limits per contingency parameters - public static final String RA_USAGE_LIMITS_PER_CONTINGENCY = "ra-usage-limits-per-contingency"; - public static final String RA_USAGE_LIMITS_PER_CONTINGENCY_SECTION = "rao-ra-usage-limits-per-contingency"; - - public static final String MAX_CURATIVE_RA = "max-curative-ra"; - public static final String MAX_CURATIVE_TSO = "max-curative-tso"; - public static final String MAX_CURATIVE_TOPO_PER_TSO = "max-curative-topo-per-tso"; - public static final String MAX_CURATIVE_PST_PER_TSO = "max-curative-pst-per-tso"; - public static final String MAX_CURATIVE_RA_PER_TSO = "max-curative-ra-per-tso"; - // Not optimized cnecs parameters public static final String NOT_OPTIMIZED_CNECS = "not-optimized-cnecs"; public static final String NOT_OPTIMIZED_CNECS_SECTION = "rao-not-optimized-cnecs"; public static final String DO_NOT_OPTIMIZE_CURATIVE_CNECS = "do-not-optimize-curative-cnecs-for-tsos-without-cras"; - // Not optimized cnecs parameters + // Load flow and sensitivity parameters public static final String LOAD_FLOW_AND_SENSITIVITY_COMPUTATION = "load-flow-and-sensitivity-computation"; - public static final String LOAD_FLOW_AND_SENSITIVITY_COMPUTATION_SECTION = "rao-load-flow-and-sensitivity-computation"; - + public static final String LOAD_FLOW_AND_SENSITIVITY_COMPUTATION_SECTION = "search-tree-load-flow-and-sensitivity-computation"; public static final String LOAD_FLOW_PROVIDER = "load-flow-provider"; public static final String SENSITIVITY_PROVIDER = "sensitivity-provider"; public static final String SENSITIVITY_FAILURE_OVERCOST = "sensitivity-failure-overcost"; @@ -105,6 +97,7 @@ private RaoParametersCommons() { // -- LoopFlow parameters public static final String LOOP_FLOW_PARAMETERS = "loop-flow-parameters"; public static final String LOOP_FLOW_PARAMETERS_SECTION = "rao-loop-flow-parameters"; + public static final String ST_LOOP_FLOW_PARAMETERS_SECTION = "search-tree-loop-flow-parameters"; public static final String ACCEPTABLE_INCREASE = "acceptable-increase"; public static final String COUNTRIES = "countries"; @@ -112,14 +105,18 @@ private RaoParametersCommons() { // -- Mnec parameters public static final String MNEC_PARAMETERS = "mnec-parameters"; public static final String MNEC_PARAMETERS_SECTION = "rao-mnec-parameters"; + public static final String ST_MNEC_PARAMETERS_SECTION = "search-tree-mnec-parameters"; public static final String ACCEPTABLE_MARGIN_DECREASE = "acceptable-margin-decrease"; // -- Relative margins parameters public static final String RELATIVE_MARGINS = "relative-margins-parameters"; public static final String RELATIVE_MARGINS_SECTION = "rao-relative-margins-parameters"; + public static final String ST_RELATIVE_MARGINS_SECTION = "search-tree-relative-margins-parameters"; + public static final String PTDF_BOUNDARIES = "ptdf-boundaries"; public static final String PTDF_SUM_LOWER_BOUND = "ptdf-sum-lower-bound"; + public static final String SEARCH_TREE_PARAMETERS = "open-rao-search-tree-parameters"; public static PtdfApproximation stringToPtdfApproximation(String string) { try { diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonLoopFlowParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonLoopFlowParameters.java new file mode 100644 index 0000000000..ee83eac7d2 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonLoopFlowParameters.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.json; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + */ +public final class JsonLoopFlowParameters { + + private JsonLoopFlowParameters() { + } + + static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException { + Optional optionalLoopFlowParameters = parameters.getLoopFlowParameters(); + if (optionalLoopFlowParameters.isPresent()) { + jsonGenerator.writeObjectFieldStart(LOOP_FLOW_PARAMETERS); + jsonGenerator.writeNumberField(ACCEPTABLE_INCREASE, optionalLoopFlowParameters.get().getAcceptableIncrease()); + jsonGenerator.writeFieldName(COUNTRIES); + jsonGenerator.writeStartArray(); + optionalLoopFlowParameters.get().getCountries().stream().map(Enum::toString).sorted().forEach(s -> { + try { + jsonGenerator.writeString(s); + } catch (IOException e) { + throw new OpenRaoException("error while serializing loopflow countries", e); + } + }); + jsonGenerator.writeEndArray(); + jsonGenerator.writeEndObject(); + } + } + + static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { + LoopFlowParameters loopFlowParameters = new LoopFlowParameters(); + while (!jsonParser.nextToken().isStructEnd()) { + switch (jsonParser.getCurrentName()) { + case ACCEPTABLE_INCREASE: + jsonParser.nextToken(); + loopFlowParameters.setAcceptableIncrease(jsonParser.getDoubleValue()); + break; + case COUNTRIES: + jsonParser.nextToken(); + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode arrayNode = objectMapper.readTree(jsonParser); + List countryStrings = objectMapper.readValue(arrayNode.traverse(), new TypeReference>() { }); + loopFlowParameters.setCountries(countryStrings); + break; + default: + throw new OpenRaoException(String.format("Cannot deserialize loop flow parameters: unexpected field in %s (%s)", LOOP_FLOW_PARAMETERS, jsonParser.getCurrentName())); + } + } + raoParameters.setLoopFlowParameters(loopFlowParameters); + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonMnecParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonMnecParameters.java new file mode 100644 index 0000000000..32d1e1322d --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonMnecParameters.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.json; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.MnecParameters; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; + +import java.io.IOException; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + */ +public final class JsonMnecParameters { + + private JsonMnecParameters() { + } + + static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException { + Optional optionalMnecParameters = parameters.getMnecParameters(); + if (optionalMnecParameters.isPresent()) { + jsonGenerator.writeObjectFieldStart(MNEC_PARAMETERS); + jsonGenerator.writeNumberField(ACCEPTABLE_MARGIN_DECREASE, optionalMnecParameters.get().getAcceptableMarginDecrease()); + jsonGenerator.writeEndObject(); + } + } + + static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { + MnecParameters mnecParameters = new MnecParameters(); + while (!jsonParser.nextToken().isStructEnd()) { + if (jsonParser.getCurrentName().equals(ACCEPTABLE_MARGIN_DECREASE)) { + jsonParser.nextToken(); + mnecParameters.setAcceptableMarginDecrease(jsonParser.getDoubleValue()); + } else { + throw new OpenRaoException(String.format("Cannot deserialize mnec parameters: unexpected field in %s (%s)", MNEC_PARAMETERS, jsonParser.getCurrentName())); + } + } + raoParameters.setMnecParameters(mnecParameters); + } + +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonMultiThreadingParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonMultiThreadingParameters.java deleted file mode 100644 index 0d3f47b907..0000000000 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonMultiThreadingParameters.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.openrao.raoapi.json; - -import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; - -import java.io.IOException; - -import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; - -/** - * @author Godelaine de Montmorillon {@literal } - */ -final class JsonMultiThreadingParameters { - - private JsonMultiThreadingParameters() { - } - - static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException { - jsonGenerator.writeObjectFieldStart(MULTI_THREADING); - jsonGenerator.writeNumberField(CONTINGENCY_SCENARIOS_IN_PARALLEL, parameters.getMultithreadingParameters().getContingencyScenariosInParallel()); - jsonGenerator.writeNumberField(PREVENTIVE_LEAVES_IN_PARALLEL, parameters.getMultithreadingParameters().getPreventiveLeavesInParallel()); - jsonGenerator.writeNumberField(AUTO_LEAVES_IN_PARALLEL, parameters.getMultithreadingParameters().getAutoLeavesInParallel()); - jsonGenerator.writeNumberField(CURATIVE_LEAVES_IN_PARALLEL, parameters.getMultithreadingParameters().getCurativeLeavesInParallel()); - jsonGenerator.writeEndObject(); - } - - static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { - while (!jsonParser.nextToken().isStructEnd()) { - switch (jsonParser.getCurrentName()) { - case CONTINGENCY_SCENARIOS_IN_PARALLEL: - jsonParser.nextToken(); - raoParameters.getMultithreadingParameters().setContingencyScenariosInParallel(jsonParser.getIntValue()); - break; - case PREVENTIVE_LEAVES_IN_PARALLEL: - jsonParser.nextToken(); - raoParameters.getMultithreadingParameters().setPreventiveLeavesInParallel(jsonParser.getIntValue()); - break; - case AUTO_LEAVES_IN_PARALLEL: - jsonParser.nextToken(); - raoParameters.getMultithreadingParameters().setAutoLeavesInParallel(jsonParser.getIntValue()); - break; - case CURATIVE_LEAVES_IN_PARALLEL: - jsonParser.nextToken(); - raoParameters.getMultithreadingParameters().setCurativeLeavesInParallel(jsonParser.getIntValue()); - break; - default: - throw new OpenRaoException(String.format("Cannot deserialize multi-threading parameters: unexpected field in %s (%s)", MULTI_THREADING, jsonParser.getCurrentName())); - } - } - } -} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonNotOptimizedCnecsParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonNotOptimizedCnecsParameters.java index 649361b3cf..59de6f89ad 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonNotOptimizedCnecsParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonNotOptimizedCnecsParameters.java @@ -31,13 +31,11 @@ static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) thr static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { while (!jsonParser.nextToken().isStructEnd()) { - switch (jsonParser.getCurrentName()) { - case DO_NOT_OPTIMIZE_CURATIVE_CNECS: - jsonParser.nextToken(); - raoParameters.getNotOptimizedCnecsParameters().setDoNotOptimizeCurativeCnecsForTsosWithoutCras(jsonParser.getBooleanValue()); - break; - default: - throw new OpenRaoException(String.format("Cannot deserialize not optimized cnecs parameters: unexpected field in %s (%s)", NOT_OPTIMIZED_CNECS, jsonParser.getCurrentName())); + if (jsonParser.getCurrentName().equals(DO_NOT_OPTIMIZE_CURATIVE_CNECS)) { + jsonParser.nextToken(); + raoParameters.getNotOptimizedCnecsParameters().setDoNotOptimizeCurativeCnecsForTsosWithoutCras(jsonParser.getBooleanValue()); + } else { + throw new OpenRaoException(String.format("Cannot deserialize not optimized cnecs parameters: unexpected field in %s (%s)", NOT_OPTIMIZED_CNECS, jsonParser.getCurrentName())); } } } 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..f9edee5899 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,8 +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(PREVENTIVE_STOP_CRITERION, parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()); - jsonGenerator.writeNumberField(CURATIVE_MIN_OBJ_IMPROVEMENT, parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement()); + jsonGenerator.writeObjectField(UNIT, parameters.getObjectiveFunctionParameters().getUnit()); jsonGenerator.writeBooleanField(ENFORCE_CURATIVE_SECURITY, parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()); jsonGenerator.writeEndObject(); } @@ -39,12 +39,8 @@ static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) thro case TYPE: raoParameters.getObjectiveFunctionParameters().setType(stringToObjectiveFunction(jsonParser.nextTextValue())); break; - case PREVENTIVE_STOP_CRITERION: - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(stringToPreventiveStopCriterion(jsonParser.nextTextValue())); - break; - case CURATIVE_MIN_OBJ_IMPROVEMENT: - jsonParser.nextToken(); - raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(jsonParser.getValueAsDouble()); + case UNIT: + raoParameters.getObjectiveFunctionParameters().setUnit(stringToObjectiveFunctionUnit(jsonParser.nextTextValue())); break; case ENFORCE_CURATIVE_SECURITY: jsonParser.nextToken(); @@ -64,12 +60,17 @@ private static ObjectiveFunctionParameters.ObjectiveFunctionType stringToObjecti } } - private static ObjectiveFunctionParameters.PreventiveStopCriterion stringToPreventiveStopCriterion(String string) { + private static Unit stringToObjectiveFunctionUnit(String string) { + Unit unit; try { - return ObjectiveFunctionParameters.PreventiveStopCriterion.valueOf(string); + unit = Unit.getEnum(string); } catch (IllegalArgumentException e) { - throw new OpenRaoException(String.format("Unknown preventive stop criterion: %s", string)); + 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; } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonRangeActionsOptimizationParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonRangeActionsOptimizationParameters.java index 90dde1a5e2..6d628c1ce9 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonRangeActionsOptimizationParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonRangeActionsOptimizationParameters.java @@ -7,7 +7,6 @@ package com.powsybl.openrao.raoapi.json; import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -26,111 +25,30 @@ private JsonRangeActionsOptimizationParameters() { static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeObjectFieldStart(RANGE_ACTIONS_OPTIMIZATION); - jsonGenerator.writeNumberField(MAX_MIP_ITERATIONS, parameters.getRangeActionsOptimizationParameters().getMaxMipIterations()); - jsonGenerator.writeNumberField(PST_PENALTY_COST, parameters.getRangeActionsOptimizationParameters().getPstPenaltyCost()); - jsonGenerator.writeNumberField(PST_SENSITIVITY_THRESHOLD, parameters.getRangeActionsOptimizationParameters().getPstSensitivityThreshold()); - jsonGenerator.writeObjectField(PST_MODEL, parameters.getRangeActionsOptimizationParameters().getPstModel()); - jsonGenerator.writeNumberField(HVDC_PENALTY_COST, parameters.getRangeActionsOptimizationParameters().getHvdcPenaltyCost()); - jsonGenerator.writeNumberField(HVDC_SENSITIVITY_THRESHOLD, parameters.getRangeActionsOptimizationParameters().getHvdcSensitivityThreshold()); - jsonGenerator.writeNumberField(INJECTION_RA_PENALTY_COST, parameters.getRangeActionsOptimizationParameters().getInjectionRaPenaltyCost()); - jsonGenerator.writeNumberField(INJECTION_RA_SENSITIVITY_THRESHOLD, parameters.getRangeActionsOptimizationParameters().getInjectionRaSensitivityThreshold()); - jsonGenerator.writeObjectField(RA_RANGE_SHRINKING, parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking()); - jsonGenerator.writeObjectFieldStart(LINEAR_OPTIMIZATION_SOLVER); - jsonGenerator.writeObjectField(SOLVER, parameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getSolver()); - jsonGenerator.writeNumberField(RELATIVE_MIP_GAP, parameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getRelativeMipGap()); - jsonGenerator.writeStringField(SOLVER_SPECIFIC_PARAMETERS, parameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getSolverSpecificParameters()); - jsonGenerator.writeEndObject(); + jsonGenerator.writeNumberField(PST_RA_MIN_IMPACT_THRESHOLD, parameters.getRangeActionsOptimizationParameters().getPstRAMinImpactThreshold()); + jsonGenerator.writeNumberField(HVDC_RA_MIN_IMPACT_THRESHOLD, parameters.getRangeActionsOptimizationParameters().getHvdcRAMinImpactThreshold()); + jsonGenerator.writeNumberField(INJECTION_RA_MIN_IMPACT_THRESHOLD, parameters.getRangeActionsOptimizationParameters().getInjectionRAMinImpactThreshold()); jsonGenerator.writeEndObject(); } static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { while (!jsonParser.nextToken().isStructEnd()) { switch (jsonParser.getCurrentName()) { - case MAX_MIP_ITERATIONS: + case PST_RA_MIN_IMPACT_THRESHOLD: jsonParser.nextToken(); - raoParameters.getRangeActionsOptimizationParameters().setMaxMipIterations(jsonParser.getIntValue()); + raoParameters.getRangeActionsOptimizationParameters().setPstRAMinImpactThreshold(jsonParser.getDoubleValue()); break; - case PST_PENALTY_COST: + case HVDC_RA_MIN_IMPACT_THRESHOLD: jsonParser.nextToken(); - raoParameters.getRangeActionsOptimizationParameters().setPstPenaltyCost(jsonParser.getDoubleValue()); + raoParameters.getRangeActionsOptimizationParameters().setHvdcRAMinImpactThreshold(jsonParser.getDoubleValue()); break; - case PST_SENSITIVITY_THRESHOLD: + case INJECTION_RA_MIN_IMPACT_THRESHOLD: jsonParser.nextToken(); - raoParameters.getRangeActionsOptimizationParameters().setPstSensitivityThreshold(jsonParser.getDoubleValue()); - break; - case PST_MODEL: - raoParameters.getRangeActionsOptimizationParameters().setPstModel(stringToPstModel(jsonParser.nextTextValue())); - break; - case HVDC_PENALTY_COST: - jsonParser.nextToken(); - raoParameters.getRangeActionsOptimizationParameters().setHvdcPenaltyCost(jsonParser.getDoubleValue()); - break; - case HVDC_SENSITIVITY_THRESHOLD: - jsonParser.nextToken(); - raoParameters.getRangeActionsOptimizationParameters().setHvdcSensitivityThreshold(jsonParser.getDoubleValue()); - break; - case INJECTION_RA_PENALTY_COST: - jsonParser.nextToken(); - raoParameters.getRangeActionsOptimizationParameters().setInjectionRaPenaltyCost(jsonParser.getDoubleValue()); - break; - case INJECTION_RA_SENSITIVITY_THRESHOLD: - jsonParser.nextToken(); - raoParameters.getRangeActionsOptimizationParameters().setInjectionRaSensitivityThreshold(jsonParser.getDoubleValue()); - break; - case LINEAR_OPTIMIZATION_SOLVER: - jsonParser.nextToken(); - deserializeLinearOptimizationSolver(jsonParser, raoParameters); - break; - case RA_RANGE_SHRINKING: - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(stringToRaRangeShrinking(jsonParser.nextTextValue())); + raoParameters.getRangeActionsOptimizationParameters().setInjectionRAMinImpactThreshold(jsonParser.getDoubleValue()); break; default: throw new OpenRaoException(String.format("Cannot deserialize range action optimization parameters: unexpected field in %s (%s)", RANGE_ACTIONS_OPTIMIZATION, jsonParser.getCurrentName())); } } } - - private static void deserializeLinearOptimizationSolver(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { - while (!jsonParser.nextToken().isStructEnd()) { - switch (jsonParser.getCurrentName()) { - case SOLVER: - raoParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setSolver(stringToSolver(jsonParser.nextTextValue())); - break; - case RELATIVE_MIP_GAP: - jsonParser.nextToken(); - raoParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setRelativeMipGap(jsonParser.getDoubleValue()); - break; - case SOLVER_SPECIFIC_PARAMETERS: - jsonParser.nextToken(); - raoParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setSolverSpecificParameters(jsonParser.getValueAsString()); - break; - default: - throw new OpenRaoException(String.format("Cannot deserialize linear optimization solver in range action optimization parameters: unexpected field in %s (%s)", LINEAR_OPTIMIZATION_SOLVER, jsonParser.getCurrentName())); - } - } - } - - private static RangeActionsOptimizationParameters.PstModel stringToPstModel(String string) { - try { - return RangeActionsOptimizationParameters.PstModel.valueOf(string); - } catch (IllegalArgumentException e) { - throw new OpenRaoException(String.format("Unknown Pst model: %s", string)); - } - } - - private static RangeActionsOptimizationParameters.RaRangeShrinking stringToRaRangeShrinking(String string) { - try { - return RangeActionsOptimizationParameters.RaRangeShrinking.valueOf(string); - } catch (IllegalArgumentException e) { - throw new OpenRaoException(String.format("Unknown Pst variation range shrinking: %s", string)); - } - } - - private static RangeActionsOptimizationParameters.Solver stringToSolver(String string) { - try { - return RangeActionsOptimizationParameters.Solver.valueOf(string); - } catch (IllegalArgumentException e) { - throw new OpenRaoException(String.format("Unknown solver: %s", string)); - } - } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonRelativeMarginsParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonRelativeMarginsParameters.java new file mode 100644 index 0000000000..cc5307af93 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonRelativeMarginsParameters.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.json; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + */ +public final class JsonRelativeMarginsParameters { + + private JsonRelativeMarginsParameters() { + } + + static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException { + Optional optionalRelativeMarginsParameters = parameters.getRelativeMarginsParameters(); + if (optionalRelativeMarginsParameters.isPresent()) { + jsonGenerator.writeObjectFieldStart(RELATIVE_MARGINS); + jsonGenerator.writeArrayFieldStart(PTDF_BOUNDARIES); + for (String ptdfBoundary : optionalRelativeMarginsParameters.get().getPtdfBoundariesAsString()) { + jsonGenerator.writeString(ptdfBoundary); + } + jsonGenerator.writeEndArray(); + jsonGenerator.writeEndObject(); + } + } + + static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { + RelativeMarginsParameters relativeMarginsParameters = new RelativeMarginsParameters(); + while (!jsonParser.nextToken().isStructEnd()) { + if (jsonParser.getCurrentName().equals(PTDF_BOUNDARIES)) { + if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) { + List boundaries = new ArrayList<>(); + while (jsonParser.nextToken() != JsonToken.END_ARRAY) { + boundaries.add(jsonParser.getValueAsString()); + } + relativeMarginsParameters.setPtdfBoundariesFromString(boundaries); + } + } else { + throw new OpenRaoException(String.format("Cannot deserialize relative margins parameters: unexpected field in %s (%s)", RELATIVE_MARGINS, jsonParser.getCurrentName())); + } + } + raoParameters.setRelativeMarginsParameters(relativeMarginsParameters); + } + +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonTopoOptimizationParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonTopoOptimizationParameters.java index 5e8f170f34..90ba2ee400 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonTopoOptimizationParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonTopoOptimizationParameters.java @@ -6,14 +6,12 @@ */ package com.powsybl.openrao.raoapi.json; -import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; @@ -27,44 +25,14 @@ private JsonTopoOptimizationParameters() { static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeObjectFieldStart(TOPOLOGICAL_ACTIONS_OPTIMIZATION); - jsonGenerator.writeNumberField(MAX_PREVENTIVE_SEARCH_TREE_DEPTH, parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth()); - jsonGenerator.writeNumberField(MAX_AUTO_SEARCH_TREE_DEPTH, parameters.getTopoOptimizationParameters().getMaxAutoSearchTreeDepth()); - jsonGenerator.writeNumberField(MAX_CURATIVE_SEARCH_TREE_DEPTH, parameters.getTopoOptimizationParameters().getMaxCurativeSearchTreeDepth()); - jsonGenerator.writeFieldName(PREDEFINED_COMBINATIONS); - jsonGenerator.writeStartArray(); - for (List naIdCombination : parameters.getTopoOptimizationParameters().getPredefinedCombinations()) { - jsonGenerator.writeStartArray(); - for (String naId : naIdCombination) { - jsonGenerator.writeString(naId); - } - jsonGenerator.writeEndArray(); - } - jsonGenerator.writeEndArray(); jsonGenerator.writeNumberField(RELATIVE_MINIMUM_IMPACT_THRESHOLD, parameters.getTopoOptimizationParameters().getRelativeMinImpactThreshold()); jsonGenerator.writeNumberField(ABSOLUTE_MINIMUM_IMPACT_THRESHOLD, parameters.getTopoOptimizationParameters().getAbsoluteMinImpactThreshold()); - jsonGenerator.writeBooleanField(SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT, parameters.getTopoOptimizationParameters().getSkipActionsFarFromMostLimitingElement()); - jsonGenerator.writeNumberField(MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS, parameters.getTopoOptimizationParameters().getMaxNumberOfBoundariesForSkippingActions()); jsonGenerator.writeEndObject(); } static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { while (!jsonParser.nextToken().isStructEnd()) { switch (jsonParser.getCurrentName()) { - case MAX_PREVENTIVE_SEARCH_TREE_DEPTH: - jsonParser.nextToken(); - raoParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(jsonParser.getIntValue()); - break; - case MAX_AUTO_SEARCH_TREE_DEPTH: - jsonParser.nextToken(); - raoParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(jsonParser.getIntValue()); - break; - case MAX_CURATIVE_SEARCH_TREE_DEPTH: - jsonParser.nextToken(); - raoParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(jsonParser.getIntValue()); - break; - case PREDEFINED_COMBINATIONS: - raoParameters.getTopoOptimizationParameters().setPredefinedCombinations(readListOfListOfString(jsonParser)); - break; case RELATIVE_MINIMUM_IMPACT_THRESHOLD: jsonParser.nextToken(); raoParameters.getTopoOptimizationParameters().setRelativeMinImpactThreshold(jsonParser.getDoubleValue()); @@ -73,26 +41,9 @@ static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) thro jsonParser.nextToken(); raoParameters.getTopoOptimizationParameters().setAbsoluteMinImpactThreshold(jsonParser.getDoubleValue()); break; - case SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT: - jsonParser.nextToken(); - raoParameters.getTopoOptimizationParameters().setSkipActionsFarFromMostLimitingElement(jsonParser.getBooleanValue()); - break; - case MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS: - jsonParser.nextToken(); - raoParameters.getTopoOptimizationParameters().setMaxNumberOfBoundariesForSkippingActions(jsonParser.getIntValue()); - break; default: throw new OpenRaoException(String.format("Cannot deserialize topological optimization parameters: unexpected field in %s (%s)", TOPOLOGICAL_ACTIONS_OPTIMIZATION, jsonParser.getCurrentName())); } } } - - private static List> readListOfListOfString(JsonParser jsonParser) throws IOException { - List> parsedListOfList = new ArrayList<>(); - jsonParser.nextToken(); - while (!jsonParser.nextToken().isStructEnd()) { - parsedListOfList.add(jsonParser.readValueAs(ArrayList.class)); - } - return parsedListOfList; - } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/RaoParametersDeserializer.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/RaoParametersDeserializer.java index 4940b38dc3..b942bd20cb 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/RaoParametersDeserializer.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/RaoParametersDeserializer.java @@ -6,20 +6,21 @@ */ package com.powsybl.openrao.raoapi.json; -import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.powsybl.commons.extensions.Extension; import com.powsybl.commons.json.JsonUtil; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; import java.io.IOException; import java.util.Collections; import java.util.List; import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; +import static com.powsybl.openrao.raoapi.parameters.RaoParameters.addOptionalExtensionsDefaultValuesIfExist; /** * @author Baptiste Seguinot {@literal } @@ -59,21 +60,21 @@ public RaoParameters deserialize(JsonParser parser, DeserializationContext deser parser.nextToken(); JsonTopoOptimizationParameters.deserialize(parser, parameters); break; - case MULTI_THREADING: + case NOT_OPTIMIZED_CNECS: parser.nextToken(); - JsonMultiThreadingParameters.deserialize(parser, parameters); + JsonNotOptimizedCnecsParameters.deserialize(parser, parameters); break; - case SECOND_PREVENTIVE_RAO: + case MNEC_PARAMETERS: parser.nextToken(); - JsonSecondPreventiveRaoParameters.deserialize(parser, parameters); + JsonMnecParameters.deserialize(parser, parameters); break; - case NOT_OPTIMIZED_CNECS: + case RELATIVE_MARGINS: parser.nextToken(); - JsonNotOptimizedCnecsParameters.deserialize(parser, parameters); + JsonRelativeMarginsParameters.deserialize(parser, parameters); break; - case LOAD_FLOW_AND_SENSITIVITY_COMPUTATION: + case LOOP_FLOW_PARAMETERS: parser.nextToken(); - JsonLoadFlowAndSensitivityComputationParameters.deserialize(parser, parameters); + JsonLoopFlowParameters.deserialize(parser, parameters); break; case "extensions": parser.nextToken(); @@ -84,6 +85,7 @@ public RaoParameters deserialize(JsonParser parser, DeserializationContext deser } } extensions.forEach(extension -> parameters.addExtension((Class) extension.getClass(), extension)); + addOptionalExtensionsDefaultValuesIfExist(parameters); return parameters; } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/RaoParametersSerializer.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/RaoParametersSerializer.java index 4bec9c675f..bba41e3c47 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/RaoParametersSerializer.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/RaoParametersSerializer.java @@ -6,11 +6,11 @@ */ package com.powsybl.openrao.raoapi.json; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; import com.powsybl.commons.json.JsonUtil; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; import java.io.IOException; @@ -32,10 +32,10 @@ public void serialize(RaoParameters parameters, JsonGenerator jsonGenerator, Ser JsonObjectiveFunctionParameters.serialize(parameters, jsonGenerator); JsonRangeActionsOptimizationParameters.serialize(parameters, jsonGenerator); JsonTopoOptimizationParameters.serialize(parameters, jsonGenerator); - JsonSecondPreventiveRaoParameters.serialize(parameters, jsonGenerator); JsonNotOptimizedCnecsParameters.serialize(parameters, jsonGenerator); - JsonLoadFlowAndSensitivityComputationParameters.serialize(parameters, jsonGenerator, serializerProvider); - JsonMultiThreadingParameters.serialize(parameters, jsonGenerator); + JsonMnecParameters.serialize(parameters, jsonGenerator); + JsonRelativeMarginsParameters.serialize(parameters, jsonGenerator); + JsonLoopFlowParameters.serialize(parameters, jsonGenerator); JsonUtil.writeExtensions(parameters, jsonGenerator, serializerProvider, JsonRaoParameters.getExtensionSerializers()); jsonGenerator.writeEndObject(); } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonLoadFlowAndSensitivityComputationParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoadFlowAndSensitivityComputationParameters.java similarity index 68% rename from ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonLoadFlowAndSensitivityComputationParameters.java rename to ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoadFlowAndSensitivityComputationParameters.java index 2e5fee5476..c63ae28e08 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonLoadFlowAndSensitivityComputationParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoadFlowAndSensitivityComputationParameters.java @@ -4,13 +4,13 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package com.powsybl.openrao.raoapi.json; +package com.powsybl.openrao.raoapi.json.extensions; -import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.SerializerProvider; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; import com.powsybl.sensitivity.json.JsonSensitivityAnalysisParameters; import java.io.IOException; @@ -25,7 +25,7 @@ final class JsonLoadFlowAndSensitivityComputationParameters { private JsonLoadFlowAndSensitivityComputationParameters() { } - static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + static void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { jsonGenerator.writeObjectFieldStart(LOAD_FLOW_AND_SENSITIVITY_COMPUTATION); jsonGenerator.writeStringField(LOAD_FLOW_PROVIDER, parameters.getLoadFlowAndSensitivityParameters().getLoadFlowProvider()); jsonGenerator.writeStringField(SENSITIVITY_PROVIDER, parameters.getLoadFlowAndSensitivityParameters().getSensitivityProvider()); @@ -35,24 +35,24 @@ static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator, Ser jsonGenerator.writeEndObject(); } - static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { + static void deserialize(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { while (!jsonParser.nextToken().isStructEnd()) { switch (jsonParser.getCurrentName()) { case LOAD_FLOW_PROVIDER: jsonParser.nextToken(); - raoParameters.getLoadFlowAndSensitivityParameters().setLoadFlowProvider(jsonParser.getValueAsString()); + searchTreeParameters.getLoadFlowAndSensitivityParameters().setLoadFlowProvider(jsonParser.getValueAsString()); break; case SENSITIVITY_PROVIDER: jsonParser.nextToken(); - raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityProvider(jsonParser.getValueAsString()); + searchTreeParameters.getLoadFlowAndSensitivityParameters().setSensitivityProvider(jsonParser.getValueAsString()); break; case SENSITIVITY_FAILURE_OVERCOST: jsonParser.nextToken(); - raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(jsonParser.getValueAsDouble()); + searchTreeParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(jsonParser.getValueAsDouble()); break; case SENSITIVITY_PARAMETERS: jsonParser.nextToken(); - raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityWithLoadFlowParameters(JsonSensitivityAnalysisParameters.createObjectMapper().readerForUpdating(raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters()).readValue(jsonParser)); + searchTreeParameters.getLoadFlowAndSensitivityParameters().setSensitivityWithLoadFlowParameters(JsonSensitivityAnalysisParameters.createObjectMapper().readerForUpdating(searchTreeParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters()).readValue(jsonParser)); break; default: throw new OpenRaoException(String.format("Cannot deserialize load flow and sensitivity parameters: unexpected field in %s (%s)", LOAD_FLOW_AND_SENSITIVITY_COMPUTATION, jsonParser.getCurrentName())); diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoopFlowParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoopFlowParameters.java new file mode 100644 index 0000000000..b43b2474b4 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoopFlowParameters.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.json.extensions; + +import com.powsybl.openrao.commons.OpenRaoException; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; + +import java.io.IOException; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + */ +public final class JsonLoopFlowParameters { + + private JsonLoopFlowParameters() { + } + + static void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator) throws IOException { + Optional optionalLoopFlowParameters = parameters.getLoopFlowParameters(); + if (optionalLoopFlowParameters.isPresent()) { + jsonGenerator.writeObjectFieldStart(LOOP_FLOW_PARAMETERS); + jsonGenerator.writeObjectField(PTDF_APPROXIMATION, optionalLoopFlowParameters.get().getPtdfApproximation()); + jsonGenerator.writeNumberField(CONSTRAINT_ADJUSTMENT_COEFFICIENT, optionalLoopFlowParameters.get().getConstraintAdjustmentCoefficient()); + jsonGenerator.writeNumberField(VIOLATION_COST, optionalLoopFlowParameters.get().getViolationCost()); + jsonGenerator.writeEndObject(); + } + } + + static void deserialize(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { + SearchTreeRaoLoopFlowParameters loopFlowParameters = new SearchTreeRaoLoopFlowParameters(); + while (!jsonParser.nextToken().isStructEnd()) { + switch (jsonParser.getCurrentName()) { + case PTDF_APPROXIMATION: + loopFlowParameters.setPtdfApproximation(stringToPtdfApproximation(jsonParser.nextTextValue())); + break; + case CONSTRAINT_ADJUSTMENT_COEFFICIENT: + jsonParser.nextToken(); + loopFlowParameters.setConstraintAdjustmentCoefficient(jsonParser.getDoubleValue()); + break; + case VIOLATION_COST: + jsonParser.nextToken(); + loopFlowParameters.setViolationCost(jsonParser.getDoubleValue()); + break; + default: + throw new OpenRaoException(String.format("Cannot deserialize loop flow parameters: unexpected field in %s (%s)", LOOP_FLOW_PARAMETERS, jsonParser.getCurrentName())); + } + } + searchTreeParameters.setLoopFlowParameters(loopFlowParameters); + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoopFlowParametersExtension.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoopFlowParametersExtension.java deleted file mode 100644 index 4c1f843409..0000000000 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonLoopFlowParametersExtension.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.openrao.raoapi.json.extensions; - -import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.json.JsonRaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.google.auto.service.AutoService; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; - -/** - * @author Godelaine de Montmorillon {@literal } - */ -@AutoService(JsonRaoParameters.ExtensionSerializer.class) -public class JsonLoopFlowParametersExtension implements JsonRaoParameters.ExtensionSerializer { - - @Override - public void serialize(LoopFlowParametersExtension loopFlowParameters, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { - jsonGenerator.writeStartObject(); - jsonGenerator.writeNumberField(ACCEPTABLE_INCREASE, loopFlowParameters.getAcceptableIncrease()); - jsonGenerator.writeObjectField(PTDF_APPROXIMATION, loopFlowParameters.getPtdfApproximation()); - jsonGenerator.writeNumberField(CONSTRAINT_ADJUSTMENT_COEFFICIENT, loopFlowParameters.getConstraintAdjustmentCoefficient()); - jsonGenerator.writeNumberField(VIOLATION_COST, loopFlowParameters.getViolationCost()); - jsonGenerator.writeFieldName(COUNTRIES); - jsonGenerator.writeStartArray(); - loopFlowParameters.getCountries().stream().map(Enum::toString).sorted().forEach(s -> { - try { - jsonGenerator.writeString(s); - } catch (IOException e) { - throw new OpenRaoException("error while serializing loopflow countries", e); - } - }); - jsonGenerator.writeEndArray(); - jsonGenerator.writeEndObject(); - } - - @Override - public LoopFlowParametersExtension deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { - return deserializeAndUpdate(jsonParser, deserializationContext, new LoopFlowParametersExtension()); - } - - @Override - public LoopFlowParametersExtension deserializeAndUpdate(JsonParser jsonParser, DeserializationContext deserializationContext, LoopFlowParametersExtension parameters) throws IOException { - while (!jsonParser.nextToken().isStructEnd()) { - switch (jsonParser.getCurrentName()) { - case ACCEPTABLE_INCREASE: - jsonParser.nextToken(); - parameters.setAcceptableIncrease(jsonParser.getDoubleValue()); - break; - case PTDF_APPROXIMATION: - parameters.setPtdfApproximation(stringToPtdfApproximation(jsonParser.nextTextValue())); - break; - case CONSTRAINT_ADJUSTMENT_COEFFICIENT: - jsonParser.nextToken(); - parameters.setConstraintAdjustmentCoefficient(jsonParser.getDoubleValue()); - break; - case VIOLATION_COST: - jsonParser.nextToken(); - parameters.setViolationCost(jsonParser.getDoubleValue()); - break; - case COUNTRIES: - jsonParser.nextToken(); - ObjectMapper objectMapper = new ObjectMapper(); - JsonNode arrayNode = objectMapper.readTree(jsonParser); - List countryStrings = objectMapper.readValue(arrayNode.traverse(), new TypeReference>() { }); - parameters.setCountries(countryStrings); - break; - default: - throw new OpenRaoException(String.format("Cannot deserialize loop flow parameters: unexpected field in %s (%s)", LOOP_FLOW_PARAMETERS, jsonParser.getCurrentName())); - } - } - return parameters; - } - - @Override - public String getExtensionName() { - return LOOP_FLOW_PARAMETERS; - } - - @Override - public String getCategoryName() { - return "rao-parameters"; - } - - @Override - public Class getExtensionClass() { - return LoopFlowParametersExtension.class; - } -} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMnecParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMnecParameters.java new file mode 100644 index 0000000000..d17f1ca27b --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMnecParameters.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.json.extensions; + +import com.powsybl.openrao.commons.OpenRaoException; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoMnecParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; + +import java.io.IOException; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + */ +public final class JsonMnecParameters { + + private JsonMnecParameters() { + } + + static void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator) throws IOException { + Optional optionalMnecParameters = parameters.getMnecParameters(); + if (optionalMnecParameters.isPresent()) { + jsonGenerator.writeObjectFieldStart(MNEC_PARAMETERS); + jsonGenerator.writeNumberField(VIOLATION_COST, optionalMnecParameters.get().getViolationCost()); + jsonGenerator.writeNumberField(CONSTRAINT_ADJUSTMENT_COEFFICIENT, optionalMnecParameters.get().getConstraintAdjustmentCoefficient()); + jsonGenerator.writeEndObject(); + } + } + + static void deserialize(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { + SearchTreeRaoMnecParameters mnecParameters = new SearchTreeRaoMnecParameters(); + while (!jsonParser.nextToken().isStructEnd()) { + switch (jsonParser.getCurrentName()) { + case VIOLATION_COST: + jsonParser.nextToken(); + mnecParameters.setViolationCost(jsonParser.getDoubleValue()); + break; + case CONSTRAINT_ADJUSTMENT_COEFFICIENT: + jsonParser.nextToken(); + mnecParameters.setConstraintAdjustmentCoefficient(jsonParser.getDoubleValue()); + break; + default: + throw new OpenRaoException(String.format("Cannot deserialize mnec parameters: unexpected field in %s (%s)", MNEC_PARAMETERS, jsonParser.getCurrentName())); + } + } + searchTreeParameters.setMnecParameters(mnecParameters); + } + +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMnecParametersExtension.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMnecParametersExtension.java deleted file mode 100644 index 3ba75570fa..0000000000 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMnecParametersExtension.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.openrao.raoapi.json.extensions; - -import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.json.JsonRaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.google.auto.service.AutoService; - -import java.io.IOException; - -import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; - -/** - * @author Godelaine de Montmorillon {@literal } - */ -@AutoService(JsonRaoParameters.ExtensionSerializer.class) -public class JsonMnecParametersExtension implements JsonRaoParameters.ExtensionSerializer { - - @Override - public void serialize(MnecParametersExtension mnecParameters, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { - jsonGenerator.writeStartObject(); - jsonGenerator.writeNumberField(ACCEPTABLE_MARGIN_DECREASE, mnecParameters.getAcceptableMarginDecrease()); - jsonGenerator.writeNumberField(VIOLATION_COST, mnecParameters.getViolationCost()); - jsonGenerator.writeNumberField(CONSTRAINT_ADJUSTMENT_COEFFICIENT, mnecParameters.getConstraintAdjustmentCoefficient()); - jsonGenerator.writeEndObject(); - } - - @Override - public MnecParametersExtension deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { - return deserializeAndUpdate(jsonParser, deserializationContext, new MnecParametersExtension()); - } - - @Override - public MnecParametersExtension deserializeAndUpdate(JsonParser jsonParser, DeserializationContext deserializationContext, MnecParametersExtension parameters) throws IOException { - while (!jsonParser.nextToken().isStructEnd()) { - switch (jsonParser.getCurrentName()) { - case ACCEPTABLE_MARGIN_DECREASE: - jsonParser.nextToken(); - parameters.setAcceptableMarginDecrease(jsonParser.getDoubleValue()); - break; - case VIOLATION_COST: - jsonParser.nextToken(); - parameters.setViolationCost(jsonParser.getDoubleValue()); - break; - case CONSTRAINT_ADJUSTMENT_COEFFICIENT: - jsonParser.nextToken(); - parameters.setConstraintAdjustmentCoefficient(jsonParser.getDoubleValue()); - break; - default: - throw new OpenRaoException(String.format("Cannot deserialize mnec parameters: unexpected field in %s (%s)", MNEC_PARAMETERS, jsonParser.getCurrentName())); - } - } - return parameters; - } - - @Override - public String getExtensionName() { - return MNEC_PARAMETERS; - } - - @Override - public String getCategoryName() { - return "rao-parameters"; - } - - @Override - public Class getExtensionClass() { - return MnecParametersExtension.class; - } - -} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMultiThreadingParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMultiThreadingParameters.java new file mode 100644 index 0000000000..dd77693895 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonMultiThreadingParameters.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.openrao.raoapi.json.extensions; + +import com.powsybl.openrao.commons.OpenRaoException; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; + +import java.io.IOException; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + * @author Pauline JEAN-MARIE {@literal } + */ +final class JsonMultiThreadingParameters { + + private JsonMultiThreadingParameters() { + } + + static void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator) throws IOException { + jsonGenerator.writeObjectFieldStart(MULTI_THREADING); + jsonGenerator.writeNumberField(AVAILABLE_CPUS, parameters.getMultithreadingParameters().getAvailableCPUs()); + jsonGenerator.writeEndObject(); + } + + static void deserialize(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { + while (!jsonParser.nextToken().isStructEnd()) { + if (jsonParser.getCurrentName().equals(AVAILABLE_CPUS)) { + jsonParser.nextToken(); + int availableCpus = jsonParser.getIntValue(); + searchTreeParameters.getMultithreadingParameters().setAvailableCPUs(availableCpus); + } else { + throw new OpenRaoException(String.format("Cannot deserialize multi-threading parameters: unexpected field in %s (%s)", MULTI_THREADING, jsonParser.getCurrentName())); + } + } + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonObjectiveFunctionParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonObjectiveFunctionParameters.java new file mode 100644 index 0000000000..8e9a6a8c4f --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonObjectiveFunctionParameters.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.json.extensions; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; + +import java.io.IOException; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + * @author Pauline JEAN-MARIE {@literal } + */ +final class JsonObjectiveFunctionParameters { + + private JsonObjectiveFunctionParameters() { + } + + static void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator) throws IOException { + jsonGenerator.writeObjectFieldStart(OBJECTIVE_FUNCTION); + jsonGenerator.writeNumberField(CURATIVE_MIN_OBJ_IMPROVEMENT, parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement()); + jsonGenerator.writeEndObject(); + } + + static void deserialize(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { + while (!jsonParser.nextToken().isStructEnd()) { + if (jsonParser.getCurrentName().equals(CURATIVE_MIN_OBJ_IMPROVEMENT)) { + jsonParser.nextToken(); + searchTreeParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(jsonParser.getValueAsDouble()); + } else { + throw new OpenRaoException(String.format("Cannot deserialize objective function parameters: unexpected field in %s (%s)", OBJECTIVE_FUNCTION, jsonParser.getCurrentName())); + } + } + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonOpenRaoSearchTreeParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonOpenRaoSearchTreeParameters.java new file mode 100644 index 0000000000..dfc7416b34 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonOpenRaoSearchTreeParameters.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ + +package com.powsybl.openrao.raoapi.json.extensions; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.google.auto.service.AutoService; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.json.*; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; + +import java.io.IOException; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Pauline JEAN-MARIE {@literal } + */ +@AutoService(JsonRaoParameters.ExtensionSerializer.class) +public class JsonOpenRaoSearchTreeParameters implements JsonRaoParameters.ExtensionSerializer { + @Override + public void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + jsonGenerator.writeStartObject(); + JsonObjectiveFunctionParameters.serialize(parameters, jsonGenerator); + JsonRangeActionsOptimizationParameters.serialize(parameters, jsonGenerator); + JsonTopoOptimizationParameters.serialize(parameters, jsonGenerator); + JsonSecondPreventiveRaoParameters.serialize(parameters, jsonGenerator); + JsonLoadFlowAndSensitivityComputationParameters.serialize(parameters, jsonGenerator, serializerProvider); + JsonMultiThreadingParameters.serialize(parameters, jsonGenerator); + JsonMnecParameters.serialize(parameters, jsonGenerator); + JsonRelativeMarginsParameters.serialize(parameters, jsonGenerator); + JsonLoopFlowParameters.serialize(parameters, jsonGenerator); + jsonGenerator.writeEndObject(); + } + + @Override + public OpenRaoSearchTreeParameters deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { + return deserializeAndUpdate(jsonParser, deserializationContext, new OpenRaoSearchTreeParameters()); + } + + @Override + public OpenRaoSearchTreeParameters deserializeAndUpdate(JsonParser parser, DeserializationContext deserializationContext, OpenRaoSearchTreeParameters parameters) throws IOException { + while (parser.nextToken() != JsonToken.END_OBJECT) { + switch (parser.getCurrentName()) { + case OBJECTIVE_FUNCTION: + parser.nextToken(); + JsonObjectiveFunctionParameters.deserialize(parser, parameters); + break; + case RANGE_ACTIONS_OPTIMIZATION: + parser.nextToken(); + JsonRangeActionsOptimizationParameters.deserialize(parser, parameters); + break; + case TOPOLOGICAL_ACTIONS_OPTIMIZATION: + parser.nextToken(); + JsonTopoOptimizationParameters.deserialize(parser, parameters); + break; + case MULTI_THREADING: + parser.nextToken(); + JsonMultiThreadingParameters.deserialize(parser, parameters); + break; + case SECOND_PREVENTIVE_RAO: + parser.nextToken(); + JsonSecondPreventiveRaoParameters.deserialize(parser, parameters); + break; + case LOAD_FLOW_AND_SENSITIVITY_COMPUTATION: + parser.nextToken(); + JsonLoadFlowAndSensitivityComputationParameters.deserialize(parser, parameters); + break; + case MNEC_PARAMETERS: + parser.nextToken(); + JsonMnecParameters.deserialize(parser, parameters); + break; + case RELATIVE_MARGINS: + parser.nextToken(); + JsonRelativeMarginsParameters.deserialize(parser, parameters); + break; + case LOOP_FLOW_PARAMETERS: + parser.nextToken(); + JsonLoopFlowParameters.deserialize(parser, parameters); + break; + default: + throw new OpenRaoException("Unexpected field in open rao search tree parameters: " + parser.getCurrentName()); + } + } + return parameters; + } + + @Override + public String getExtensionName() { + return SEARCH_TREE_PARAMETERS; + } + + @Override + public String getCategoryName() { + return "rao-parameters"; + } + + @Override + public Class getExtensionClass() { + return OpenRaoSearchTreeParameters.class; + } + +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRangeActionsOptimizationParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRangeActionsOptimizationParameters.java new file mode 100644 index 0000000000..b23543e9f8 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRangeActionsOptimizationParameters.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.json.extensions; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; + +import java.io.IOException; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + * @author Pauline JEAN-MARIE {@literal } + */ +final class JsonRangeActionsOptimizationParameters { + + private JsonRangeActionsOptimizationParameters() { + } + + static void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator) throws IOException { + jsonGenerator.writeObjectFieldStart(RANGE_ACTIONS_OPTIMIZATION); + jsonGenerator.writeNumberField(MAX_MIP_ITERATIONS, parameters.getRangeActionsOptimizationParameters().getMaxMipIterations()); + jsonGenerator.writeNumberField(PST_SENSITIVITY_THRESHOLD, parameters.getRangeActionsOptimizationParameters().getPstSensitivityThreshold()); + jsonGenerator.writeObjectField(PST_MODEL, parameters.getRangeActionsOptimizationParameters().getPstModel()); + jsonGenerator.writeNumberField(HVDC_SENSITIVITY_THRESHOLD, parameters.getRangeActionsOptimizationParameters().getHvdcSensitivityThreshold()); + jsonGenerator.writeNumberField(INJECTION_RA_SENSITIVITY_THRESHOLD, parameters.getRangeActionsOptimizationParameters().getInjectionRaSensitivityThreshold()); + jsonGenerator.writeObjectField(RA_RANGE_SHRINKING, parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking()); + jsonGenerator.writeObjectFieldStart(LINEAR_OPTIMIZATION_SOLVER); + jsonGenerator.writeObjectField(SOLVER, parameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getSolver()); + jsonGenerator.writeNumberField(RELATIVE_MIP_GAP, parameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getRelativeMipGap()); + jsonGenerator.writeStringField(SOLVER_SPECIFIC_PARAMETERS, parameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getSolverSpecificParameters()); + jsonGenerator.writeEndObject(); + jsonGenerator.writeEndObject(); + } + + static void deserialize(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { + while (!jsonParser.nextToken().isStructEnd()) { + switch (jsonParser.getCurrentName()) { + case MAX_MIP_ITERATIONS: + jsonParser.nextToken(); + searchTreeParameters.getRangeActionsOptimizationParameters().setMaxMipIterations(jsonParser.getIntValue()); + break; + case PST_SENSITIVITY_THRESHOLD: + jsonParser.nextToken(); + searchTreeParameters.getRangeActionsOptimizationParameters().setPstSensitivityThreshold(jsonParser.getDoubleValue()); + break; + case PST_MODEL: + searchTreeParameters.getRangeActionsOptimizationParameters().setPstModel(stringToPstModel(jsonParser.nextTextValue())); + break; + case HVDC_SENSITIVITY_THRESHOLD: + jsonParser.nextToken(); + searchTreeParameters.getRangeActionsOptimizationParameters().setHvdcSensitivityThreshold(jsonParser.getDoubleValue()); + break; + case INJECTION_RA_SENSITIVITY_THRESHOLD: + jsonParser.nextToken(); + searchTreeParameters.getRangeActionsOptimizationParameters().setInjectionRaSensitivityThreshold(jsonParser.getDoubleValue()); + break; + case LINEAR_OPTIMIZATION_SOLVER: + jsonParser.nextToken(); + deserializeLinearOptimizationSolver(jsonParser, searchTreeParameters); + break; + case RA_RANGE_SHRINKING: + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(stringToRaRangeShrinking(jsonParser.nextTextValue())); + break; + default: + throw new OpenRaoException(String.format("Cannot deserialize range action optimization parameters: unexpected field in %s (%s)", RANGE_ACTIONS_OPTIMIZATION, jsonParser.getCurrentName())); + } + } + } + + private static void deserializeLinearOptimizationSolver(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { + while (!jsonParser.nextToken().isStructEnd()) { + switch (jsonParser.getCurrentName()) { + case SOLVER: + searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setSolver(stringToSolver(jsonParser.nextTextValue())); + break; + case RELATIVE_MIP_GAP: + jsonParser.nextToken(); + searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setRelativeMipGap(jsonParser.getDoubleValue()); + break; + case SOLVER_SPECIFIC_PARAMETERS: + jsonParser.nextToken(); + searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setSolverSpecificParameters(jsonParser.getValueAsString()); + break; + default: + throw new OpenRaoException(String.format("Cannot deserialize linear optimization solver in range action optimization parameters: unexpected field in %s (%s)", LINEAR_OPTIMIZATION_SOLVER, jsonParser.getCurrentName())); + } + } + } + + private static SearchTreeRaoRangeActionsOptimizationParameters.PstModel stringToPstModel(String string) { + try { + return SearchTreeRaoRangeActionsOptimizationParameters.PstModel.valueOf(string); + } catch (IllegalArgumentException e) { + throw new OpenRaoException(String.format("Unknown Pst model: %s", string)); + } + } + + private static SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking stringToRaRangeShrinking(String string) { + try { + return SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.valueOf(string); + } catch (IllegalArgumentException e) { + throw new OpenRaoException(String.format("Unknown Pst variation range shrinking: %s", string)); + } + } + + private static SearchTreeRaoRangeActionsOptimizationParameters.Solver stringToSolver(String string) { + try { + return SearchTreeRaoRangeActionsOptimizationParameters.Solver.valueOf(string); + } catch (IllegalArgumentException e) { + throw new OpenRaoException(String.format("Unknown solver: %s", string)); + } + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRelativeMarginsParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRelativeMarginsParameters.java new file mode 100644 index 0000000000..193ecf87b8 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRelativeMarginsParameters.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.json.extensions; + +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; + +import java.io.IOException; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + */ +public final class JsonRelativeMarginsParameters { + + private JsonRelativeMarginsParameters() { + } + + static void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator) throws IOException { + Optional optionalRelativeMarginsParameters = parameters.getRelativeMarginsParameters(); + if (optionalRelativeMarginsParameters.isPresent()) { + jsonGenerator.writeObjectFieldStart(RELATIVE_MARGINS); + jsonGenerator.writeObjectField(PTDF_APPROXIMATION, optionalRelativeMarginsParameters.get().getPtdfApproximation()); + jsonGenerator.writeNumberField(PTDF_SUM_LOWER_BOUND, optionalRelativeMarginsParameters.get().getPtdfSumLowerBound()); + jsonGenerator.writeEndObject(); + } + } + + static void deserialize(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { + SearchTreeRaoRelativeMarginsParameters relativeMarginsParameters = new SearchTreeRaoRelativeMarginsParameters(); + while (!jsonParser.nextToken().isStructEnd()) { + switch (jsonParser.getCurrentName()) { + case PTDF_APPROXIMATION: + relativeMarginsParameters.setPtdfApproximation(stringToPtdfApproximation(jsonParser.nextTextValue())); + break; + case PTDF_SUM_LOWER_BOUND: + jsonParser.nextToken(); + relativeMarginsParameters.setPtdfSumLowerBound(jsonParser.getDoubleValue()); + break; + default: + throw new OpenRaoException(String.format("Cannot deserialize relative margins parameters: unexpected field in %s (%s)", RELATIVE_MARGINS, jsonParser.getCurrentName())); + } + searchTreeParameters.setRelativeMarginsParameters(relativeMarginsParameters); + } + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRelativeMarginsParametersExtension.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRelativeMarginsParametersExtension.java deleted file mode 100644 index 07a3fa7453..0000000000 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonRelativeMarginsParametersExtension.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.openrao.raoapi.json.extensions; - -import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.json.JsonRaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonToken; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.google.auto.service.AutoService; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; - -/** - * @author Godelaine de Montmorillon {@literal } - */ -@AutoService(JsonRaoParameters.ExtensionSerializer.class) -public class JsonRelativeMarginsParametersExtension implements JsonRaoParameters.ExtensionSerializer { - - @Override - public void serialize(RelativeMarginsParametersExtension relativeMarginParameters, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { - jsonGenerator.writeStartObject(); - jsonGenerator.writeArrayFieldStart(PTDF_BOUNDARIES); - for (String ptdfBoundary : relativeMarginParameters.getPtdfBoundariesAsString()) { - jsonGenerator.writeString(ptdfBoundary); - } - jsonGenerator.writeEndArray(); - jsonGenerator.writeObjectField(PTDF_APPROXIMATION, relativeMarginParameters.getPtdfApproximation()); - jsonGenerator.writeNumberField(PTDF_SUM_LOWER_BOUND, relativeMarginParameters.getPtdfSumLowerBound()); - jsonGenerator.writeEndObject(); - } - - @Override - public RelativeMarginsParametersExtension deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { - return deserializeAndUpdate(jsonParser, deserializationContext, new RelativeMarginsParametersExtension()); - } - - @Override - public RelativeMarginsParametersExtension deserializeAndUpdate(JsonParser jsonParser, DeserializationContext deserializationContext, RelativeMarginsParametersExtension parameters) throws IOException { - while (!jsonParser.nextToken().isStructEnd()) { - switch (jsonParser.getCurrentName()) { - case PTDF_BOUNDARIES: - readPtdfBoundaries(jsonParser, parameters); - break; - case PTDF_APPROXIMATION: - parameters.setPtdfApproximation(stringToPtdfApproximation(jsonParser.nextTextValue())); - break; - case PTDF_SUM_LOWER_BOUND: - jsonParser.nextToken(); - parameters.setPtdfSumLowerBound(jsonParser.getDoubleValue()); - break; - default: - throw new OpenRaoException(String.format("Cannot deserialize relative margins parameters: unexpected field in %s (%s)", RELATIVE_MARGINS, jsonParser.getCurrentName())); - } - } - return parameters; - } - - @Override - public String getExtensionName() { - return RELATIVE_MARGINS; - } - - @Override - public String getCategoryName() { - return "rao-parameters"; - } - - @Override - public Class getExtensionClass() { - return RelativeMarginsParametersExtension.class; - } - - private void readPtdfBoundaries(JsonParser parser, RelativeMarginsParametersExtension parameters) throws IOException { - if (parser.getCurrentToken() == JsonToken.START_ARRAY) { - List boundaries = new ArrayList<>(); - while (parser.nextToken() != JsonToken.END_ARRAY) { - boundaries.add(parser.getValueAsString()); - } - parameters.setPtdfBoundariesFromString(boundaries); - } - } - -} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonSecondPreventiveRaoParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonSecondPreventiveRaoParameters.java similarity index 65% rename from ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonSecondPreventiveRaoParameters.java rename to ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonSecondPreventiveRaoParameters.java index 57b4252ebe..37f50cd3f4 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonSecondPreventiveRaoParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonSecondPreventiveRaoParameters.java @@ -1,14 +1,15 @@ /* - * Copyright (c) 2023, RTE (http://www.rte-france.com) + * Copyright (c) 2024, RTE (http://www.rte-france.com) * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 */ -package com.powsybl.openrao.raoapi.json; +package com.powsybl.openrao.raoapi.json.extensions; import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.SecondPreventiveRaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SecondPreventiveRaoParameters; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -24,7 +25,7 @@ final class JsonSecondPreventiveRaoParameters { private JsonSecondPreventiveRaoParameters() { } - static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException { + static void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator) throws IOException { jsonGenerator.writeObjectFieldStart(SECOND_PREVENTIVE_RAO); jsonGenerator.writeObjectField(EXECUTION_CONDITION, parameters.getSecondPreventiveRaoParameters().getExecutionCondition()); jsonGenerator.writeBooleanField(RE_OPTIMIZE_CURATIVE_RANGE_ACTIONS, parameters.getSecondPreventiveRaoParameters().getReOptimizeCurativeRangeActions()); @@ -32,19 +33,19 @@ static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) thr jsonGenerator.writeEndObject(); } - static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException { + static void deserialize(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { while (!jsonParser.nextToken().isStructEnd()) { switch (jsonParser.getCurrentName()) { case EXECUTION_CONDITION: - raoParameters.getSecondPreventiveRaoParameters().setExecutionCondition(stringToExecutionCondition(jsonParser.nextTextValue())); + searchTreeParameters.getSecondPreventiveRaoParameters().setExecutionCondition(stringToExecutionCondition(jsonParser.nextTextValue())); break; case RE_OPTIMIZE_CURATIVE_RANGE_ACTIONS: jsonParser.nextToken(); - raoParameters.getSecondPreventiveRaoParameters().setReOptimizeCurativeRangeActions(jsonParser.getBooleanValue()); + searchTreeParameters.getSecondPreventiveRaoParameters().setReOptimizeCurativeRangeActions(jsonParser.getBooleanValue()); break; case HINT_FROM_FIRST_PREVENTIVE_RAO: jsonParser.nextToken(); - raoParameters.getSecondPreventiveRaoParameters().setHintFromFirstPreventiveRao(jsonParser.getBooleanValue()); + searchTreeParameters.getSecondPreventiveRaoParameters().setHintFromFirstPreventiveRao(jsonParser.getBooleanValue()); break; default: throw new OpenRaoException(String.format("Cannot deserialize second preventive rao parameters: unexpected field in %s (%s)", SECOND_PREVENTIVE_RAO, jsonParser.getCurrentName())); diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonTopoOptimizationParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonTopoOptimizationParameters.java new file mode 100644 index 0000000000..cde19016c0 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/extensions/JsonTopoOptimizationParameters.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.json.extensions; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * @author Godelaine de Montmorillon {@literal } + * @author Pauline JEAN-MARIE {@literal } + */ +final class JsonTopoOptimizationParameters { + + private JsonTopoOptimizationParameters() { + } + + static void serialize(OpenRaoSearchTreeParameters parameters, JsonGenerator jsonGenerator) throws IOException { + jsonGenerator.writeObjectFieldStart(TOPOLOGICAL_ACTIONS_OPTIMIZATION); + jsonGenerator.writeNumberField(MAX_PREVENTIVE_SEARCH_TREE_DEPTH, parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth()); + jsonGenerator.writeNumberField(MAX_AUTO_SEARCH_TREE_DEPTH, parameters.getTopoOptimizationParameters().getMaxAutoSearchTreeDepth()); + jsonGenerator.writeNumberField(MAX_CURATIVE_SEARCH_TREE_DEPTH, parameters.getTopoOptimizationParameters().getMaxCurativeSearchTreeDepth()); + jsonGenerator.writeFieldName(PREDEFINED_COMBINATIONS); + jsonGenerator.writeStartArray(); + for (List naIdCombination : parameters.getTopoOptimizationParameters().getPredefinedCombinations()) { + jsonGenerator.writeStartArray(); + for (String naId : naIdCombination) { + jsonGenerator.writeString(naId); + } + jsonGenerator.writeEndArray(); + } + jsonGenerator.writeEndArray(); + jsonGenerator.writeBooleanField(SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT, parameters.getTopoOptimizationParameters().getSkipActionsFarFromMostLimitingElement()); + jsonGenerator.writeNumberField(MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS, parameters.getTopoOptimizationParameters().getMaxNumberOfBoundariesForSkippingActions()); + jsonGenerator.writeEndObject(); + } + + static void deserialize(JsonParser jsonParser, OpenRaoSearchTreeParameters searchTreeParameters) throws IOException { + while (!jsonParser.nextToken().isStructEnd()) { + switch (jsonParser.getCurrentName()) { + case MAX_PREVENTIVE_SEARCH_TREE_DEPTH: + jsonParser.nextToken(); + searchTreeParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(jsonParser.getIntValue()); + break; + case MAX_AUTO_SEARCH_TREE_DEPTH: + jsonParser.nextToken(); + searchTreeParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(jsonParser.getIntValue()); + break; + case MAX_CURATIVE_SEARCH_TREE_DEPTH: + jsonParser.nextToken(); + searchTreeParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(jsonParser.getIntValue()); + break; + case PREDEFINED_COMBINATIONS: + searchTreeParameters.getTopoOptimizationParameters().setPredefinedCombinations(readListOfListOfString(jsonParser)); + break; + case SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT: + jsonParser.nextToken(); + searchTreeParameters.getTopoOptimizationParameters().setSkipActionsFarFromMostLimitingElement(jsonParser.getBooleanValue()); + break; + case MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS: + jsonParser.nextToken(); + searchTreeParameters.getTopoOptimizationParameters().setMaxNumberOfBoundariesForSkippingActions(jsonParser.getIntValue()); + break; + default: + throw new OpenRaoException(String.format("Cannot deserialize topological optimization parameters: unexpected field in %s (%s)", TOPOLOGICAL_ACTIONS_OPTIMIZATION, jsonParser.getCurrentName())); + } + } + } + + private static List> readListOfListOfString(JsonParser jsonParser) throws IOException { + List> parsedListOfList = new ArrayList<>(); + jsonParser.nextToken(); + while (!jsonParser.nextToken().isStructEnd()) { + parsedListOfList.add(jsonParser.readValueAs(ArrayList.class)); + } + return parsedListOfList; + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/LoopFlowParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/LoopFlowParameters.java new file mode 100644 index 0000000000..e4deba8582 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/LoopFlowParameters.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +package com.powsybl.openrao.raoapi.parameters; + +import com.powsybl.commons.config.PlatformConfig; +import com.powsybl.iidm.network.Country; + +import java.util.*; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; +import static com.powsybl.openrao.raoapi.RaoParametersCommons.COUNTRIES; + +/** + * Extension : loopFlow parameters for RAO + * + * @author Godelaine de Montmorillon {@literal } + */ +public class LoopFlowParameters { + static final double DEFAULT_ACCEPTABLE_INCREASE = 0.0; + static final Set DEFAULT_COUNTRIES = new HashSet<>(); //Empty by default + private double acceptableIncrease = DEFAULT_ACCEPTABLE_INCREASE; + private Set countries = DEFAULT_COUNTRIES; + + // Getters and setters + public double getAcceptableIncrease() { + return acceptableIncrease; + } + + public void setAcceptableIncrease(double acceptableIncrease) { + this.acceptableIncrease = acceptableIncrease; + } + + public Set getCountries() { + return countries; + } + + public void setCountries(Set countries) { + this.countries = countries; + } + + public void setCountries(List countryStrings) { + this.countries = ParametersUtil.convertToCountrySet(countryStrings); + } + + public static Optional load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + return platformConfig.getOptionalModuleConfig(LOOP_FLOW_PARAMETERS_SECTION) + .map(config -> { + LoopFlowParameters parameters = new LoopFlowParameters(); + parameters.setAcceptableIncrease(config.getDoubleProperty(ACCEPTABLE_INCREASE, LoopFlowParameters.DEFAULT_ACCEPTABLE_INCREASE)); + parameters.setCountries(ParametersUtil.convertToCountrySet(config.getStringListProperty(COUNTRIES, new ArrayList<>()))); + return parameters; + }); + } +} + diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/MnecParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/MnecParameters.java new file mode 100644 index 0000000000..645ffd7fca --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/MnecParameters.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package com.powsybl.openrao.raoapi.parameters; + +import com.powsybl.commons.config.PlatformConfig; + +import java.util.Objects; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * Extension : MNEC parameters for RAO + * + * @author Godelaine de Montmorillon {@literal } + */ +public class MnecParameters { + static final double DEFAULT_ACCEPTABLE_MARGIN_DECREASE = 50.0; + private double acceptableMarginDecrease = DEFAULT_ACCEPTABLE_MARGIN_DECREASE; + // "A equivalent cost per A violation" or "MW per MW", depending on the objective function + + public double getAcceptableMarginDecrease() { + return acceptableMarginDecrease; + } + + public void setAcceptableMarginDecrease(double acceptableMarginDecrease) { + this.acceptableMarginDecrease = acceptableMarginDecrease; + } + + public static Optional load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + return platformConfig.getOptionalModuleConfig(MNEC_PARAMETERS_SECTION) + .map(config -> { + MnecParameters parameters = new MnecParameters(); + parameters.setAcceptableMarginDecrease(config.getDoubleProperty(ACCEPTABLE_MARGIN_DECREASE, MnecParameters.DEFAULT_ACCEPTABLE_MARGIN_DECREASE)); + return parameters; + }); + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/MultithreadingParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/MultithreadingParameters.java deleted file mode 100644 index 70ab475b0b..0000000000 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/MultithreadingParameters.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -package com.powsybl.openrao.raoapi.parameters; - -import com.powsybl.commons.config.PlatformConfig; - -import java.util.Objects; -import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; -/** - * Multi-threading optimization parameters for RAO - * - * @author Godelaine de Montmorillon {@literal } - */ -public class MultithreadingParameters { - private static final int DEFAULT_CONTINGENCY_SCENARIOS_IN_PARALLEL = 1; - private static final int DEFAULT_PREVENTIVE_LEAVES_IN_PARALLEL = 1; - private static final int DEFAULT_AUTO_LEAVES_IN_PARALLEL = 1; - private static final int DEFAULT_CURATIVE_LEAVES_IN_PARALLEL = 1; - private int contingencyScenariosInParallel = DEFAULT_CONTINGENCY_SCENARIOS_IN_PARALLEL; - private int preventiveLeavesInParallel = DEFAULT_PREVENTIVE_LEAVES_IN_PARALLEL; - private int autoLeavesInParallel = DEFAULT_AUTO_LEAVES_IN_PARALLEL; - private int curativeLeavesInParallel = DEFAULT_CURATIVE_LEAVES_IN_PARALLEL; - - public int getContingencyScenariosInParallel() { - return contingencyScenariosInParallel; - } - - public void setContingencyScenariosInParallel(int contingencyScenariosInParallel) { - this.contingencyScenariosInParallel = contingencyScenariosInParallel; - } - - public void setPreventiveLeavesInParallel(int preventiveLeavesInParallel) { - this.preventiveLeavesInParallel = preventiveLeavesInParallel; - } - - public void setAutoLeavesInParallel(int autoLeavesInParallel) { - this.autoLeavesInParallel = autoLeavesInParallel; - } - - public void setCurativeLeavesInParallel(int curativeLeavesInParallel) { - this.curativeLeavesInParallel = curativeLeavesInParallel; - } - - public int getPreventiveLeavesInParallel() { - return preventiveLeavesInParallel; - } - - public int getAutoLeavesInParallel() { - return autoLeavesInParallel; - } - - public int getCurativeLeavesInParallel() { - return curativeLeavesInParallel; - } - - public static MultithreadingParameters load(PlatformConfig platformConfig) { - Objects.requireNonNull(platformConfig); - MultithreadingParameters parameters = new MultithreadingParameters(); - platformConfig.getOptionalModuleConfig(MULTI_THREADING_SECTION) - .ifPresent(config -> { - parameters.setContingencyScenariosInParallel(config.getIntProperty(CONTINGENCY_SCENARIOS_IN_PARALLEL, DEFAULT_CONTINGENCY_SCENARIOS_IN_PARALLEL)); - parameters.setPreventiveLeavesInParallel(config.getIntProperty(PREVENTIVE_LEAVES_IN_PARALLEL, DEFAULT_PREVENTIVE_LEAVES_IN_PARALLEL)); - parameters.setAutoLeavesInParallel(config.getIntProperty(AUTO_LEAVES_IN_PARALLEL, DEFAULT_AUTO_LEAVES_IN_PARALLEL)); - parameters.setCurativeLeavesInParallel(config.getIntProperty(CURATIVE_LEAVES_IN_PARALLEL, DEFAULT_CURATIVE_LEAVES_IN_PARALLEL)); - - }); - return parameters; - } -} 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 e34f6ceb02..05c749cd62 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 @@ -12,7 +12,6 @@ import java.util.Objects; -import static com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider.BUSINESS_WARNS; import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; /** * Objective function parameters for RAO @@ -21,49 +20,30 @@ */ public class ObjectiveFunctionParameters { // Default values - private static final ObjectiveFunctionType DEFAULT_OBJECTIVE_FUNCTION = ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT; - private static final double DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT = 0; - private static final PreventiveStopCriterion DEFAULT_PREVENTIVE_STOP_CRITERION = PreventiveStopCriterion.SECURE; + private static final ObjectiveFunctionType DEFAULT_OBJECTIVE_FUNCTION = ObjectiveFunctionType.SECURE_FLOW; + private static final Unit DEFAULT_UNIT = Unit.MEGAWATT; private static final boolean DEFAULT_ENFORCE_CURATIVE_SECURITY = false; // Attributes private ObjectiveFunctionType type = DEFAULT_OBJECTIVE_FUNCTION; - 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), - MIN_COST_IN_MEGAWATT(Unit.MEGAWATT), - MIN_COST_IN_AMPERE(Unit.AMPERE); - - private final Unit unit; - - ObjectiveFunctionType(Unit unit) { - this.unit = unit; - } - - public Unit getUnit() { - return unit; - } + SECURE_FLOW, + MAX_MIN_MARGIN, + MAX_MIN_RELATIVE_MARGIN, + MIN_COST; 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); } public boolean costOptimization() { - return this.equals(MIN_COST_IN_MEGAWATT) || this.equals(MIN_COST_IN_AMPERE); + return this.equals(MIN_COST); } } - public enum PreventiveStopCriterion { - MIN_OBJECTIVE, - SECURE - } - // Getters and setters public ObjectiveFunctionType getType() { return type; @@ -73,16 +53,12 @@ public void setType(ObjectiveFunctionType type) { this.type = type; } - public void setPreventiveStopCriterion(PreventiveStopCriterion preventiveStopCriterion) { - this.preventiveStopCriterion = preventiveStopCriterion; - } - - public double getCurativeMinObjImprovement() { - return curativeMinObjImprovement; + public Unit getUnit() { + return unit; } - public PreventiveStopCriterion getPreventiveStopCriterion() { - return preventiveStopCriterion; + public void setUnit(Unit unit) { + this.unit = unit; } public boolean getEnforceCurativeSecurity() { @@ -100,18 +76,9 @@ public static ObjectiveFunctionParameters load(PlatformConfig platformConfig) { .ifPresent(config -> { parameters.setType(config.getEnumProperty(TYPE, ObjectiveFunctionType.class, DEFAULT_OBJECTIVE_FUNCTION)); - parameters.setCurativeMinObjImprovement(config.getDoubleProperty(CURATIVE_MIN_OBJ_IMPROVEMENT, DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT)); - parameters.setPreventiveStopCriterion(config.getEnumProperty(PREVENTIVE_STOP_CRITERION, PreventiveStopCriterion.class, - DEFAULT_PREVENTIVE_STOP_CRITERION)); + parameters.setUnit(config.getEnumProperty(UNIT, Unit.class, DEFAULT_UNIT)); parameters.setEnforceCurativeSecurity(config.getBooleanProperty(ENFORCE_CURATIVE_SECURITY, DEFAULT_ENFORCE_CURATIVE_SECURITY)); }); return parameters; } - - public void setCurativeMinObjImprovement(double curativeRaoMinObjImprovement) { - if (curativeRaoMinObjImprovement < 0) { - BUSINESS_WARNS.warn("The value {} provided for curative RAO minimum objective improvement is smaller than 0. It will be set to + {}", curativeRaoMinObjImprovement, -curativeRaoMinObjImprovement); - } - this.curativeMinObjImprovement = Math.abs(curativeRaoMinObjImprovement); - } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ParametersUtil.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ParametersUtil.java index a57090d851..ac8e5cf4ea 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ParametersUtil.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ParametersUtil.java @@ -70,7 +70,7 @@ protected static List convertStringIntMapToList(Map map return list; } - protected static List> convertListToListOfList(List stringList) { + public static List> convertListToListOfList(List stringList) { List> listOfList = new ArrayList<>(); stringList.forEach(listEntry -> { String[] splitListEntry = listEntry.split("\\+"); @@ -83,7 +83,7 @@ protected static List> convertListToListOfList(List stringL return listOfList; } - protected static List convertListOfListToList(List> listOfList) { + public static List convertListOfListToList(List> listOfList) { List finalList = new ArrayList<>(); listOfList.forEach(subList -> { if (!subList.isEmpty()) { diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RangeActionsOptimizationParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RangeActionsOptimizationParameters.java index 00896bb9d5..3763688efc 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RangeActionsOptimizationParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RangeActionsOptimizationParameters.java @@ -7,7 +7,6 @@ package com.powsybl.openrao.raoapi.parameters; -import com.powsybl.openrao.commons.OpenRaoException; import com.powsybl.commons.config.PlatformConfig; import java.util.Objects; @@ -23,177 +22,37 @@ public class RangeActionsOptimizationParameters { // Default values - private static final int DEFAULT_MAX_MIP_ITERATIONS = 10; - private static final double DEFAULT_PST_PENALTY_COST = 0.01; - private static final double DEFAULT_PST_SENSITIVITY_THRESHOLD = 1e-6; - private static final PstModel DEFAULT_PST_MODEL = PstModel.CONTINUOUS; - private static final double DEFAULT_HVDC_PENALTY_COST = 0.001; - private static final double DEFAULT_HVDC_SENSITIVITY_THRESHOLD = 1e-6; - private static final double DEFAULT_INJECTION_RA_PENALTY_COST = 0.001; - private static final double DEFAULT_INJECTION_RA_SENSITIVITY_THRESHOLD = 1e-6; - private static final RaRangeShrinking DEFAULT_RA_RANGE_SHRINKING = RaRangeShrinking.DISABLED; + private static final double DEFAULT_PST_RA_MIN_IMPACT_THRESHOLD = 0.01; + private static final double DEFAULT_HVDC_RA_MIN_IMPACT_THRESHOLD = 0.001; + private static final double DEFAULT_INJECTION_RA_MIN_IMPACT_THRESHOLD = 0.001; // Attributes - private int maxMipIterations = DEFAULT_MAX_MIP_ITERATIONS; - private double pstPenaltyCost = DEFAULT_PST_PENALTY_COST; - private double pstSensitivityThreshold = DEFAULT_PST_SENSITIVITY_THRESHOLD; - private PstModel pstModel = DEFAULT_PST_MODEL; - private double hvdcPenaltyCost = DEFAULT_HVDC_PENALTY_COST; - private double hvdcSensitivityThreshold = DEFAULT_HVDC_SENSITIVITY_THRESHOLD; - private double injectionRaPenaltyCost = DEFAULT_INJECTION_RA_PENALTY_COST; - private double injectionRaSensitivityThreshold = DEFAULT_INJECTION_RA_SENSITIVITY_THRESHOLD; - private LinearOptimizationSolver linearOptimizationSolver = new LinearOptimizationSolver(); - private RaRangeShrinking raRangeShrinking = DEFAULT_RA_RANGE_SHRINKING; - - public enum PstModel { - CONTINUOUS, - APPROXIMATED_INTEGERS - } - - public enum RaRangeShrinking { - DISABLED, - ENABLED, - ENABLED_IN_FIRST_PRAO_AND_CRAO - } - - public static class LinearOptimizationSolver { - private static final Solver DEFAULT_SOLVER = Solver.CBC; - public static final double DEFAULT_RELATIVE_MIP_GAP = 0.0001; - public static final String DEFAULT_SOLVER_SPECIFIC_PARAMETERS = null; - private Solver solver = DEFAULT_SOLVER; - private double relativeMipGap = DEFAULT_RELATIVE_MIP_GAP; - private String solverSpecificParameters = DEFAULT_SOLVER_SPECIFIC_PARAMETERS; - - public Solver getSolver() { - return solver; - } - - public void setSolver(Solver solver) { - this.solver = solver; - } - - public double getRelativeMipGap() { - return relativeMipGap; - } - - public void setRelativeMipGap(double relativeMipGap) { - this.relativeMipGap = relativeMipGap; - } - - public String getSolverSpecificParameters() { - return solverSpecificParameters; - } - - public void setSolverSpecificParameters(String solverSpecificParameters) { - this.solverSpecificParameters = solverSpecificParameters; - } - - public static LinearOptimizationSolver load(PlatformConfig platformConfig) { - Objects.requireNonNull(platformConfig); - LinearOptimizationSolver parameters = new LinearOptimizationSolver(); - platformConfig.getOptionalModuleConfig(LINEAR_OPTIMIZATION_SOLVER_SECTION) - .ifPresent(config -> { - parameters.setSolver(config.getEnumProperty(SOLVER, Solver.class, DEFAULT_SOLVER)); - parameters.setRelativeMipGap(config.getDoubleProperty(RELATIVE_MIP_GAP, DEFAULT_RELATIVE_MIP_GAP)); - parameters.setSolverSpecificParameters(config.getStringProperty(SOLVER_SPECIFIC_PARAMETERS, DEFAULT_SOLVER_SPECIFIC_PARAMETERS)); - }); - return parameters; - } - } - - public enum Solver { - CBC, - SCIP, - XPRESS - } + private double pstRAMinImpactThreshold = DEFAULT_PST_RA_MIN_IMPACT_THRESHOLD; + private double hvdcRAMinImpactThreshold = DEFAULT_HVDC_RA_MIN_IMPACT_THRESHOLD; + private double injectionRAMinImpactThreshold = DEFAULT_INJECTION_RA_MIN_IMPACT_THRESHOLD; // Getters and setters - public int getMaxMipIterations() { - return maxMipIterations; - } - - public void setMaxMipIterations(int maxMipIterations) { - this.maxMipIterations = maxMipIterations; - } - - public double getPstPenaltyCost() { - return pstPenaltyCost; - } - - public void setPstPenaltyCost(double pstPenaltyCost) { - this.pstPenaltyCost = pstPenaltyCost; - } - - public double getPstSensitivityThreshold() { - return pstSensitivityThreshold; + public double getPstRAMinImpactThreshold() { + return pstRAMinImpactThreshold; } - public void setPstSensitivityThreshold(double pstSensitivityThreshold) { - if (pstSensitivityThreshold < 1e-6) { - throw new OpenRaoException("pstSensitivityThreshold should be greater than 1e-6, to avoid numerical issues."); - } - this.pstSensitivityThreshold = pstSensitivityThreshold; + public void setPstRAMinImpactThreshold(double pstRAMinImpactThreshold) { + this.pstRAMinImpactThreshold = pstRAMinImpactThreshold; } - public double getHvdcPenaltyCost() { - return hvdcPenaltyCost; + public double getHvdcRAMinImpactThreshold() { + return hvdcRAMinImpactThreshold; } - public void setHvdcPenaltyCost(double hvdcPenaltyCost) { - this.hvdcPenaltyCost = hvdcPenaltyCost; + public void setHvdcRAMinImpactThreshold(double hvdcRAMinImpactThreshold) { + this.hvdcRAMinImpactThreshold = hvdcRAMinImpactThreshold; } - public double getHvdcSensitivityThreshold() { - return hvdcSensitivityThreshold; + public double getInjectionRAMinImpactThreshold() { + return injectionRAMinImpactThreshold; } - public void setHvdcSensitivityThreshold(double hvdcSensitivityThreshold) { - if (hvdcSensitivityThreshold < 1e-6) { - throw new OpenRaoException("hvdcSensitivityThreshold should be greater than 1e-6, to avoid numerical issues."); - } - this.hvdcSensitivityThreshold = hvdcSensitivityThreshold; - } - - public double getInjectionRaPenaltyCost() { - return injectionRaPenaltyCost; - } - - public void setInjectionRaPenaltyCost(double injectionRaPenaltyCost) { - this.injectionRaPenaltyCost = injectionRaPenaltyCost; - } - - public double getInjectionRaSensitivityThreshold() { - return injectionRaSensitivityThreshold; - } - - public void setInjectionRaSensitivityThreshold(double injectionRaSensitivityThreshold) { - if (injectionRaSensitivityThreshold < 1e-6) { - throw new OpenRaoException("injectionRaSensitivityThreshold should be greater than 1e-6, to avoid numerical issues."); - } - this.injectionRaSensitivityThreshold = injectionRaSensitivityThreshold; - } - - public LinearOptimizationSolver getLinearOptimizationSolver() { - return linearOptimizationSolver; - } - - public void setPstModel(PstModel pstModel) { - this.pstModel = pstModel; - } - - public PstModel getPstModel() { - return pstModel; - } - - public void setLinearOptimizationSolver(LinearOptimizationSolver linearOptimizationSolver) { - this.linearOptimizationSolver = linearOptimizationSolver; - } - - public void setRaRangeShrinking(RaRangeShrinking raRangeShrinking) { - this.raRangeShrinking = raRangeShrinking; - } - - public RaRangeShrinking getRaRangeShrinking() { - return raRangeShrinking; + public void setInjectionRAMinImpactThreshold(double injectionRAMinImpactThreshold) { + this.injectionRAMinImpactThreshold = injectionRAMinImpactThreshold; } public static RangeActionsOptimizationParameters load(PlatformConfig platformConfig) { @@ -201,21 +60,10 @@ public static RangeActionsOptimizationParameters load(PlatformConfig platformCon RangeActionsOptimizationParameters parameters = new RangeActionsOptimizationParameters(); platformConfig.getOptionalModuleConfig(RANGE_ACTIONS_OPTIMIZATION_SECTION) .ifPresent(config -> { - parameters.setMaxMipIterations(config.getIntProperty(MAX_MIP_ITERATIONS, DEFAULT_MAX_MIP_ITERATIONS)); - parameters.setPstPenaltyCost(config.getDoubleProperty(PST_PENALTY_COST, DEFAULT_PST_PENALTY_COST)); - parameters.setPstSensitivityThreshold(config.getDoubleProperty(PST_SENSITIVITY_THRESHOLD, DEFAULT_PST_SENSITIVITY_THRESHOLD)); - parameters.setPstModel(config.getEnumProperty(PST_MODEL, PstModel.class, DEFAULT_PST_MODEL)); - parameters.setHvdcPenaltyCost(config.getDoubleProperty(HVDC_PENALTY_COST, DEFAULT_HVDC_PENALTY_COST)); - parameters.setHvdcSensitivityThreshold(config.getDoubleProperty(HVDC_SENSITIVITY_THRESHOLD, DEFAULT_HVDC_SENSITIVITY_THRESHOLD)); - parameters.setInjectionRaPenaltyCost(config.getDoubleProperty(INJECTION_RA_PENALTY_COST, DEFAULT_INJECTION_RA_PENALTY_COST)); - parameters.setInjectionRaSensitivityThreshold(config.getDoubleProperty(INJECTION_RA_SENSITIVITY_THRESHOLD, DEFAULT_INJECTION_RA_SENSITIVITY_THRESHOLD)); - parameters.setRaRangeShrinking(config.getEnumProperty(RA_RANGE_SHRINKING, RaRangeShrinking.class, DEFAULT_RA_RANGE_SHRINKING)); + parameters.setPstRAMinImpactThreshold(config.getDoubleProperty(PST_RA_MIN_IMPACT_THRESHOLD, DEFAULT_PST_RA_MIN_IMPACT_THRESHOLD)); + parameters.setHvdcRAMinImpactThreshold(config.getDoubleProperty(HVDC_RA_MIN_IMPACT_THRESHOLD, DEFAULT_HVDC_RA_MIN_IMPACT_THRESHOLD)); + parameters.setInjectionRAMinImpactThreshold(config.getDoubleProperty(INJECTION_RA_MIN_IMPACT_THRESHOLD, DEFAULT_INJECTION_RA_MIN_IMPACT_THRESHOLD)); }); - parameters.setLinearOptimizationSolver(LinearOptimizationSolver.load(platformConfig)); return parameters; } - - public static RangeActionsOptimizationParameters buildFromRaoParameters(RaoParameters raoParameters) { - return raoParameters.getRangeActionsOptimizationParameters(); - } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RaoParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RaoParameters.java index 185a710b53..2550b4ebb6 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RaoParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RaoParameters.java @@ -14,21 +14,25 @@ import com.powsybl.commons.extensions.Extension; import com.powsybl.commons.extensions.ExtensionConfigLoader; import com.powsybl.commons.extensions.ExtensionProviders; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoMnecParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; import java.util.Objects; +import java.util.Optional; /** - * * @author Godelaine de Montmorillon {@literal } */ public class RaoParameters extends AbstractExtendable { private ObjectiveFunctionParameters objectiveFunctionParameters = new ObjectiveFunctionParameters(); private RangeActionsOptimizationParameters rangeActionsOptimizationParameters = new RangeActionsOptimizationParameters(); private TopoOptimizationParameters topoOptimizationParameters = new TopoOptimizationParameters(); - private MultithreadingParameters multithreadingParameters = new MultithreadingParameters(); - private SecondPreventiveRaoParameters secondPreventiveRaoParameters = new SecondPreventiveRaoParameters(); private NotOptimizedCnecsParameters notOptimizedCnecsParameters = new NotOptimizedCnecsParameters(); - private LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters = new LoadFlowAndSensitivityParameters(); + private Optional mnecParameters = Optional.empty(); + private Optional relativeMarginsParameters = Optional.empty(); + private Optional loopFlowParameters = Optional.empty(); // Getters and setters public void setObjectiveFunctionParameters(ObjectiveFunctionParameters objectiveFunctionParameters) { @@ -43,20 +47,20 @@ public void setTopoOptimizationParameters(TopoOptimizationParameters topoOptimiz this.topoOptimizationParameters = topoOptimizationParameters; } - public void setMultithreadingParameters(MultithreadingParameters multithreadingParameters) { - this.multithreadingParameters = multithreadingParameters; + public void setNotOptimizedCnecsParameters(NotOptimizedCnecsParameters notOptimizedCnecsParameters) { + this.notOptimizedCnecsParameters = notOptimizedCnecsParameters; } - public void setSecondPreventiveRaoParameters(SecondPreventiveRaoParameters secondPreventiveRaoParameters) { - this.secondPreventiveRaoParameters = secondPreventiveRaoParameters; + public void setMnecParameters(MnecParameters mnecParameters) { + this.mnecParameters = Optional.of(mnecParameters); } - public void setNotOptimizedCnecsParameters(NotOptimizedCnecsParameters notOptimizedCnecsParameters) { - this.notOptimizedCnecsParameters = notOptimizedCnecsParameters; + public void setRelativeMarginsParameters(RelativeMarginsParameters relativeMarginsParameters) { + this.relativeMarginsParameters = Optional.of(relativeMarginsParameters); } - public void setLoadFlowAndSensitivityParameters(LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters) { - this.loadFlowAndSensitivityParameters = loadFlowAndSensitivityParameters; + public void setLoopFlowParameters(LoopFlowParameters loopFlowParameters) { + this.loopFlowParameters = Optional.of(loopFlowParameters); } public ObjectiveFunctionParameters getObjectiveFunctionParameters() { @@ -71,20 +75,20 @@ public TopoOptimizationParameters getTopoOptimizationParameters() { return topoOptimizationParameters; } - public MultithreadingParameters getMultithreadingParameters() { - return multithreadingParameters; + public NotOptimizedCnecsParameters getNotOptimizedCnecsParameters() { + return notOptimizedCnecsParameters; } - public SecondPreventiveRaoParameters getSecondPreventiveRaoParameters() { - return secondPreventiveRaoParameters; + public Optional getMnecParameters() { + return mnecParameters; } - public NotOptimizedCnecsParameters getNotOptimizedCnecsParameters() { - return notOptimizedCnecsParameters; + public Optional getRelativeMarginsParameters() { + return relativeMarginsParameters; } - public LoadFlowAndSensitivityParameters getLoadFlowAndSensitivityParameters() { - return loadFlowAndSensitivityParameters; + public Optional getLoopFlowParameters() { + return loopFlowParameters; } public boolean hasExtension(Class classType) { @@ -92,15 +96,17 @@ public boolean hasExtension(Class classType) { } // ConfigLoader + /** * A configuration loader interface for the RaoParameters extensions loaded from the platform configuration + * * @param The extension class */ public interface ConfigLoader> extends ExtensionConfigLoader { } private static final Supplier> PARAMETERS_EXTENSIONS_SUPPLIER = - Suppliers.memoize(() -> ExtensionProviders.createProvider(RaoParameters.ConfigLoader.class, "rao-parameters")); + Suppliers.memoize(() -> ExtensionProviders.createProvider(RaoParameters.ConfigLoader.class, "rao-parameters")); /** * @return RaoParameters from platform default config. @@ -118,6 +124,7 @@ public static RaoParameters load(PlatformConfig platformConfig) { RaoParameters parameters = new RaoParameters(); load(parameters, platformConfig); parameters.loadExtensions(platformConfig); + addOptionalExtensionsDefaultValuesIfExist(parameters); return parameters; } @@ -127,16 +134,60 @@ public static void load(RaoParameters parameters, PlatformConfig platformConfig) parameters.setObjectiveFunctionParameters(ObjectiveFunctionParameters.load(platformConfig)); parameters.setRangeActionsOptimizationParameters(RangeActionsOptimizationParameters.load(platformConfig)); parameters.setTopoOptimizationParameters(TopoOptimizationParameters.load(platformConfig)); - parameters.setMultithreadingParameters(MultithreadingParameters.load(platformConfig)); - parameters.setSecondPreventiveRaoParameters(SecondPreventiveRaoParameters.load(platformConfig)); parameters.setNotOptimizedCnecsParameters(NotOptimizedCnecsParameters.load(platformConfig)); - parameters.setLoadFlowAndSensitivityParameters(LoadFlowAndSensitivityParameters.load(platformConfig)); + MnecParameters.load(platformConfig).ifPresent(parameters::setMnecParameters); + RelativeMarginsParameters.load(platformConfig).ifPresent(parameters::setRelativeMarginsParameters); + LoopFlowParameters.load(platformConfig).ifPresent(parameters::setLoopFlowParameters); } private void loadExtensions(PlatformConfig platformConfig) { for (ExtensionConfigLoader provider : PARAMETERS_EXTENSIONS_SUPPLIER.get().getProviders()) { - if (platformConfig.getOptionalModuleConfig(provider.getExtensionName()).isPresent()) { - addExtension(provider.getExtensionClass(), provider.load(platformConfig)); + Extension extension = provider.load(platformConfig); + if (extension != null) { + addExtension(provider.getExtensionClass(), extension); + } + } + } + + public static void addOptionalExtensionsDefaultValuesIfExist(RaoParameters parameters) { + OpenRaoSearchTreeParameters extension = parameters.getExtension(OpenRaoSearchTreeParameters.class); + if (parameters.getMnecParameters().isPresent()) { + if (Objects.isNull(extension)) { + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + } + extension = parameters.getExtension(OpenRaoSearchTreeParameters.class); + if (extension.getMnecParameters().isEmpty()) { + extension.setMnecParameters(new SearchTreeRaoMnecParameters()); + } + } else { + if (!Objects.isNull(extension) && extension.getMnecParameters().isPresent()) { + parameters.setMnecParameters(new com.powsybl.openrao.raoapi.parameters.MnecParameters()); + } + } + if (parameters.getRelativeMarginsParameters().isPresent()) { + if (Objects.isNull(extension)) { + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + } + extension = parameters.getExtension(OpenRaoSearchTreeParameters.class); + if (extension.getRelativeMarginsParameters().isEmpty()) { + extension.setRelativeMarginsParameters(new SearchTreeRaoRelativeMarginsParameters()); + } + } else { + if (!Objects.isNull(extension) && extension.getRelativeMarginsParameters().isPresent()) { + parameters.setRelativeMarginsParameters(new com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters()); + } + } + if (parameters.getLoopFlowParameters().isPresent()) { + if (Objects.isNull(extension)) { + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + } + extension = parameters.getExtension(OpenRaoSearchTreeParameters.class); + if (extension.getLoopFlowParameters().isEmpty()) { + extension.setLoopFlowParameters(new SearchTreeRaoLoopFlowParameters()); + } + } else { + if (!Objects.isNull(extension) && extension.getLoopFlowParameters().isPresent()) { + parameters.setLoopFlowParameters(new com.powsybl.openrao.raoapi.parameters.LoopFlowParameters()); } } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/RelativeMarginsParametersExtension.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RelativeMarginsParameters.java similarity index 55% rename from ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/RelativeMarginsParametersExtension.java rename to ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RelativeMarginsParameters.java index e67d07d490..eba9ad68c6 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/RelativeMarginsParametersExtension.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/RelativeMarginsParameters.java @@ -5,29 +5,28 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package com.powsybl.openrao.raoapi.parameters.extensions; +package com.powsybl.openrao.raoapi.parameters; +import com.powsybl.commons.config.PlatformConfig; import com.powsybl.openrao.raoapi.ZoneToZonePtdfDefinition; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.commons.extensions.AbstractExtension; import java.util.ArrayList; import java.util.List; +import java.util.Objects; +import java.util.Optional; + import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + /** * Extension : relative margin parameters for RAO * * @author Godelaine de Montmorillon {@literal } */ -public class RelativeMarginsParametersExtension extends AbstractExtension { +public class RelativeMarginsParameters { - static final double DEFAULT_PTDF_SUM_LOWER_BOUND = 0.01; - static final PtdfApproximation DEFAULT_PTDF_APPROXIMATION = PtdfApproximation.FIXED_PTDF; static final List DEFAULT_RELATIVE_MARGIN_PTDF_BOUNDARIES = new ArrayList<>(); private List ptdfBoundaries = DEFAULT_RELATIVE_MARGIN_PTDF_BOUNDARIES; // prevents relative margins from diverging to +infinity - private double ptdfSumLowerBound = DEFAULT_PTDF_SUM_LOWER_BOUND; - private PtdfApproximation ptdfApproximation = DEFAULT_PTDF_APPROXIMATION; public List getPtdfBoundaries() { return ptdfBoundaries; @@ -45,25 +44,14 @@ public void setPtdfBoundariesFromString(List boundaries) { .toList(); } - public double getPtdfSumLowerBound() { - return ptdfSumLowerBound; - } - - public PtdfApproximation getPtdfApproximation() { - return ptdfApproximation; - } - - public void setPtdfApproximation(PtdfApproximation ptdfApproximation) { - this.ptdfApproximation = ptdfApproximation; - } - - public void setPtdfSumLowerBound(double ptdfSumLowerBound) { - this.ptdfSumLowerBound = ptdfSumLowerBound; - } - - @Override - public String getName() { - return RELATIVE_MARGINS; + public static Optional load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + return platformConfig.getOptionalModuleConfig(RELATIVE_MARGINS_SECTION) + .map(config -> { + RelativeMarginsParameters parameters = new RelativeMarginsParameters(); + parameters.setPtdfBoundariesFromString(config.getStringListProperty(PTDF_BOUNDARIES, new ArrayList<>())); + return parameters; + }); } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/TopoOptimizationParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/TopoOptimizationParameters.java index b66542433c..eeed0592f4 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/TopoOptimizationParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/TopoOptimizationParameters.java @@ -21,37 +21,11 @@ */ public class TopoOptimizationParameters { // Default values - private static final int DEFAULT_MAX_SEARCH_TREE_DEPTH = Integer.MAX_VALUE; - private static final List> DEFAULT_PREDEFINED_COMBINATIONS = new ArrayList<>(); private static final double DEFAULT_RELATIVE_MIN_IMPACT_THRESHOLD = 0; private static final double DEFAULT_ABSOLUTE_MIN_IMPACT_THRESHOLD = 0; - private static final boolean DEFAULT_SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT = false; - private static final int DEFAULT_MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS = 2; // Attributes - private int maxPreventiveSearchTreeDepth = DEFAULT_MAX_SEARCH_TREE_DEPTH; - private int maxAutoSearchTreeDepth = DEFAULT_MAX_SEARCH_TREE_DEPTH; - private int maxCurativeSearchTreeDepth = DEFAULT_MAX_SEARCH_TREE_DEPTH; - private List> predefinedCombinations = DEFAULT_PREDEFINED_COMBINATIONS; private double relativeMinImpactThreshold = DEFAULT_RELATIVE_MIN_IMPACT_THRESHOLD; private double absoluteMinImpactThreshold = DEFAULT_ABSOLUTE_MIN_IMPACT_THRESHOLD; - private boolean skipActionsFarFromMostLimitingElement = DEFAULT_SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT; - private int maxNumberOfBoundariesForSkippingActions = DEFAULT_MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS; - - public void setMaxPreventiveSearchTreeDepth(int maxPreventiveSearchTreeDepth) { - this.maxPreventiveSearchTreeDepth = maxPreventiveSearchTreeDepth; - } - - public void setMaxAutoSearchTreeDepth(int maxAutoSearchTreeDepth) { - this.maxAutoSearchTreeDepth = maxAutoSearchTreeDepth; - } - - public void setMaxCurativeSearchTreeDepth(int maxCurativeSearchTreeDepth) { - this.maxCurativeSearchTreeDepth = maxCurativeSearchTreeDepth; - } - - public void setPredefinedCombinations(List> predefinedCombinations) { - this.predefinedCombinations = predefinedCombinations; - } public void setRelativeMinImpactThreshold(double relativeMinImpactThreshold) { if (relativeMinImpactThreshold < 0) { @@ -69,31 +43,6 @@ public void setAbsoluteMinImpactThreshold(double absoluteMinImpactThreshold) { this.absoluteMinImpactThreshold = absoluteMinImpactThreshold; } - public void setSkipActionsFarFromMostLimitingElement(boolean skipActionsFarFromMostLimitingElement) { - this.skipActionsFarFromMostLimitingElement = skipActionsFarFromMostLimitingElement; - } - - public void setMaxNumberOfBoundariesForSkippingActions(int maxNumberOfBoundariesForSkippingActions) { - if (maxNumberOfBoundariesForSkippingActions < 0) { - BUSINESS_WARNS.warn("The value {} provided for max number of boundaries for skipping actions is smaller than 0. It will be set to 0.", maxNumberOfBoundariesForSkippingActions); - this.maxNumberOfBoundariesForSkippingActions = 0; - } else { - this.maxNumberOfBoundariesForSkippingActions = maxNumberOfBoundariesForSkippingActions; - } - } - - public int getMaxPreventiveSearchTreeDepth() { - return maxPreventiveSearchTreeDepth; - } - - public int getMaxAutoSearchTreeDepth() { - return maxAutoSearchTreeDepth; - } - - public int getMaxCurativeSearchTreeDepth() { - return maxCurativeSearchTreeDepth; - } - public double getRelativeMinImpactThreshold() { return relativeMinImpactThreshold; } @@ -102,31 +51,13 @@ public double getAbsoluteMinImpactThreshold() { return absoluteMinImpactThreshold; } - public boolean getSkipActionsFarFromMostLimitingElement() { - return skipActionsFarFromMostLimitingElement; - } - - public int getMaxNumberOfBoundariesForSkippingActions() { - return maxNumberOfBoundariesForSkippingActions; - } - - public List> getPredefinedCombinations() { - return predefinedCombinations; - } - public static TopoOptimizationParameters load(PlatformConfig platformConfig) { Objects.requireNonNull(platformConfig); TopoOptimizationParameters parameters = new TopoOptimizationParameters(); platformConfig.getOptionalModuleConfig(TOPOLOGICAL_ACTIONS_OPTIMIZATION_SECTION) .ifPresent(config -> { - parameters.setMaxPreventiveSearchTreeDepth(config.getIntProperty(MAX_PREVENTIVE_SEARCH_TREE_DEPTH, DEFAULT_MAX_SEARCH_TREE_DEPTH)); - parameters.setMaxAutoSearchTreeDepth(config.getIntProperty(MAX_AUTO_SEARCH_TREE_DEPTH, DEFAULT_MAX_SEARCH_TREE_DEPTH)); - parameters.setMaxCurativeSearchTreeDepth(config.getIntProperty(MAX_CURATIVE_SEARCH_TREE_DEPTH, DEFAULT_MAX_SEARCH_TREE_DEPTH)); - parameters.setPredefinedCombinations(ParametersUtil.convertListToListOfList(config.getStringListProperty(PREDEFINED_COMBINATIONS, ParametersUtil.convertListOfListToList(DEFAULT_PREDEFINED_COMBINATIONS)))); parameters.setRelativeMinImpactThreshold(config.getDoubleProperty(RELATIVE_MINIMUM_IMPACT_THRESHOLD, DEFAULT_RELATIVE_MIN_IMPACT_THRESHOLD)); parameters.setAbsoluteMinImpactThreshold(config.getDoubleProperty(ABSOLUTE_MINIMUM_IMPACT_THRESHOLD, DEFAULT_ABSOLUTE_MIN_IMPACT_THRESHOLD)); - parameters.setSkipActionsFarFromMostLimitingElement(config.getBooleanProperty(SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT, DEFAULT_SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT)); - parameters.setMaxNumberOfBoundariesForSkippingActions(config.getIntProperty(MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS, DEFAULT_MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS)); }); return parameters; } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/LoadFlowAndSensitivityParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoadFlowAndSensitivityParameters.java similarity index 68% rename from ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/LoadFlowAndSensitivityParameters.java rename to ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoadFlowAndSensitivityParameters.java index f5d290dc93..3414d3f23b 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/LoadFlowAndSensitivityParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoadFlowAndSensitivityParameters.java @@ -5,15 +5,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -package com.powsybl.openrao.raoapi.parameters; +package com.powsybl.openrao.raoapi.parameters.extensions; import com.powsybl.commons.config.PlatformConfig; import com.powsybl.loadflow.LoadFlowParameters; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.sensitivity.SensitivityAnalysisParameters; import java.util.Objects; -import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + import static com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider.BUSINESS_WARNS; +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; /** * LoadFlow and sensitivity computation parameters for RAO @@ -79,7 +81,37 @@ public static LoadFlowAndSensitivityParameters load(PlatformConfig platformConfi return parameters; } - private SensitivityAnalysisParameters cleanLoadFlowParameters(SensitivityAnalysisParameters sensitivityAnalysisParameters) { + public static String getLoadFlowProvider(RaoParameters raoParameters) { + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getLoadFlowAndSensitivityParameters().getLoadFlowProvider(); + } + return DEFAULT_LOADFLOW_PROVIDER; + } + + public static double getSensitivityFailureOvercost(RaoParameters raoParameters) { + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getLoadFlowAndSensitivityParameters().getSensitivityFailureOvercost(); + } + return DEFAULT_SENSITIVITY_FAILURE_OVERCOST; + } + + public static String getSensitivityProvider(RaoParameters raoParameters) { + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getLoadFlowAndSensitivityParameters().getSensitivityProvider(); + } + return DEFAULT_SENSITIVITY_PROVIDER; + } + + // The return value should not be written since it will re-write the parameters if the value si the real one, + // but it will not if the value is the default one since it is an independent object + public static SensitivityAnalysisParameters getSensitivityWithLoadFlowParameters(RaoParameters raoParameters) { + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters(); + } + return cleanLoadFlowParameters(new SensitivityAnalysisParameters()); + } + + private static SensitivityAnalysisParameters cleanLoadFlowParameters(SensitivityAnalysisParameters sensitivityAnalysisParameters) { LoadFlowParameters loadFlowParameters = sensitivityAnalysisParameters.getLoadFlowParameters(); // we have to clean load flow parameters. // the slack bus must not be written because it could pollute the sensitivity analyses. @@ -88,7 +120,7 @@ private SensitivityAnalysisParameters cleanLoadFlowParameters(SensitivityAnalysi // lead to incoherence. if (loadFlowParameters.isDc() && loadFlowParameters.isHvdcAcEmulation()) { BUSINESS_WARNS.warn("The runs are in DC but the HvdcAcEmulation parameter is on: this is not compatible." + - "HvdcAcEmulation parameter set to false."); + "HvdcAcEmulation parameter set to false."); loadFlowParameters.setHvdcAcEmulation(false); } return sensitivityAnalysisParameters; diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoopFlowParametersConfigLoader.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoopFlowParametersConfigLoader.java deleted file mode 100644 index c19a8a8c6c..0000000000 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoopFlowParametersConfigLoader.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.openrao.raoapi.parameters.extensions; - -import com.powsybl.openrao.raoapi.parameters.ParametersUtil; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.google.auto.service.AutoService; -import com.powsybl.commons.config.PlatformConfig; - -import java.util.ArrayList; -import java.util.Objects; - -import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; -/** - * @author Godelaine de Montmorillon {@literal } - */ -@AutoService(RaoParameters.ConfigLoader.class) -public class LoopFlowParametersConfigLoader implements RaoParameters.ConfigLoader { - - @Override - public LoopFlowParametersExtension load(PlatformConfig platformConfig) { - Objects.requireNonNull(platformConfig); - LoopFlowParametersExtension parameters = new LoopFlowParametersExtension(); - platformConfig.getOptionalModuleConfig(LOOP_FLOW_PARAMETERS_SECTION) - .ifPresent(config -> { - parameters.setAcceptableIncrease(config.getDoubleProperty(ACCEPTABLE_INCREASE, LoopFlowParametersExtension.DEFAULT_ACCEPTABLE_INCREASE)); - parameters.setPtdfApproximation(config.getEnumProperty(PTDF_APPROXIMATION, PtdfApproximation.class, LoopFlowParametersExtension.DEFAULT_PTDF_APPROXIMATION)); - parameters.setConstraintAdjustmentCoefficient(config.getDoubleProperty(CONSTRAINT_ADJUSTMENT_COEFFICIENT, LoopFlowParametersExtension.DEFAULT_CONSTRAINT_ADJUSTMENT_COEFFICIENT)); - parameters.setViolationCost(config.getDoubleProperty(VIOLATION_COST, LoopFlowParametersExtension.DEFAULT_VIOLATION_COST)); - parameters.setCountries(ParametersUtil.convertToCountrySet(config.getStringListProperty(COUNTRIES, new ArrayList<>()))); - }); - return parameters; - } - - @Override - public String getExtensionName() { - return LOOP_FLOW_PARAMETERS_SECTION; - } - - @Override - public String getCategoryName() { - return "rao-parameters"; - } - - @Override - public Class getExtensionClass() { - return LoopFlowParametersExtension.class; - } -} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MnecParametersConfigLoader.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MnecParametersConfigLoader.java deleted file mode 100644 index f70a1e15fc..0000000000 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MnecParametersConfigLoader.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.openrao.raoapi.parameters.extensions; - -import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.google.auto.service.AutoService; -import com.powsybl.commons.config.PlatformConfig; - -import java.util.Objects; - -import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; -/** - * @author Godelaine de Montmorillon {@literal } - */ -@AutoService(RaoParameters.ConfigLoader.class) -public class MnecParametersConfigLoader implements RaoParameters.ConfigLoader { - - @Override - public MnecParametersExtension load(PlatformConfig platformConfig) { - Objects.requireNonNull(platformConfig); - MnecParametersExtension parameters = new MnecParametersExtension(); - platformConfig.getOptionalModuleConfig(MNEC_PARAMETERS_SECTION) - .ifPresent(config -> { - parameters.setAcceptableMarginDecrease(config.getDoubleProperty(ACCEPTABLE_MARGIN_DECREASE, MnecParametersExtension.DEFAULT_ACCEPTABLE_MARGIN_DECREASE)); - parameters.setViolationCost(config.getDoubleProperty(VIOLATION_COST, MnecParametersExtension.DEFAULT_VIOLATION_COST)); - parameters.setConstraintAdjustmentCoefficient(config.getDoubleProperty(CONSTRAINT_ADJUSTMENT_COEFFICIENT, MnecParametersExtension.DEFAULT_CONSTRAINT_ADJUSTMENT_COEFFICIENT)); - }); - return parameters; - } - - @Override - public String getExtensionName() { - return MNEC_PARAMETERS_SECTION; - } - - @Override - public String getCategoryName() { - return "rao-parameters"; - } - - @Override - public Class getExtensionClass() { - return MnecParametersExtension.class; - } -} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MultithreadingParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MultithreadingParameters.java new file mode 100644 index 0000000000..e4ad704477 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MultithreadingParameters.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ + +package com.powsybl.openrao.raoapi.parameters.extensions; + +import com.powsybl.commons.config.PlatformConfig; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; + +import java.util.Objects; +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; +/** + * Multi-threading optimization parameters for RAO + * + * @author Godelaine de Montmorillon {@literal } + * @author Pauline JEAN-MARIE {@literal } + */ +public class MultithreadingParameters { + private static final int DEFAULT_AVAILABLE_CPUS = 1; + private int availableCPUs = DEFAULT_AVAILABLE_CPUS; + + public int getAvailableCPUs() { + return availableCPUs; + } + + public void setAvailableCPUs(int availableCPUs) { + this.availableCPUs = availableCPUs; + } + + public static MultithreadingParameters load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + MultithreadingParameters parameters = new MultithreadingParameters(); + platformConfig.getOptionalModuleConfig(MULTI_THREADING_SECTION) + .ifPresent(config -> { + int availableCpus = config.getIntProperty(AVAILABLE_CPUS, 1); + parameters.setAvailableCPUs(availableCpus); + }); + return parameters; + } + + public static int getAvailableCPUs(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getMultithreadingParameters().getAvailableCPUs(); + } + return DEFAULT_AVAILABLE_CPUS; + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/OpenRaoSearchTreeParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/OpenRaoSearchTreeParameters.java new file mode 100644 index 0000000000..eac0006109 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/OpenRaoSearchTreeParameters.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ + +package com.powsybl.openrao.raoapi.parameters.extensions; + +import com.powsybl.commons.extensions.AbstractExtension; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; + +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.SEARCH_TREE_PARAMETERS; + +/** + * @author Pauline JEAN-MARIE {@literal } + */ +public class OpenRaoSearchTreeParameters extends AbstractExtension { + private SearchTreeRaoObjectiveFunctionParameters objectiveFunctionParameters = new SearchTreeRaoObjectiveFunctionParameters(); + private SearchTreeRaoRangeActionsOptimizationParameters rangeActionsOptimizationParameters = new SearchTreeRaoRangeActionsOptimizationParameters(); + private SearchTreeRaoTopoOptimizationParameters topoOptimizationParameters = new SearchTreeRaoTopoOptimizationParameters(); + private MultithreadingParameters multithreadingParameters = new MultithreadingParameters(); + private SecondPreventiveRaoParameters secondPreventiveRaoParameters = new SecondPreventiveRaoParameters(); + private LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters = new LoadFlowAndSensitivityParameters(); + private Optional mnecParameters = Optional.empty(); + private Optional relativeMarginsParameters = Optional.empty(); + private Optional loopFlowParameters = Optional.empty(); + + // Getters and setters + public void setObjectiveFunctionParameters(SearchTreeRaoObjectiveFunctionParameters objectiveFunctionParameters) { + this.objectiveFunctionParameters = objectiveFunctionParameters; + } + + public void setRangeActionsOptimizationParameters(SearchTreeRaoRangeActionsOptimizationParameters rangeActionsOptimizationParameters) { + this.rangeActionsOptimizationParameters = rangeActionsOptimizationParameters; + } + + public void setTopoOptimizationParameters(SearchTreeRaoTopoOptimizationParameters topoOptimizationParameters) { + this.topoOptimizationParameters = topoOptimizationParameters; + } + + public void setMultithreadingParameters(MultithreadingParameters multithreadingParameters) { + this.multithreadingParameters = multithreadingParameters; + } + + public void setSecondPreventiveRaoParameters(SecondPreventiveRaoParameters secondPreventiveRaoParameters) { + this.secondPreventiveRaoParameters = secondPreventiveRaoParameters; + } + + public void setLoadFlowAndSensitivityParameters(LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters) { + this.loadFlowAndSensitivityParameters = loadFlowAndSensitivityParameters; + } + + public void setMnecParameters(SearchTreeRaoMnecParameters mnecParameters) { + this.mnecParameters = Optional.of(mnecParameters); + } + + public void setRelativeMarginsParameters(SearchTreeRaoRelativeMarginsParameters relativeMarginsParameters) { + this.relativeMarginsParameters = Optional.of(relativeMarginsParameters); + } + + public void setLoopFlowParameters(SearchTreeRaoLoopFlowParameters loopFlowParameters) { + this.loopFlowParameters = Optional.of(loopFlowParameters); + } + + public SearchTreeRaoObjectiveFunctionParameters getObjectiveFunctionParameters() { + return objectiveFunctionParameters; + } + + public SearchTreeRaoRangeActionsOptimizationParameters getRangeActionsOptimizationParameters() { + return rangeActionsOptimizationParameters; + } + + public SearchTreeRaoTopoOptimizationParameters getTopoOptimizationParameters() { + return topoOptimizationParameters; + } + + public MultithreadingParameters getMultithreadingParameters() { + return multithreadingParameters; + } + + public SecondPreventiveRaoParameters getSecondPreventiveRaoParameters() { + return secondPreventiveRaoParameters; + } + + public LoadFlowAndSensitivityParameters getLoadFlowAndSensitivityParameters() { + return loadFlowAndSensitivityParameters; + } + + public Optional getMnecParameters() { + return mnecParameters; + } + + public Optional getRelativeMarginsParameters() { + return relativeMarginsParameters; + } + + public Optional getLoopFlowParameters() { + return loopFlowParameters; + } + + @Override + public String getName() { + return SEARCH_TREE_PARAMETERS; + } + +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/OpenRaoSearchTreeParametersConfigLoader.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/OpenRaoSearchTreeParametersConfigLoader.java new file mode 100644 index 0000000000..75d03fd66d --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/OpenRaoSearchTreeParametersConfigLoader.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 + */ +package com.powsybl.openrao.raoapi.parameters.extensions; + +import com.google.auto.service.AutoService; +import com.powsybl.commons.config.PlatformConfig; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + + +/** + * @author Pauline JEAN-MARIE {@literal } + */ +@AutoService(RaoParameters.ConfigLoader.class) +public class OpenRaoSearchTreeParametersConfigLoader implements RaoParameters.ConfigLoader { + + @Override + public OpenRaoSearchTreeParameters load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + List searchTreeParams = Arrays.asList(ST_OBJECTIVE_FUNCTION_SECTION, ST_RANGE_ACTIONS_OPTIMIZATION_SECTION, ST_TOPOLOGICAL_ACTIONS_OPTIMIZATION_SECTION, MULTI_THREADING_SECTION, SECOND_PREVENTIVE_RAO_SECTION, LOAD_FLOW_AND_SENSITIVITY_COMPUTATION_SECTION, ST_MNEC_PARAMETERS_SECTION, ST_RELATIVE_MARGINS_SECTION, ST_LOOP_FLOW_PARAMETERS_SECTION); + boolean anySearchTreeParams = searchTreeParams.stream().map(platformConfig::getOptionalModuleConfig).anyMatch(Optional::isPresent); + if (!anySearchTreeParams) { + return null; + } + OpenRaoSearchTreeParameters parameters = new OpenRaoSearchTreeParameters(); + parameters.setObjectiveFunctionParameters(SearchTreeRaoObjectiveFunctionParameters.load(platformConfig)); + parameters.setRangeActionsOptimizationParameters(SearchTreeRaoRangeActionsOptimizationParameters.load(platformConfig)); + parameters.setTopoOptimizationParameters(SearchTreeRaoTopoOptimizationParameters.load(platformConfig)); + parameters.setMultithreadingParameters(MultithreadingParameters.load(platformConfig)); + parameters.setSecondPreventiveRaoParameters(SecondPreventiveRaoParameters.load(platformConfig)); + parameters.setLoadFlowAndSensitivityParameters(LoadFlowAndSensitivityParameters.load(platformConfig)); + SearchTreeRaoMnecParameters.load(platformConfig).ifPresent(parameters::setMnecParameters); + SearchTreeRaoRelativeMarginsParameters.load(platformConfig).ifPresent(parameters::setRelativeMarginsParameters); + SearchTreeRaoLoopFlowParameters.load(platformConfig).ifPresent(parameters::setLoopFlowParameters); + return parameters; + } + + @Override + public String getExtensionName() { + return SEARCH_TREE_PARAMETERS; + } + + @Override + public String getCategoryName() { + return "rao-parameters"; + } + + @Override + public Class getExtensionClass() { + return OpenRaoSearchTreeParameters.class; + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/RelativeMarginsParametersConfigLoader.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/RelativeMarginsParametersConfigLoader.java deleted file mode 100644 index 5f45015075..0000000000 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/RelativeMarginsParametersConfigLoader.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2023, RTE (http://www.rte-france.com) - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ -package com.powsybl.openrao.raoapi.parameters.extensions; - -import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.google.auto.service.AutoService; -import com.powsybl.commons.config.PlatformConfig; - -import java.util.ArrayList; -import java.util.Objects; - -import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; -/** - * @author Godelaine de Montmorillon {@literal } - */ -@AutoService(RaoParameters.ConfigLoader.class) -public class RelativeMarginsParametersConfigLoader implements RaoParameters.ConfigLoader { - - @Override - public RelativeMarginsParametersExtension load(PlatformConfig platformConfig) { - Objects.requireNonNull(platformConfig); - RelativeMarginsParametersExtension parameters = new RelativeMarginsParametersExtension(); - platformConfig.getOptionalModuleConfig(RELATIVE_MARGINS_SECTION) - .ifPresent(config -> { - parameters.setPtdfBoundariesFromString(config.getStringListProperty(PTDF_BOUNDARIES, new ArrayList<>())); - parameters.setPtdfApproximation(config.getEnumProperty(PTDF_APPROXIMATION, PtdfApproximation.class, RelativeMarginsParametersExtension.DEFAULT_PTDF_APPROXIMATION)); - parameters.setPtdfSumLowerBound(config.getDoubleProperty(PTDF_SUM_LOWER_BOUND, RelativeMarginsParametersExtension.DEFAULT_PTDF_SUM_LOWER_BOUND)); - }); - return parameters; - } - - @Override - public String getExtensionName() { - return RELATIVE_MARGINS_SECTION; - } - - @Override - public String getCategoryName() { - return "rao-parameters"; - } - - @Override - public Class getExtensionClass() { - return RelativeMarginsParametersExtension.class; - } -} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoopFlowParametersExtension.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoLoopFlowParameters.java similarity index 59% rename from ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoopFlowParametersExtension.java rename to ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoLoopFlowParameters.java index b1396a4ce6..716ce094ff 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/LoopFlowParametersExtension.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoLoopFlowParameters.java @@ -6,12 +6,10 @@ */ package com.powsybl.openrao.raoapi.parameters.extensions; -import com.powsybl.openrao.raoapi.parameters.ParametersUtil; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.commons.extensions.AbstractExtension; -import com.powsybl.iidm.network.Country; +import com.powsybl.commons.config.PlatformConfig; -import java.util.*; +import java.util.Objects; +import java.util.Optional; import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; @@ -20,27 +18,16 @@ * * @author Godelaine de Montmorillon {@literal } */ -public class LoopFlowParametersExtension extends AbstractExtension { - static final double DEFAULT_ACCEPTABLE_INCREASE = 0.0; +public class SearchTreeRaoLoopFlowParameters { static final PtdfApproximation DEFAULT_PTDF_APPROXIMATION = PtdfApproximation.FIXED_PTDF; static final double DEFAULT_CONSTRAINT_ADJUSTMENT_COEFFICIENT = 0.0; static final double DEFAULT_VIOLATION_COST = 0.0; - static final Set DEFAULT_COUNTRIES = new HashSet<>(); //Empty by default - private double acceptableIncrease = DEFAULT_ACCEPTABLE_INCREASE; private PtdfApproximation ptdfApproximation = DEFAULT_PTDF_APPROXIMATION; private double constraintAdjustmentCoefficient = DEFAULT_CONSTRAINT_ADJUSTMENT_COEFFICIENT; private double violationCost = DEFAULT_VIOLATION_COST; - private Set countries = DEFAULT_COUNTRIES; // Getters and setters - public double getAcceptableIncrease() { - return acceptableIncrease; - } - - public void setAcceptableIncrease(double acceptableIncrease) { - this.acceptableIncrease = acceptableIncrease; - } public PtdfApproximation getPtdfApproximation() { return ptdfApproximation; @@ -66,21 +53,16 @@ public void setViolationCost(double violationCost) { this.violationCost = violationCost; } - public Set getCountries() { - return countries; - } - - public void setCountries(Set countries) { - this.countries = countries; - } - - public void setCountries(List countryStrings) { - this.countries = ParametersUtil.convertToCountrySet(countryStrings); - } - - @Override - public String getName() { - return LOOP_FLOW_PARAMETERS; + public static Optional load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + return platformConfig.getOptionalModuleConfig(ST_LOOP_FLOW_PARAMETERS_SECTION) + .map(config -> { + SearchTreeRaoLoopFlowParameters parameters = new SearchTreeRaoLoopFlowParameters(); + parameters.setPtdfApproximation(config.getEnumProperty(PTDF_APPROXIMATION, PtdfApproximation.class, SearchTreeRaoLoopFlowParameters.DEFAULT_PTDF_APPROXIMATION)); + parameters.setConstraintAdjustmentCoefficient(config.getDoubleProperty(CONSTRAINT_ADJUSTMENT_COEFFICIENT, SearchTreeRaoLoopFlowParameters.DEFAULT_CONSTRAINT_ADJUSTMENT_COEFFICIENT)); + parameters.setViolationCost(config.getDoubleProperty(VIOLATION_COST, SearchTreeRaoLoopFlowParameters.DEFAULT_VIOLATION_COST)); + return parameters; + }); } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MnecParametersExtension.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoMnecParameters.java similarity index 56% rename from ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MnecParametersExtension.java rename to ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoMnecParameters.java index 4489df24a6..b00241cf4e 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/MnecParametersExtension.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoMnecParameters.java @@ -7,37 +7,26 @@ package com.powsybl.openrao.raoapi.parameters.extensions; -import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.commons.extensions.AbstractExtension; +import com.powsybl.commons.config.PlatformConfig; + +import java.util.Objects; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; +import static com.powsybl.openrao.raoapi.RaoParametersCommons.CONSTRAINT_ADJUSTMENT_COEFFICIENT; -import static com.powsybl.openrao.raoapi.RaoParametersCommons.MNEC_PARAMETERS; /** * Extension : MNEC parameters for RAO * * @author Godelaine de Montmorillon {@literal } */ -public class MnecParametersExtension extends AbstractExtension { - static final double DEFAULT_ACCEPTABLE_MARGIN_DECREASE = 50.0; +public class SearchTreeRaoMnecParameters { static final double DEFAULT_VIOLATION_COST = 10.0; static final double DEFAULT_CONSTRAINT_ADJUSTMENT_COEFFICIENT = 0.0; - private double acceptableMarginDecrease = DEFAULT_ACCEPTABLE_MARGIN_DECREASE; // "A equivalent cost per A violation" or "MW per MW", depending on the objective function private double violationCost = DEFAULT_VIOLATION_COST; private double constraintAdjustmentCoefficient = DEFAULT_CONSTRAINT_ADJUSTMENT_COEFFICIENT; - @Override - public String getName() { - return MNEC_PARAMETERS; - } - - public double getAcceptableMarginDecrease() { - return acceptableMarginDecrease; - } - - public void setAcceptableMarginDecrease(double acceptableMarginDecrease) { - this.acceptableMarginDecrease = acceptableMarginDecrease; - } - public double getViolationCost() { return violationCost; } @@ -53,4 +42,15 @@ public double getConstraintAdjustmentCoefficient() { public void setConstraintAdjustmentCoefficient(double constraintAdjustmentCoefficient) { this.constraintAdjustmentCoefficient = constraintAdjustmentCoefficient; } + + public static Optional load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + return platformConfig.getOptionalModuleConfig(ST_MNEC_PARAMETERS_SECTION) + .map(config -> { + SearchTreeRaoMnecParameters parameters = new SearchTreeRaoMnecParameters(); + parameters.setViolationCost(config.getDoubleProperty(VIOLATION_COST, SearchTreeRaoMnecParameters.DEFAULT_VIOLATION_COST)); + parameters.setConstraintAdjustmentCoefficient(config.getDoubleProperty(CONSTRAINT_ADJUSTMENT_COEFFICIENT, SearchTreeRaoMnecParameters.DEFAULT_CONSTRAINT_ADJUSTMENT_COEFFICIENT)); + return parameters; + }); + } } diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoObjectiveFunctionParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoObjectiveFunctionParameters.java new file mode 100644 index 0000000000..b696048a80 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoObjectiveFunctionParameters.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package com.powsybl.openrao.raoapi.parameters.extensions; + +import com.powsybl.commons.config.PlatformConfig; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; + +import static com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider.BUSINESS_WARNS; +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * Objective function parameters for RAO + * + * @author Godelaine de Montmorillon {@literal } + * @author Pauline JEAN-MARIE {@literal } + */ +public class SearchTreeRaoObjectiveFunctionParameters { + private static final double DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT = 0; + private double curativeMinObjImprovement = DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT; + + public double getCurativeMinObjImprovement() { + return curativeMinObjImprovement; + } + + public static SearchTreeRaoObjectiveFunctionParameters load(PlatformConfig platformConfig) { + SearchTreeRaoObjectiveFunctionParameters parameters = new SearchTreeRaoObjectiveFunctionParameters(); + platformConfig.getOptionalModuleConfig(ST_OBJECTIVE_FUNCTION_SECTION) + .ifPresent(config -> parameters.setCurativeMinObjImprovement(config.getDoubleProperty(CURATIVE_MIN_OBJ_IMPROVEMENT, DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT))); + return parameters; + } + + public void setCurativeMinObjImprovement(double curativeRaoMinObjImprovement) { + if (curativeRaoMinObjImprovement < 0) { + BUSINESS_WARNS.warn("The value {} provided for curative RAO minimum objective improvement is smaller than 0. It will be set to + {}", curativeRaoMinObjImprovement, -curativeRaoMinObjImprovement); + } + this.curativeMinObjImprovement = Math.abs(curativeRaoMinObjImprovement); + } + + public static double getCurativeMinObjImprovement(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getObjectiveFunctionParameters().getCurativeMinObjImprovement(); + } + return DEFAULT_CURATIVE_MIN_OBJ_IMPROVEMENT; + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoRangeActionsOptimizationParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoRangeActionsOptimizationParameters.java new file mode 100644 index 0000000000..a4fe2bc8b7 --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoRangeActionsOptimizationParameters.java @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package com.powsybl.openrao.raoapi.parameters.extensions; + +import com.powsybl.commons.config.PlatformConfig; +import com.powsybl.openrao.commons.OpenRaoException; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; + +import java.util.Objects; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * Range actions optimization parameters for RAO + * + * @author Godelaine de Montmorillon {@literal } + * @author Pauline JEAN-MARIE {@literal } + * + */ +public class SearchTreeRaoRangeActionsOptimizationParameters { + + // Default values + private static final int DEFAULT_MAX_MIP_ITERATIONS = 10; + private static final double DEFAULT_PST_SENSITIVITY_THRESHOLD = 1e-6; + private static final PstModel DEFAULT_PST_MODEL = PstModel.CONTINUOUS; + private static final double DEFAULT_HVDC_SENSITIVITY_THRESHOLD = 1e-6; + private static final double DEFAULT_INJECTION_RA_SENSITIVITY_THRESHOLD = 1e-6; + private static final RaRangeShrinking DEFAULT_RA_RANGE_SHRINKING = RaRangeShrinking.DISABLED; + // Attributes + private int maxMipIterations = DEFAULT_MAX_MIP_ITERATIONS; + private double pstSensitivityThreshold = DEFAULT_PST_SENSITIVITY_THRESHOLD; + private PstModel pstModel = DEFAULT_PST_MODEL; + private double hvdcSensitivityThreshold = DEFAULT_HVDC_SENSITIVITY_THRESHOLD; + private double injectionRaSensitivityThreshold = DEFAULT_INJECTION_RA_SENSITIVITY_THRESHOLD; + private LinearOptimizationSolver linearOptimizationSolver = new LinearOptimizationSolver(); + private RaRangeShrinking raRangeShrinking = DEFAULT_RA_RANGE_SHRINKING; + + public enum PstModel { + CONTINUOUS, + APPROXIMATED_INTEGERS + } + + public enum RaRangeShrinking { + DISABLED, + ENABLED, + ENABLED_IN_FIRST_PRAO_AND_CRAO + } + + public static class LinearOptimizationSolver { + private static final Solver DEFAULT_SOLVER = Solver.CBC; + public static final double DEFAULT_RELATIVE_MIP_GAP = 0.0001; + public static final String DEFAULT_SOLVER_SPECIFIC_PARAMETERS = null; + private Solver solver = DEFAULT_SOLVER; + private double relativeMipGap = DEFAULT_RELATIVE_MIP_GAP; + private String solverSpecificParameters = DEFAULT_SOLVER_SPECIFIC_PARAMETERS; + + public Solver getSolver() { + return solver; + } + + public void setSolver(Solver solver) { + this.solver = solver; + } + + public double getRelativeMipGap() { + return relativeMipGap; + } + + public void setRelativeMipGap(double relativeMipGap) { + this.relativeMipGap = relativeMipGap; + } + + public String getSolverSpecificParameters() { + return solverSpecificParameters; + } + + public void setSolverSpecificParameters(String solverSpecificParameters) { + this.solverSpecificParameters = solverSpecificParameters; + } + + public static LinearOptimizationSolver load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + LinearOptimizationSolver parameters = new LinearOptimizationSolver(); + platformConfig.getOptionalModuleConfig(LINEAR_OPTIMIZATION_SOLVER_SECTION) + .ifPresent(config -> { + parameters.setSolver(config.getEnumProperty(SOLVER, Solver.class, DEFAULT_SOLVER)); + parameters.setRelativeMipGap(config.getDoubleProperty(RELATIVE_MIP_GAP, DEFAULT_RELATIVE_MIP_GAP)); + parameters.setSolverSpecificParameters(config.getStringProperty(SOLVER_SPECIFIC_PARAMETERS, DEFAULT_SOLVER_SPECIFIC_PARAMETERS)); + }); + return parameters; + } + } + + public enum Solver { + CBC, + SCIP, + XPRESS + } + + // Getters and setters + public int getMaxMipIterations() { + return maxMipIterations; + } + + public void setMaxMipIterations(int maxMipIterations) { + this.maxMipIterations = maxMipIterations; + } + + public double getPstSensitivityThreshold() { + return pstSensitivityThreshold; + } + + public void setPstSensitivityThreshold(double pstSensitivityThreshold) { + if (pstSensitivityThreshold < 1e-6) { + throw new OpenRaoException("pstSensitivityThreshold should be greater than 1e-6, to avoid numerical issues."); + } + this.pstSensitivityThreshold = pstSensitivityThreshold; + } + + public double getHvdcSensitivityThreshold() { + return hvdcSensitivityThreshold; + } + + public void setHvdcSensitivityThreshold(double hvdcSensitivityThreshold) { + if (hvdcSensitivityThreshold < 1e-6) { + throw new OpenRaoException("hvdcSensitivityThreshold should be greater than 1e-6, to avoid numerical issues."); + } + this.hvdcSensitivityThreshold = hvdcSensitivityThreshold; + } + + public double getInjectionRaSensitivityThreshold() { + return injectionRaSensitivityThreshold; + } + + public void setInjectionRaSensitivityThreshold(double injectionRaSensitivityThreshold) { + if (injectionRaSensitivityThreshold < 1e-6) { + throw new OpenRaoException("injectionRaSensitivityThreshold should be greater than 1e-6, to avoid numerical issues."); + } + this.injectionRaSensitivityThreshold = injectionRaSensitivityThreshold; + } + + public LinearOptimizationSolver getLinearOptimizationSolver() { + return linearOptimizationSolver; + } + + public void setPstModel(PstModel pstModel) { + this.pstModel = pstModel; + } + + public PstModel getPstModel() { + return pstModel; + } + + public void setLinearOptimizationSolver(LinearOptimizationSolver linearOptimizationSolver) { + this.linearOptimizationSolver = linearOptimizationSolver; + } + + public void setRaRangeShrinking(RaRangeShrinking raRangeShrinking) { + this.raRangeShrinking = raRangeShrinking; + } + + public RaRangeShrinking getRaRangeShrinking() { + return raRangeShrinking; + } + + public static SearchTreeRaoRangeActionsOptimizationParameters load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + SearchTreeRaoRangeActionsOptimizationParameters parameters = new SearchTreeRaoRangeActionsOptimizationParameters(); + platformConfig.getOptionalModuleConfig(ST_RANGE_ACTIONS_OPTIMIZATION_SECTION) + .ifPresent(config -> { + parameters.setMaxMipIterations(config.getIntProperty(MAX_MIP_ITERATIONS, DEFAULT_MAX_MIP_ITERATIONS)); + parameters.setPstSensitivityThreshold(config.getDoubleProperty(PST_SENSITIVITY_THRESHOLD, DEFAULT_PST_SENSITIVITY_THRESHOLD)); + parameters.setPstModel(config.getEnumProperty(PST_MODEL, PstModel.class, DEFAULT_PST_MODEL)); + parameters.setHvdcSensitivityThreshold(config.getDoubleProperty(HVDC_SENSITIVITY_THRESHOLD, DEFAULT_HVDC_SENSITIVITY_THRESHOLD)); + parameters.setInjectionRaSensitivityThreshold(config.getDoubleProperty(INJECTION_RA_SENSITIVITY_THRESHOLD, DEFAULT_INJECTION_RA_SENSITIVITY_THRESHOLD)); + parameters.setRaRangeShrinking(config.getEnumProperty(RA_RANGE_SHRINKING, RaRangeShrinking.class, DEFAULT_RA_RANGE_SHRINKING)); + }); + parameters.setLinearOptimizationSolver(LinearOptimizationSolver.load(platformConfig)); + return parameters; + } + + public static PstModel getPstModel(RaoParameters raoParameters) { + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getRangeActionsOptimizationParameters().getPstModel(); + } + return DEFAULT_PST_MODEL; + } + + public static RaRangeShrinking getRaRangeShrinking(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getRangeActionsOptimizationParameters().getRaRangeShrinking(); + } + return DEFAULT_RA_RANGE_SHRINKING; + } + + // The return value should not be written since it will re-write the parameters if the value si the real one, + // but it will not if the value is the default one since it is an independent object + public static LinearOptimizationSolver getLinearOptimizationSolver(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getRangeActionsOptimizationParameters().getLinearOptimizationSolver(); + } + return new LinearOptimizationSolver(); + } + + public static int getMaxMipIterations(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getRangeActionsOptimizationParameters().getMaxMipIterations(); + } + return DEFAULT_MAX_MIP_ITERATIONS; + } + + public static PstModel getPstModel(SearchTreeRaoRangeActionsOptimizationParameters rangeActionsOptimizationParameters) { + if (!Objects.isNull(rangeActionsOptimizationParameters)) { + return rangeActionsOptimizationParameters.getPstModel(); + } + return DEFAULT_PST_MODEL; + } + + public static double getPstSensitivityThreshold(SearchTreeRaoRangeActionsOptimizationParameters rangeActionsOptimizationParameters) { + if (!Objects.isNull(rangeActionsOptimizationParameters)) { + return rangeActionsOptimizationParameters.getPstSensitivityThreshold(); + } + return DEFAULT_PST_SENSITIVITY_THRESHOLD; + } + + public static double getHvdcSensitivityThreshold(SearchTreeRaoRangeActionsOptimizationParameters rangeActionsOptimizationParameters) { + if (!Objects.isNull(rangeActionsOptimizationParameters)) { + return rangeActionsOptimizationParameters.getHvdcSensitivityThreshold(); + } + return DEFAULT_HVDC_SENSITIVITY_THRESHOLD; + } + + public static double getInjectionRaSensitivityThreshold(SearchTreeRaoRangeActionsOptimizationParameters rangeActionsOptimizationParameters) { + if (!Objects.isNull(rangeActionsOptimizationParameters)) { + return rangeActionsOptimizationParameters.getInjectionRaSensitivityThreshold(); + } + return DEFAULT_INJECTION_RA_SENSITIVITY_THRESHOLD; + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoRelativeMarginsParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoRelativeMarginsParameters.java new file mode 100644 index 0000000000..32c6551b2d --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoRelativeMarginsParameters.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package com.powsybl.openrao.raoapi.parameters.extensions; + +import com.powsybl.commons.config.PlatformConfig; + +import java.util.Objects; +import java.util.Optional; + +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; +import static com.powsybl.openrao.raoapi.RaoParametersCommons.PTDF_SUM_LOWER_BOUND; + +/** + * Extension : relative margin parameters for RAO + * + * @author Godelaine de Montmorillon {@literal } + */ +public class SearchTreeRaoRelativeMarginsParameters { + + static final double DEFAULT_PTDF_SUM_LOWER_BOUND = 0.01; + static final PtdfApproximation DEFAULT_PTDF_APPROXIMATION = PtdfApproximation.FIXED_PTDF; + // prevents relative margins from diverging to +infinity + private double ptdfSumLowerBound = DEFAULT_PTDF_SUM_LOWER_BOUND; + private PtdfApproximation ptdfApproximation = DEFAULT_PTDF_APPROXIMATION; + + public double getPtdfSumLowerBound() { + return ptdfSumLowerBound; + } + + public PtdfApproximation getPtdfApproximation() { + return ptdfApproximation; + } + + public void setPtdfApproximation(PtdfApproximation ptdfApproximation) { + this.ptdfApproximation = ptdfApproximation; + } + + public void setPtdfSumLowerBound(double ptdfSumLowerBound) { + this.ptdfSumLowerBound = ptdfSumLowerBound; + } + + public static Optional load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + return platformConfig.getOptionalModuleConfig(ST_RELATIVE_MARGINS_SECTION) + .map(config -> { + SearchTreeRaoRelativeMarginsParameters parameters = new SearchTreeRaoRelativeMarginsParameters(); + parameters.setPtdfApproximation(config.getEnumProperty(PTDF_APPROXIMATION, PtdfApproximation.class, SearchTreeRaoRelativeMarginsParameters.DEFAULT_PTDF_APPROXIMATION)); + parameters.setPtdfSumLowerBound(config.getDoubleProperty(PTDF_SUM_LOWER_BOUND, SearchTreeRaoRelativeMarginsParameters.DEFAULT_PTDF_SUM_LOWER_BOUND)); + return parameters; + }); + } +} + diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoTopoOptimizationParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoTopoOptimizationParameters.java new file mode 100644 index 0000000000..11cbb2b6ff --- /dev/null +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SearchTreeRaoTopoOptimizationParameters.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2023, RTE (http://www.rte-france.com) + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +package com.powsybl.openrao.raoapi.parameters.extensions; + +import com.powsybl.commons.config.PlatformConfig; +import com.powsybl.openrao.raoapi.parameters.ParametersUtil; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +import static com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider.BUSINESS_WARNS; +import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; + +/** + * Topological actions optimization parameters for RAO + * + * @author Godelaine de Montmorillon {@literal } + * @author Pauline JEAN-MARIE {@literal } + */ +public class SearchTreeRaoTopoOptimizationParameters { + // Default values + private static final int DEFAULT_MAX_SEARCH_TREE_DEPTH = Integer.MAX_VALUE; + private static final List> DEFAULT_PREDEFINED_COMBINATIONS = new ArrayList<>(); + private static final boolean DEFAULT_SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT = false; + private static final int DEFAULT_MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS = 2; + // Attributes + private int maxPreventiveSearchTreeDepth = DEFAULT_MAX_SEARCH_TREE_DEPTH; + private int maxAutoSearchTreeDepth = DEFAULT_MAX_SEARCH_TREE_DEPTH; + private int maxCurativeSearchTreeDepth = DEFAULT_MAX_SEARCH_TREE_DEPTH; + private List> predefinedCombinations = DEFAULT_PREDEFINED_COMBINATIONS; + private boolean skipActionsFarFromMostLimitingElement = DEFAULT_SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT; + private int maxNumberOfBoundariesForSkippingActions = DEFAULT_MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS; + + public void setMaxPreventiveSearchTreeDepth(int maxPreventiveSearchTreeDepth) { + this.maxPreventiveSearchTreeDepth = maxPreventiveSearchTreeDepth; + } + + public void setMaxAutoSearchTreeDepth(int maxAutoSearchTreeDepth) { + this.maxAutoSearchTreeDepth = maxAutoSearchTreeDepth; + } + + public void setMaxCurativeSearchTreeDepth(int maxCurativeSearchTreeDepth) { + this.maxCurativeSearchTreeDepth = maxCurativeSearchTreeDepth; + } + + public void setPredefinedCombinations(List> predefinedCombinations) { + this.predefinedCombinations = predefinedCombinations; + } + + public void setSkipActionsFarFromMostLimitingElement(boolean skipActionsFarFromMostLimitingElement) { + this.skipActionsFarFromMostLimitingElement = skipActionsFarFromMostLimitingElement; + } + + public void setMaxNumberOfBoundariesForSkippingActions(int maxNumberOfBoundariesForSkippingActions) { + if (maxNumberOfBoundariesForSkippingActions < 0) { + BUSINESS_WARNS.warn("The value {} provided for max number of boundaries for skipping actions is smaller than 0. It will be set to 0.", maxNumberOfBoundariesForSkippingActions); + this.maxNumberOfBoundariesForSkippingActions = 0; + } else { + this.maxNumberOfBoundariesForSkippingActions = maxNumberOfBoundariesForSkippingActions; + } + } + + public int getMaxPreventiveSearchTreeDepth() { + return maxPreventiveSearchTreeDepth; + } + + public int getMaxAutoSearchTreeDepth() { + return maxAutoSearchTreeDepth; + } + + public int getMaxCurativeSearchTreeDepth() { + return maxCurativeSearchTreeDepth; + } + + public boolean getSkipActionsFarFromMostLimitingElement() { + return skipActionsFarFromMostLimitingElement; + } + + public int getMaxNumberOfBoundariesForSkippingActions() { + return maxNumberOfBoundariesForSkippingActions; + } + + public List> getPredefinedCombinations() { + return predefinedCombinations; + } + + public static SearchTreeRaoTopoOptimizationParameters load(PlatformConfig platformConfig) { + Objects.requireNonNull(platformConfig); + SearchTreeRaoTopoOptimizationParameters parameters = new SearchTreeRaoTopoOptimizationParameters(); + platformConfig.getOptionalModuleConfig(ST_TOPOLOGICAL_ACTIONS_OPTIMIZATION_SECTION) + .ifPresent(config -> { + parameters.setMaxPreventiveSearchTreeDepth(config.getIntProperty(MAX_PREVENTIVE_SEARCH_TREE_DEPTH, DEFAULT_MAX_SEARCH_TREE_DEPTH)); + parameters.setMaxAutoSearchTreeDepth(config.getIntProperty(MAX_AUTO_SEARCH_TREE_DEPTH, DEFAULT_MAX_SEARCH_TREE_DEPTH)); + parameters.setMaxCurativeSearchTreeDepth(config.getIntProperty(MAX_CURATIVE_SEARCH_TREE_DEPTH, DEFAULT_MAX_SEARCH_TREE_DEPTH)); + parameters.setPredefinedCombinations(ParametersUtil.convertListToListOfList(config.getStringListProperty(PREDEFINED_COMBINATIONS, ParametersUtil.convertListOfListToList(DEFAULT_PREDEFINED_COMBINATIONS)))); + parameters.setSkipActionsFarFromMostLimitingElement(config.getBooleanProperty(SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT, DEFAULT_SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT)); + parameters.setMaxNumberOfBoundariesForSkippingActions(config.getIntProperty(MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS, DEFAULT_MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS)); + }); + return parameters; + } + + public static int getMaxPreventiveSearchTreeDepth(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(); + } + return DEFAULT_MAX_SEARCH_TREE_DEPTH; + } + + public static int getMaxAutoSearchTreeDepth(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getTopoOptimizationParameters().getMaxAutoSearchTreeDepth(); + } + return DEFAULT_MAX_SEARCH_TREE_DEPTH; + } + + public static int getMaxCurativeSearchTreeDepth(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getTopoOptimizationParameters().getMaxCurativeSearchTreeDepth(); + } + return DEFAULT_MAX_SEARCH_TREE_DEPTH; + } + + public static boolean isSkipActionsFarFromMostLimitingElement(RaoParameters raoParameters) { + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getTopoOptimizationParameters().getSkipActionsFarFromMostLimitingElement(); + } + return DEFAULT_SKIP_ACTIONS_FAR_FROM_MOST_LIMITING_ELEMENT; + } + + public static int getMaxNumberOfBoundariesForSkippingActions(RaoParameters raoParameters) { + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getTopoOptimizationParameters().getMaxNumberOfBoundariesForSkippingActions(); + } + return DEFAULT_MAX_NUMBER_OF_BOUNDARIES_FOR_SKIPPING_ACTIONS; + } + + public static List> getPredefinedCombinations(RaoParameters raoParameters) { + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getTopoOptimizationParameters().getPredefinedCombinations(); + } + return DEFAULT_PREDEFINED_COMBINATIONS; + } +} diff --git a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/SecondPreventiveRaoParameters.java b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SecondPreventiveRaoParameters.java similarity index 68% rename from ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/SecondPreventiveRaoParameters.java rename to ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SecondPreventiveRaoParameters.java index 0b009e7cc9..8cf0b61ede 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/SecondPreventiveRaoParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/extensions/SecondPreventiveRaoParameters.java @@ -1,13 +1,15 @@ /* - * Copyright (c) 2023, RTE (http://www.rte-france.com) + * Copyright (c) 2024, RTE (http://www.rte-france.com) * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * SPDX-License-Identifier: MPL-2.0 */ -package com.powsybl.openrao.raoapi.parameters; +package com.powsybl.openrao.raoapi.parameters.extensions; import com.powsybl.commons.config.PlatformConfig; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; import java.util.Objects; import static com.powsybl.openrao.raoapi.RaoParametersCommons.*; @@ -15,6 +17,7 @@ * Second preventive parameters for RAO * * @author Godelaine de Montmorillon {@literal } + * @author Pauline JEAN-MARIE {@literal } */ public class SecondPreventiveRaoParameters { private static final ExecutionCondition DEFAULT_EXECUTION_CONDITION = ExecutionCondition.DISABLED; @@ -67,4 +70,25 @@ public static SecondPreventiveRaoParameters load(PlatformConfig platformConfig) }); return parameters; } + + public static ExecutionCondition getSecondPreventiveExecutionCondition(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getSecondPreventiveRaoParameters().getExecutionCondition(); + } + return DEFAULT_EXECUTION_CONDITION; + } + + public static boolean getSecondPreventiveReOptimizeCurativeRangeActions(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getSecondPreventiveRaoParameters().getReOptimizeCurativeRangeActions(); + } + return DEFAULT_RE_OPTIMIZE_CURATIVE_RANGE_ACTIONS; + } + + public static boolean getSecondPreventiveHintFromFirstPreventiveRao(RaoParameters parameters) { + if (parameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + return parameters.getExtension(OpenRaoSearchTreeParameters.class).getSecondPreventiveRaoParameters().getHintFromFirstPreventiveRao(); + } + return DEFAULT_HINT_FROM_FIRST_PREVENTIVE_RAO; + } } 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..6197434817 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,14 +7,12 @@ 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; -import com.powsybl.openrao.raoapi.parameters.SecondPreventiveRaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.PtdfApproximation; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.*; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.PstModel; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; @@ -51,66 +49,74 @@ void roundTripDefault() throws IOException { @Test void roundTrip() throws IOException { RaoParameters parameters = new RaoParameters(); + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); // Objective Function parameters - parameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE); - parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); - parameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(983); + parameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + parameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); + searchTreeParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(983); parameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // RangeActionsOptimization parameters - parameters.getRangeActionsOptimizationParameters().setMaxMipIterations(30); - parameters.getRangeActionsOptimizationParameters().setPstPenaltyCost(10); - parameters.getRangeActionsOptimizationParameters().setPstSensitivityThreshold(0.2); - parameters.getRangeActionsOptimizationParameters().setHvdcPenaltyCost(1); - parameters.getRangeActionsOptimizationParameters().setHvdcSensitivityThreshold(0.3); - parameters.getRangeActionsOptimizationParameters().setInjectionRaPenaltyCost(1.2); - parameters.getRangeActionsOptimizationParameters().setInjectionRaSensitivityThreshold(0.7); - parameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setSolverSpecificParameters("TREEMEMORYLIMIT 20"); - parameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setSolver(RangeActionsOptimizationParameters.Solver.SCIP); - parameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setRelativeMipGap(1e-5); - parameters.getRangeActionsOptimizationParameters().setPstModel(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); - parameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); + searchTreeParameters.getRangeActionsOptimizationParameters().setMaxMipIterations(30); + parameters.getRangeActionsOptimizationParameters().setPstRAMinImpactThreshold(10); + searchTreeParameters.getRangeActionsOptimizationParameters().setPstSensitivityThreshold(0.2); + parameters.getRangeActionsOptimizationParameters().setHvdcRAMinImpactThreshold(1); + searchTreeParameters.getRangeActionsOptimizationParameters().setHvdcSensitivityThreshold(0.3); + parameters.getRangeActionsOptimizationParameters().setInjectionRAMinImpactThreshold(1.2); + searchTreeParameters.getRangeActionsOptimizationParameters().setInjectionRaSensitivityThreshold(0.7); + searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setSolverSpecificParameters("TREEMEMORYLIMIT 20"); + searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP); + searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setRelativeMipGap(1e-5); + searchTreeParameters.getRangeActionsOptimizationParameters().setPstModel(PstModel.APPROXIMATED_INTEGERS); + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RaRangeShrinking.ENABLED); // TopologicalActions optimization parameters - parameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(10); - parameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(3); - parameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(10); + searchTreeParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(10); + searchTreeParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(3); + searchTreeParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(10); parameters.getTopoOptimizationParameters().setRelativeMinImpactThreshold(0.1); parameters.getTopoOptimizationParameters().setAbsoluteMinImpactThreshold(20); - parameters.getTopoOptimizationParameters().setPredefinedCombinations(List.of(List.of("na-id-1", "na-id-2"), List.of("na-id-1", "na-id-3", "na-id-4"))); + searchTreeParameters.getTopoOptimizationParameters().setPredefinedCombinations(List.of(List.of("na-id-1", "na-id-2"), List.of("na-id-1", "na-id-3", "na-id-4"))); // Multi-threading parameters - parameters.getMultithreadingParameters().setContingencyScenariosInParallel(15); - parameters.getMultithreadingParameters().setPreventiveLeavesInParallel(21); - parameters.getMultithreadingParameters().setAutoLeavesInParallel(30); - parameters.getMultithreadingParameters().setCurativeLeavesInParallel(22); + searchTreeParameters.getMultithreadingParameters().setAvailableCPUs(21); // Second preventive RAO parameters - parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); - parameters.getSecondPreventiveRaoParameters().setReOptimizeCurativeRangeActions(true); - parameters.getSecondPreventiveRaoParameters().setHintFromFirstPreventiveRao(true); + searchTreeParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); + searchTreeParameters.getSecondPreventiveRaoParameters().setReOptimizeCurativeRangeActions(true); + searchTreeParameters.getSecondPreventiveRaoParameters().setHintFromFirstPreventiveRao(true); // Not optimized cnecs parameters parameters.getNotOptimizedCnecsParameters().setDoNotOptimizeCurativeCnecsForTsosWithoutCras(false); // LoadFlow and sensitivity parameters - parameters.getLoadFlowAndSensitivityParameters().setLoadFlowProvider("OpenLoadFlowProvider"); - parameters.getLoadFlowAndSensitivityParameters().setSensitivityProvider("OpenSensitivityAnalysis"); + searchTreeParameters.getLoadFlowAndSensitivityParameters().setLoadFlowProvider("OpenLoadFlowProvider"); + searchTreeParameters.getLoadFlowAndSensitivityParameters().setSensitivityProvider("OpenSensitivityAnalysis"); // Extensions // -- LoopFlow parameters - parameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); - parameters.getExtension(LoopFlowParametersExtension.class).setAcceptableIncrease(20.); - parameters.getExtension(LoopFlowParametersExtension.class).setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO_AND_PST); - parameters.getExtension(LoopFlowParametersExtension.class).setConstraintAdjustmentCoefficient(0.5); + com.powsybl.openrao.raoapi.parameters.LoopFlowParameters loopFlowParameters = new com.powsybl.openrao.raoapi.parameters.LoopFlowParameters(); + SearchTreeRaoLoopFlowParameters loopFlowParametersExtension = new SearchTreeRaoLoopFlowParameters(); + loopFlowParameters.setAcceptableIncrease(20.); + loopFlowParametersExtension.setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO_AND_PST); + loopFlowParametersExtension.setConstraintAdjustmentCoefficient(0.5); List countries = new ArrayList<>(); countries.add("BE"); countries.add("FR"); - parameters.getExtension(LoopFlowParametersExtension.class).setCountries(countries); + loopFlowParameters.setCountries(countries); + parameters.setLoopFlowParameters(loopFlowParameters); + searchTreeParameters.setLoopFlowParameters(loopFlowParametersExtension); // -- Mnec parameters - parameters.addExtension(MnecParametersExtension.class, new MnecParametersExtension()); - parameters.getExtension(MnecParametersExtension.class).setViolationCost(20); - parameters.getExtension(MnecParametersExtension.class).setAcceptableMarginDecrease(30); - parameters.getExtension(MnecParametersExtension.class).setConstraintAdjustmentCoefficient(3); + com.powsybl.openrao.raoapi.parameters.MnecParameters mnecParameters = new com.powsybl.openrao.raoapi.parameters.MnecParameters(); + SearchTreeRaoMnecParameters mnecParametersExtension = new SearchTreeRaoMnecParameters(); + mnecParametersExtension.setViolationCost(20); + mnecParameters.setAcceptableMarginDecrease(30); + mnecParametersExtension.setConstraintAdjustmentCoefficient(3); + parameters.setMnecParameters(mnecParameters); + searchTreeParameters.setMnecParameters(mnecParametersExtension); // -- Relative Margins parameters - parameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); + com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters relativeMarginsParameters = new com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters(); + SearchTreeRaoRelativeMarginsParameters relativeMarginsParametersExtension = new SearchTreeRaoRelativeMarginsParameters(); List stringBoundaries = new ArrayList<>(Arrays.asList("{FR}-{ES}", "{ES}-{PT}", "{BE}-{22Y201903144---9}-{DE}-{22Y201903145---4}")); - parameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfBoundariesFromString(stringBoundaries); - parameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO); - parameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfSumLowerBound(0.05); + relativeMarginsParameters.setPtdfBoundariesFromString(stringBoundaries); + relativeMarginsParametersExtension.setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO); + relativeMarginsParametersExtension.setPtdfSumLowerBound(0.05); + parameters.setRelativeMarginsParameters(relativeMarginsParameters); + searchTreeParameters.setRelativeMarginsParameters(relativeMarginsParametersExtension); roundTripTest(parameters, JsonRaoParameters::write, JsonRaoParameters::read, "/RaoParametersSet_v2.json"); } @@ -120,29 +126,26 @@ void update() { RaoParameters parameters = JsonRaoParameters.read(getClass().getResourceAsStream("/RaoParameters_default_v2.json")); assertEquals(1, parameters.getExtensions().size()); JsonRaoParameters.update(parameters, getClass().getResourceAsStream("/RaoParameters_update_v2.json")); - assertEquals(2, parameters.getExtensions().size()); - assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()); - assertEquals(5, parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(2, parameters.getTopoOptimizationParameters().getMaxAutoSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(5, parameters.getTopoOptimizationParameters().getMaxCurativeSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(1, parameters.getExtensions().size()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, parameters.getObjectiveFunctionParameters().getType()); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); + assertEquals(5, searchTreeParameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(2, searchTreeParameters.getTopoOptimizationParameters().getMaxAutoSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(5, searchTreeParameters.getTopoOptimizationParameters().getMaxCurativeSearchTreeDepth(), DOUBLE_TOLERANCE); assertEquals(0, parameters.getTopoOptimizationParameters().getRelativeMinImpactThreshold(), DOUBLE_TOLERANCE); assertEquals(1, parameters.getTopoOptimizationParameters().getAbsoluteMinImpactThreshold(), DOUBLE_TOLERANCE); - assertEquals(8, parameters.getMultithreadingParameters().getPreventiveLeavesInParallel()); - assertEquals(4, parameters.getMultithreadingParameters().getAutoLeavesInParallel()); - assertEquals(3, parameters.getMultithreadingParameters().getCurativeLeavesInParallel()); - assertTrue(parameters.getTopoOptimizationParameters().getSkipActionsFarFromMostLimitingElement()); - assertEquals(2, parameters.getTopoOptimizationParameters().getMaxNumberOfBoundariesForSkippingActions()); + assertEquals(8, searchTreeParameters.getMultithreadingParameters().getAvailableCPUs()); + assertTrue(searchTreeParameters.getTopoOptimizationParameters().getSkipActionsFarFromMostLimitingElement()); + assertEquals(2, searchTreeParameters.getTopoOptimizationParameters().getMaxNumberOfBoundariesForSkippingActions()); assertTrue(parameters.getNotOptimizedCnecsParameters().getDoNotOptimizeCurativeCnecsForTsosWithoutCras()); - assertEquals(SecondPreventiveRaoParameters.ExecutionCondition.COST_INCREASE, parameters.getSecondPreventiveRaoParameters().getExecutionCondition()); - assertTrue(parameters.getSecondPreventiveRaoParameters().getHintFromFirstPreventiveRao()); + assertEquals(SecondPreventiveRaoParameters.ExecutionCondition.COST_INCREASE, searchTreeParameters.getSecondPreventiveRaoParameters().getExecutionCondition()); + assertTrue(searchTreeParameters.getSecondPreventiveRaoParameters().getHintFromFirstPreventiveRao()); // Extensions - MnecParametersExtension mnecParameters = parameters.getExtension(MnecParametersExtension.class); - assertEquals(888, mnecParameters.getAcceptableMarginDecrease(), DOUBLE_TOLERANCE); - assertEquals(23, mnecParameters.getViolationCost(), DOUBLE_TOLERANCE); - assertEquals(4, mnecParameters.getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); - RelativeMarginsParametersExtension relativeMarginsParameters = parameters.getExtension(RelativeMarginsParametersExtension.class); - assertEquals(0.06, relativeMarginsParameters.getPtdfSumLowerBound(), DOUBLE_TOLERANCE); - assertEquals(List.of("{FR}-{ES}"), relativeMarginsParameters.getPtdfBoundariesAsString()); + assertEquals(888, parameters.getMnecParameters().get().getAcceptableMarginDecrease(), DOUBLE_TOLERANCE); + assertEquals(23, searchTreeParameters.getMnecParameters().get().getViolationCost(), DOUBLE_TOLERANCE); + assertEquals(4, searchTreeParameters.getMnecParameters().get().getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); + assertEquals(0.06, searchTreeParameters.getRelativeMarginsParameters().get().getPtdfSumLowerBound(), DOUBLE_TOLERANCE); + assertEquals(List.of("{FR}-{ES}"), parameters.getRelativeMarginsParameters().get().getPtdfBoundariesAsString()); } @Test @@ -175,7 +178,7 @@ void testFailOnOldVersion() { } @ParameterizedTest - @ValueSource(strings = {"LoopFlowError", "PrevStopCriterionError", "WrongField"}) + @ValueSource(strings = {"LoopFlowError", "ObjFuncTypeError", "WrongField"}) void importNokTest(String source) { InputStream inputStream = getClass().getResourceAsStream("/RaoParametersWith" + source + "_v2.json"); assertThrows(OpenRaoException.class, () -> JsonRaoParameters.read(inputStream)); diff --git a/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java b/ra-optimisation/rao-api/src/test/java/com/powsybl/openrao/raoapi/parameters/RaoParametersConfigTest.java index 6383571cc9..7d5a2454cf 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; @@ -19,6 +20,7 @@ import java.nio.file.FileSystem; import java.util.*; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoObjectiveFunctionParameters.getCurativeMinObjImprovement; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.ArgumentMatchers.*; @@ -41,101 +43,94 @@ public void setUp() { @Test void checkObjectiveFunctionConfig() { MapModuleConfig objectiveFunctionModuleConfig = platformCfg.createModuleConfig("rao-objective-function"); - objectiveFunctionModuleConfig.setStringProperty("type", "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE"); - objectiveFunctionModuleConfig.setStringProperty("curative-min-obj-improvement", Objects.toString(123.0)); - objectiveFunctionModuleConfig.setStringProperty("preventive-stop-criterion", "MIN_OBJECTIVE"); + objectiveFunctionModuleConfig.setStringProperty("type", "MAX_MIN_RELATIVE_MARGIN"); + objectiveFunctionModuleConfig.setStringProperty("unit", "AMPERE"); objectiveFunctionModuleConfig.setStringProperty("enforce-curative-security", "false"); - - RaoParameters parameters = new RaoParameters(); - RaoParameters.load(parameters, platformCfg); + MapModuleConfig objectiveFunctionModuleConfigExt = platformCfg.createModuleConfig("search-tree-objective-function"); + objectiveFunctionModuleConfigExt.setStringProperty("curative-min-obj-improvement", Objects.toString(123.0)); + RaoParameters parameters = RaoParameters.load(platformCfg); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); - assertEquals(123, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); - assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, objectiveFunctionParameters.getType()); + assertEquals(Unit.AMPERE, objectiveFunctionParameters.getUnit()); + assertEquals(123, getCurativeMinObjImprovement(parameters), DOUBLE_TOLERANCE); assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); } @Test void checkRangeActionsOptimizationConfig() { MapModuleConfig rangeActionsOptimizationModuleConfig = platformCfg.createModuleConfig("rao-range-actions-optimization"); - rangeActionsOptimizationModuleConfig.setStringProperty("max-mip-iterations", Objects.toString(4)); - rangeActionsOptimizationModuleConfig.setStringProperty("pst-penalty-cost", Objects.toString(44)); - rangeActionsOptimizationModuleConfig.setStringProperty("pst-sensitivity-threshold", Objects.toString(7)); - rangeActionsOptimizationModuleConfig.setStringProperty("pst-model", "APPROXIMATED_INTEGERS"); - rangeActionsOptimizationModuleConfig.setStringProperty("hvdc-penalty-cost", Objects.toString(33)); - rangeActionsOptimizationModuleConfig.setStringProperty("hvdc-sensitivity-threshold", Objects.toString(8)); - rangeActionsOptimizationModuleConfig.setStringProperty("injection-ra-penalty-cost", Objects.toString(22)); - rangeActionsOptimizationModuleConfig.setStringProperty("injection-ra-sensitivity-threshold", Objects.toString(9)); - MapModuleConfig linearOptimizationSolverModuleConfig = platformCfg.createModuleConfig("rao-linear-optimization-solver"); + rangeActionsOptimizationModuleConfig.setStringProperty("pst-ra-min-impact-threshold", Objects.toString(44)); + rangeActionsOptimizationModuleConfig.setStringProperty("hvdc-ra-min-impact-threshold", Objects.toString(33)); + rangeActionsOptimizationModuleConfig.setStringProperty("injection-ra-min-impact-threshold", Objects.toString(22)); + MapModuleConfig rangeActionsOptimizationModuleConfigExt = platformCfg.createModuleConfig("search-tree-range-actions-optimization"); + rangeActionsOptimizationModuleConfigExt.setStringProperty("max-mip-iterations", Objects.toString(4)); + rangeActionsOptimizationModuleConfigExt.setStringProperty("pst-sensitivity-threshold", Objects.toString(7)); + rangeActionsOptimizationModuleConfigExt.setStringProperty("pst-model", "APPROXIMATED_INTEGERS"); + rangeActionsOptimizationModuleConfigExt.setStringProperty("hvdc-sensitivity-threshold", Objects.toString(8)); + rangeActionsOptimizationModuleConfigExt.setStringProperty("injection-ra-sensitivity-threshold", Objects.toString(9)); + MapModuleConfig linearOptimizationSolverModuleConfig = platformCfg.createModuleConfig("search-tree-linear-optimization-solver"); linearOptimizationSolverModuleConfig.setStringProperty("solver", "XPRESS"); linearOptimizationSolverModuleConfig.setStringProperty("relative-mip-gap", Objects.toString(22)); linearOptimizationSolverModuleConfig.setStringProperty("solver-specific-parameters", "blabla"); - RaoParameters parameters = new RaoParameters(); - RaoParameters.load(parameters, platformCfg); + RaoParameters parameters = RaoParameters.load(platformCfg); RangeActionsOptimizationParameters params = parameters.getRangeActionsOptimizationParameters(); - assertEquals(4, params.getMaxMipIterations(), DOUBLE_TOLERANCE); - assertEquals(44, params.getPstPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(7, params.getPstSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS, params.getPstModel()); - assertEquals(RangeActionsOptimizationParameters.RaRangeShrinking.DISABLED, params.getRaRangeShrinking()); - assertEquals(33, params.getHvdcPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(8, params.getHvdcSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(22, params.getInjectionRaPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(9, params.getInjectionRaSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(RangeActionsOptimizationParameters.Solver.XPRESS, params.getLinearOptimizationSolver().getSolver()); - assertEquals(22, params.getLinearOptimizationSolver().getRelativeMipGap(), DOUBLE_TOLERANCE); - assertEquals("blabla", params.getLinearOptimizationSolver().getSolverSpecificParameters()); + SearchTreeRaoRangeActionsOptimizationParameters paramsExt = parameters.getExtension(OpenRaoSearchTreeParameters.class).getRangeActionsOptimizationParameters(); + assertEquals(4, paramsExt.getMaxMipIterations(), DOUBLE_TOLERANCE); + assertEquals(44, params.getPstRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(7, paramsExt.getPstSensitivityThreshold(), DOUBLE_TOLERANCE); + assertEquals(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS, paramsExt.getPstModel()); + assertEquals(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.DISABLED, paramsExt.getRaRangeShrinking()); + assertEquals(33, params.getHvdcRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(8, paramsExt.getHvdcSensitivityThreshold(), DOUBLE_TOLERANCE); + assertEquals(22, params.getInjectionRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(9, paramsExt.getInjectionRaSensitivityThreshold(), DOUBLE_TOLERANCE); + assertEquals(SearchTreeRaoRangeActionsOptimizationParameters.Solver.XPRESS, paramsExt.getLinearOptimizationSolver().getSolver()); + assertEquals(22, paramsExt.getLinearOptimizationSolver().getRelativeMipGap(), DOUBLE_TOLERANCE); + assertEquals("blabla", paramsExt.getLinearOptimizationSolver().getSolverSpecificParameters()); } @Test void checkTopoActionsOptimizationConfig() { MapModuleConfig topoActionsModuleConfig = platformCfg.createModuleConfig("rao-topological-actions-optimization"); - topoActionsModuleConfig.setStringProperty("max-preventive-search-tree-depth", Objects.toString(3)); - topoActionsModuleConfig.setStringProperty("max-auto-search-tree-depth", Objects.toString(2)); - topoActionsModuleConfig.setStringProperty("max-curative-search-tree-depth", Objects.toString(3)); - topoActionsModuleConfig.setStringListProperty("predefined-combinations", List.of("{na12} + {na22}", "{na41} + {na5} + {na6}")); topoActionsModuleConfig.setStringProperty("relative-minimum-impact-threshold", Objects.toString(0.9)); topoActionsModuleConfig.setStringProperty("absolute-minimum-impact-threshold", Objects.toString(22)); - topoActionsModuleConfig.setStringProperty("skip-actions-far-from-most-limiting-element", Objects.toString(true)); - topoActionsModuleConfig.setStringProperty("max-number-of-boundaries-for-skipping-actions", Objects.toString(3333)); - RaoParameters parameters = new RaoParameters(); - RaoParameters.load(parameters, platformCfg); + MapModuleConfig topoActionsModuleConfigExt = platformCfg.createModuleConfig("search-tree-topological-actions-optimization"); + topoActionsModuleConfigExt.setStringProperty("max-preventive-search-tree-depth", Objects.toString(3)); + topoActionsModuleConfigExt.setStringProperty("max-auto-search-tree-depth", Objects.toString(2)); + topoActionsModuleConfigExt.setStringProperty("max-curative-search-tree-depth", Objects.toString(3)); + topoActionsModuleConfigExt.setStringListProperty("predefined-combinations", List.of("{na12} + {na22}", "{na41} + {na5} + {na6}")); + topoActionsModuleConfigExt.setStringProperty("skip-actions-far-from-most-limiting-element", Objects.toString(true)); + topoActionsModuleConfigExt.setStringProperty("max-number-of-boundaries-for-skipping-actions", Objects.toString(3333)); + RaoParameters parameters = RaoParameters.load(platformCfg); TopoOptimizationParameters params = parameters.getTopoOptimizationParameters(); - assertEquals(3, params.getMaxPreventiveSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(2, params.getMaxAutoSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(3, params.getMaxCurativeSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(List.of(List.of("na12", "na22"), List.of("na41", "na5", "na6")), params.getPredefinedCombinations()); + SearchTreeRaoTopoOptimizationParameters paramsExt = parameters.getExtension(OpenRaoSearchTreeParameters.class).getTopoOptimizationParameters(); + assertEquals(3, paramsExt.getMaxPreventiveSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(2, paramsExt.getMaxAutoSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(3, paramsExt.getMaxCurativeSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(List.of(List.of("na12", "na22"), List.of("na41", "na5", "na6")), paramsExt.getPredefinedCombinations()); assertEquals(0.9, params.getRelativeMinImpactThreshold(), DOUBLE_TOLERANCE); assertEquals(22, params.getAbsoluteMinImpactThreshold(), DOUBLE_TOLERANCE); - assertTrue(params.getSkipActionsFarFromMostLimitingElement()); - assertEquals(3333, params.getMaxNumberOfBoundariesForSkippingActions(), DOUBLE_TOLERANCE); + assertTrue(paramsExt.getSkipActionsFarFromMostLimitingElement()); + assertEquals(3333, paramsExt.getMaxNumberOfBoundariesForSkippingActions(), DOUBLE_TOLERANCE); } @Test void checkMultiThreadingConfig() { - MapModuleConfig multiThreadingModuleConfig = platformCfg.createModuleConfig("rao-multi-threading"); - multiThreadingModuleConfig.setStringProperty("contingency-scenarios-in-parallel", Objects.toString(3)); - multiThreadingModuleConfig.setStringProperty("preventive-leaves-in-parallel", Objects.toString(23)); - multiThreadingModuleConfig.setStringProperty("auto-leaves-in-parallel", Objects.toString(17)); - multiThreadingModuleConfig.setStringProperty("curative-leaves-in-parallel", Objects.toString(43)); - RaoParameters parameters = new RaoParameters(); - RaoParameters.load(parameters, platformCfg); - MultithreadingParameters params = parameters.getMultithreadingParameters(); - assertEquals(3, params.getContingencyScenariosInParallel(), DOUBLE_TOLERANCE); - assertEquals(23, params.getPreventiveLeavesInParallel(), DOUBLE_TOLERANCE); - assertEquals(17, params.getAutoLeavesInParallel(), DOUBLE_TOLERANCE); - assertEquals(43, params.getCurativeLeavesInParallel(), DOUBLE_TOLERANCE); + MapModuleConfig multiThreadingModuleConfig = platformCfg.createModuleConfig("search-tree-multi-threading"); + multiThreadingModuleConfig.setStringProperty("available-cpus", Objects.toString(43)); + RaoParameters parameters = RaoParameters.load(platformCfg); + MultithreadingParameters params = parameters.getExtension(OpenRaoSearchTreeParameters.class).getMultithreadingParameters(); + assertEquals(43, params.getAvailableCPUs(), DOUBLE_TOLERANCE); } @Test void checkSecondPreventiveRaoConfig() { - MapModuleConfig secondPreventiveRaoModuleConfig = platformCfg.createModuleConfig("rao-second-preventive-rao"); + MapModuleConfig secondPreventiveRaoModuleConfig = platformCfg.createModuleConfig("search-tree-second-preventive-rao"); secondPreventiveRaoModuleConfig.setStringProperty("execution-condition", "POSSIBLE_CURATIVE_IMPROVEMENT"); secondPreventiveRaoModuleConfig.setStringProperty("re-optimize-curative-range-actions", Objects.toString(false)); secondPreventiveRaoModuleConfig.setStringProperty("hint-from-first-preventive-rao", Objects.toString(true)); - RaoParameters parameters = new RaoParameters(); - RaoParameters.load(parameters, platformCfg); - SecondPreventiveRaoParameters params = parameters.getSecondPreventiveRaoParameters(); + RaoParameters parameters = RaoParameters.load(platformCfg); + SecondPreventiveRaoParameters params = parameters.getExtension(OpenRaoSearchTreeParameters.class).getSecondPreventiveRaoParameters(); assertEquals(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT, params.getExecutionCondition()); assertFalse(params.getReOptimizeCurativeRangeActions()); assertTrue(params.getHintFromFirstPreventiveRao()); @@ -145,55 +140,68 @@ void checkSecondPreventiveRaoConfig() { void checkNotOptimizedCnecsConfig() { MapModuleConfig notOptimizedModuleConfig = platformCfg.createModuleConfig("rao-not-optimized-cnecs"); notOptimizedModuleConfig.setStringProperty("do-not-optimize-curative-cnecs-for-tsos-without-cras", Objects.toString(false)); - RaoParameters parameters = new RaoParameters(); - RaoParameters.load(parameters, platformCfg); + RaoParameters parameters = RaoParameters.load(platformCfg); NotOptimizedCnecsParameters params = parameters.getNotOptimizedCnecsParameters(); assertFalse(params.getDoNotOptimizeCurativeCnecsForTsosWithoutCras()); } @Test void checkLoadFlowParametersConfig() { - MapModuleConfig loadFlowModuleConfig = platformCfg.createModuleConfig("rao-load-flow-and-sensitivity-computation"); + MapModuleConfig loadFlowModuleConfig = platformCfg.createModuleConfig("search-tree-load-flow-and-sensitivity-computation"); loadFlowModuleConfig.setStringProperty("load-flow-provider", "Bonjour"); loadFlowModuleConfig.setStringProperty("sensitivity-provider", "Au revoir"); loadFlowModuleConfig.setStringProperty("sensitivity-failure-overcost", Objects.toString(32)); - RaoParameters parameters = new RaoParameters(); - RaoParameters.load(parameters, platformCfg); - LoadFlowAndSensitivityParameters params = parameters.getLoadFlowAndSensitivityParameters(); - assertEquals("Bonjour", params.getLoadFlowProvider()); - assertEquals("Au revoir", params.getSensitivityProvider()); - assertEquals(32, params.getSensitivityFailureOvercost(), DOUBLE_TOLERANCE); + RaoParameters parameters = RaoParameters.load(platformCfg); + LoadFlowAndSensitivityParameters paramsExt = parameters.getExtension(OpenRaoSearchTreeParameters.class).getLoadFlowAndSensitivityParameters(); + assertEquals("Bonjour", paramsExt.getLoadFlowProvider()); + assertEquals("Au revoir", paramsExt.getSensitivityProvider()); + assertEquals(32, paramsExt.getSensitivityFailureOvercost(), DOUBLE_TOLERANCE); } @Test void checkLoopFlowParametersConfig() { ModuleConfig loopFlowModuleConfig = Mockito.mock(ModuleConfig.class); Mockito.when(loopFlowModuleConfig.getDoubleProperty(eq("acceptable-increase"), anyDouble())).thenReturn(32.); - Mockito.when(loopFlowModuleConfig.getEnumProperty(eq("ptdf-approximation"), eq(PtdfApproximation.class), any())).thenReturn(PtdfApproximation.UPDATE_PTDF_WITH_TOPO); - Mockito.when(loopFlowModuleConfig.getDoubleProperty(eq("violation-cost"), anyDouble())).thenReturn(43.); - Mockito.when(loopFlowModuleConfig.getDoubleProperty(eq("constraint-adjustment-coefficient"), anyDouble())).thenReturn(45.); Mockito.when(loopFlowModuleConfig.getStringListProperty(eq("countries"), anyList())).thenReturn(List.of("FR", "ES", "PT")); Mockito.when(mockedPlatformConfig.getOptionalModuleConfig("rao-loop-flow-parameters")).thenReturn(Optional.of(loopFlowModuleConfig)); - LoopFlowParametersConfigLoader configLoader = new LoopFlowParametersConfigLoader(); - LoopFlowParametersExtension parameters = configLoader.load(mockedPlatformConfig); + LoopFlowParameters parameters = RaoParameters.load(mockedPlatformConfig).getLoopFlowParameters().get(); assertEquals(32, parameters.getAcceptableIncrease(), DOUBLE_TOLERANCE); + Set expectedCountries = Set.of(Country.FR, Country.ES, Country.PT); + assertEquals(expectedCountries, parameters.getCountries()); + } + + @Test + void checkLoopFlowParametersConfigExtension() { + ModuleConfig loopFlowModuleConfig = Mockito.mock(ModuleConfig.class); + Mockito.when(loopFlowModuleConfig.getEnumProperty(eq("ptdf-approximation"), eq(PtdfApproximation.class), any())).thenReturn(PtdfApproximation.UPDATE_PTDF_WITH_TOPO); + Mockito.when(loopFlowModuleConfig.getDoubleProperty(eq("violation-cost"), anyDouble())).thenReturn(43.); + Mockito.when(loopFlowModuleConfig.getDoubleProperty(eq("constraint-adjustment-coefficient"), anyDouble())).thenReturn(45.); + Mockito.when(mockedPlatformConfig.getOptionalModuleConfig("search-tree-loop-flow-parameters")).thenReturn(Optional.of(loopFlowModuleConfig)); + OpenRaoSearchTreeParametersConfigLoader configLoader = new OpenRaoSearchTreeParametersConfigLoader(); + SearchTreeRaoLoopFlowParameters parameters = configLoader.load(mockedPlatformConfig).getLoopFlowParameters().get(); assertEquals(PtdfApproximation.UPDATE_PTDF_WITH_TOPO, parameters.getPtdfApproximation()); assertEquals(45, parameters.getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); assertEquals(43, parameters.getViolationCost(), DOUBLE_TOLERANCE); Set expectedCountries = Set.of(Country.FR, Country.ES, Country.PT); - assertEquals(expectedCountries, parameters.getCountries()); } @Test void checkMnecParametersConfig() { ModuleConfig mnecModuleConfig = Mockito.mock(ModuleConfig.class); Mockito.when(mnecModuleConfig.getDoubleProperty(eq("acceptable-margin-decrease"), anyDouble())).thenReturn(32.); - Mockito.when(mnecModuleConfig.getDoubleProperty(eq("violation-cost"), anyDouble())).thenReturn(43.); - Mockito.when(mnecModuleConfig.getDoubleProperty(eq("constraint-adjustment-coefficient"), anyDouble())).thenReturn(45.); Mockito.when(mockedPlatformConfig.getOptionalModuleConfig("rao-mnec-parameters")).thenReturn(Optional.of(mnecModuleConfig)); - MnecParametersConfigLoader configLoader = new MnecParametersConfigLoader(); - MnecParametersExtension parameters = configLoader.load(mockedPlatformConfig); + MnecParameters parameters = RaoParameters.load(mockedPlatformConfig).getMnecParameters().get(); assertEquals(32, parameters.getAcceptableMarginDecrease(), DOUBLE_TOLERANCE); + } + + @Test + void checkMnecParametersConfigExtension() { + ModuleConfig mnecModuleConfig = Mockito.mock(ModuleConfig.class); + Mockito.when(mnecModuleConfig.getDoubleProperty(eq("violation-cost"), anyDouble())).thenReturn(43.); + Mockito.when(mnecModuleConfig.getDoubleProperty(eq("constraint-adjustment-coefficient"), anyDouble())).thenReturn(45.); + Mockito.when(mockedPlatformConfig.getOptionalModuleConfig("search-tree-mnec-parameters")).thenReturn(Optional.of(mnecModuleConfig)); + OpenRaoSearchTreeParametersConfigLoader configLoader = new OpenRaoSearchTreeParametersConfigLoader(); + SearchTreeRaoMnecParameters parameters = configLoader.load(mockedPlatformConfig).getMnecParameters().get(); assertEquals(43, parameters.getViolationCost(), DOUBLE_TOLERANCE); assertEquals(45, parameters.getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); } @@ -201,47 +209,58 @@ void checkMnecParametersConfig() { @Test void checkRelativeMarginsConfig() { ModuleConfig relativeMarginsModuleConfig = Mockito.mock(ModuleConfig.class); - Mockito.when(relativeMarginsModuleConfig.getDoubleProperty(eq("ptdf-sum-lower-bound"), anyDouble())).thenReturn(32.); Mockito.when(relativeMarginsModuleConfig.getStringListProperty(eq("ptdf-boundaries"), anyList())).thenReturn(List.of("{FR}-{BE}", "{FR}-{DE}", "{BE}-{22Y201903144---9}-{DE}+{22Y201903145---4}")); Mockito.when(mockedPlatformConfig.getOptionalModuleConfig("rao-relative-margins-parameters")).thenReturn(Optional.of(relativeMarginsModuleConfig)); - RelativeMarginsParametersConfigLoader configLoader = new RelativeMarginsParametersConfigLoader(); - RelativeMarginsParametersExtension parameters = configLoader.load(mockedPlatformConfig); + RelativeMarginsParameters parameters = RaoParameters.load(mockedPlatformConfig).getRelativeMarginsParameters().get(); List expectedBoundaries = List.of("{FR}-{BE}", "{FR}-{DE}", "{BE}-{22Y201903144---9}-{DE}+{22Y201903145---4}"); - assertEquals(32, parameters.getPtdfSumLowerBound(), DOUBLE_TOLERANCE); assertEquals(expectedBoundaries, parameters.getPtdfBoundariesAsString()); } + @Test + void checkRelativeMarginsConfigExtension() { + ModuleConfig relativeMarginsModuleConfig = Mockito.mock(ModuleConfig.class); + Mockito.when(relativeMarginsModuleConfig.getDoubleProperty(eq("ptdf-sum-lower-bound"), anyDouble())).thenReturn(32.); + Mockito.when(mockedPlatformConfig.getOptionalModuleConfig("search-tree-relative-margins-parameters")).thenReturn(Optional.of(relativeMarginsModuleConfig)); + OpenRaoSearchTreeParametersConfigLoader configLoader = new OpenRaoSearchTreeParametersConfigLoader(); + SearchTreeRaoRelativeMarginsParameters parameters = configLoader.load(mockedPlatformConfig).getRelativeMarginsParameters().get(); + assertEquals(32, parameters.getPtdfSumLowerBound(), DOUBLE_TOLERANCE); + } + @Test void checkMultipleConfigs() { MapModuleConfig objectiveFunctionModuleConfig = platformCfg.createModuleConfig("rao-objective-function"); - objectiveFunctionModuleConfig.setStringProperty("type", "MAX_MIN_RELATIVE_MARGIN_IN_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(123, parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), 1e-6); - assertEquals(32, parameters.getRangeActionsOptimizationParameters().getMaxMipIterations(), 1e-6); - assertTrue(Objects.isNull(parameters.getExtension(LoopFlowParametersExtension.class))); - assertTrue(Objects.isNull(parameters.getExtension(MnecParametersExtension.class))); - assertTrue(Objects.isNull(parameters.getExtension(RelativeMarginsParametersExtension.class))); + objectiveFunctionModuleConfig.setStringProperty("type", "MAX_MIN_RELATIVE_MARGIN"); + objectiveFunctionModuleConfig.setStringProperty("unit", "AMPERE"); + MapModuleConfig objectiveFunctionExtModuleConfig = platformCfg.createModuleConfig("search-tree-objective-function"); + objectiveFunctionExtModuleConfig.setStringProperty("curative-min-obj-improvement", Objects.toString(123.0)); + MapModuleConfig rangeActionsOptimizationExtModuleConfig = platformCfg.createModuleConfig("search-tree-range-actions-optimization"); + rangeActionsOptimizationExtModuleConfig.setStringProperty("max-mip-iterations", Objects.toString(32)); + RaoParameters parameters = RaoParameters.load(platformCfg); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN, parameters.getObjectiveFunctionParameters().getType()); + assertEquals(Unit.AMPERE, parameters.getObjectiveFunctionParameters().getUnit()); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); + assertEquals(123, searchTreeParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), 1e-6); + assertEquals(32, searchTreeParameters.getRangeActionsOptimizationParameters().getMaxMipIterations(), 1e-6); + assertTrue(parameters.getLoopFlowParameters().isEmpty()); + assertTrue(parameters.getMnecParameters().isEmpty()); + assertTrue(parameters.getRelativeMarginsParameters().isEmpty()); + assertTrue(searchTreeParameters.getLoopFlowParameters().isEmpty()); + assertTrue(searchTreeParameters.getMnecParameters().isEmpty()); + assertTrue(searchTreeParameters.getRelativeMarginsParameters().isEmpty()); } @Test void inconsistentPredefinedCombinations1() { - MapModuleConfig topoActionsModuleConfig = platformCfg.createModuleConfig("rao-topological-actions-optimization"); + MapModuleConfig topoActionsModuleConfig = platformCfg.createModuleConfig("search-tree-topological-actions-optimization"); topoActionsModuleConfig.setStringListProperty("predefined-combinations", List.of("{na12 + {na22}", "{na41} + {na5} + {na6}")); - RaoParameters parameters = new RaoParameters(); - assertThrows(OpenRaoException.class, () -> RaoParameters.load(parameters, platformCfg)); + assertThrows(OpenRaoException.class, () -> RaoParameters.load(platformCfg)); } @Test void inconsistentPredefinedCombinations2() { - MapModuleConfig topoActionsModuleConfig = platformCfg.createModuleConfig("rao-topological-actions-optimization"); + MapModuleConfig topoActionsModuleConfig = platformCfg.createModuleConfig("search-tree-topological-actions-optimization"); topoActionsModuleConfig.setStringListProperty("predefined-combinations", List.of("{na12} - {na22}", "{na41} + {na5} + {na6}")); - RaoParameters parameters = new RaoParameters(); - assertThrows(OpenRaoException.class, () -> RaoParameters.load(parameters, platformCfg)); + assertThrows(OpenRaoException.class, () -> RaoParameters.load(platformCfg)); } @Test @@ -249,8 +268,7 @@ void inconsistentLoopFlowCountries() { ModuleConfig loopFlowModuleConfig = Mockito.mock(ModuleConfig.class); Mockito.when(loopFlowModuleConfig.getStringListProperty(eq("countries"), anyList())).thenReturn(List.of("France", "ES", "PT")); Mockito.when(mockedPlatformConfig.getOptionalModuleConfig("rao-loop-flow-parameters")).thenReturn(Optional.of(loopFlowModuleConfig)); - LoopFlowParametersConfigLoader configLoader = new LoopFlowParametersConfigLoader(); - assertThrows(OpenRaoException.class, () -> configLoader.load(mockedPlatformConfig)); + assertThrows(OpenRaoException.class, () -> RaoParameters.load(mockedPlatformConfig)); } @Test @@ -258,8 +276,7 @@ void inconsistentRelativeMarginsBoundaries1() { ModuleConfig relativeMarginsModuleConfig = Mockito.mock(ModuleConfig.class); Mockito.when(relativeMarginsModuleConfig.getStringListProperty(eq("ptdf-boundaries"), anyList())).thenReturn(List.of("{FR}{BE}")); Mockito.when(mockedPlatformConfig.getOptionalModuleConfig("rao-relative-margins-parameters")).thenReturn(Optional.of(relativeMarginsModuleConfig)); - RelativeMarginsParametersConfigLoader configLoader = new RelativeMarginsParametersConfigLoader(); - assertThrows(OpenRaoException.class, () -> configLoader.load(mockedPlatformConfig)); + assertThrows(OpenRaoException.class, () -> RaoParameters.load(mockedPlatformConfig)); } @Test @@ -267,7 +284,6 @@ void inconsistentRelativeMarginsBoundaries2() { ModuleConfig relativeMarginsModuleConfig = Mockito.mock(ModuleConfig.class); Mockito.when(relativeMarginsModuleConfig.getStringListProperty(eq("ptdf-boundaries"), anyList())).thenReturn(List.of("{FR-{BE}")); Mockito.when(mockedPlatformConfig.getOptionalModuleConfig("rao-relative-margins-parameters")).thenReturn(Optional.of(relativeMarginsModuleConfig)); - RelativeMarginsParametersConfigLoader configLoader = new RelativeMarginsParametersConfigLoader(); - assertThrows(OpenRaoException.class, () -> configLoader.load(mockedPlatformConfig)); + assertThrows(OpenRaoException.class, () -> RaoParameters.load(mockedPlatformConfig)); } } 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..7f665ae56a 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 @@ -8,9 +8,11 @@ import com.powsybl.openrao.commons.EICode; import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; import com.powsybl.iidm.network.Country; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; + import java.util.*; import static org.junit.jupiter.api.Assertions.*; @@ -20,50 +22,58 @@ */ class RaoParametersConsistencyTest { private final RaoParameters parameters = new RaoParameters(); + private OpenRaoSearchTreeParameters stParameters; + + @BeforeEach + public void generalSetUp() { + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + stParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); + } @Test void testSetBoundariesFromCountryCodes() { List stringBoundaries = new ArrayList<>(Arrays.asList("{FR}-{ES}", "{ES}-{PT}")); - parameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); - parameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfBoundariesFromString(stringBoundaries); - assertEquals(2, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().size()); - assertEquals(1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(0).getWeight(new EICode(Country.FR)), 1e-6); - assertEquals(-1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(0).getWeight(new EICode(Country.ES)), 1e-6); - assertEquals(1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(1).getWeight(new EICode(Country.ES)), 1e-6); - assertEquals(-1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(1).getWeight(new EICode(Country.PT)), 1e-6); + com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters relativeMarginsParameters = new com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters(); + relativeMarginsParameters.setPtdfBoundariesFromString(stringBoundaries); + parameters.setRelativeMarginsParameters(relativeMarginsParameters); + assertEquals(2, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().size()); + assertEquals(1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(0).getWeight(new EICode(Country.FR)), 1e-6); + assertEquals(-1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(0).getWeight(new EICode(Country.ES)), 1e-6); + assertEquals(1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(1).getWeight(new EICode(Country.ES)), 1e-6); + assertEquals(-1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(1).getWeight(new EICode(Country.PT)), 1e-6); } @Test void testSetBoundariesFromEiCodes() { - parameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); List stringBoundaries = new ArrayList<>(Arrays.asList("{10YBE----------2}-{10YFR-RTE------C}", "{10YBE----------2}-{22Y201903144---9}")); - parameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfBoundariesFromString(stringBoundaries); - assertEquals(2, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().size()); - assertEquals(2, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().size()); - assertEquals(1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(0).getWeight(new EICode("10YBE----------2")), 1e-6); - assertEquals(-1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(0).getWeight(new EICode("10YFR-RTE------C")), 1e-6); - assertEquals(1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(1).getWeight(new EICode("10YBE----------2")), 1e-6); - assertEquals(-1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(1).getWeight(new EICode("22Y201903144---9")), 1e-6); + com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters relativeMarginsParameters = new com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters(); + relativeMarginsParameters.setPtdfBoundariesFromString(stringBoundaries); + parameters.setRelativeMarginsParameters(relativeMarginsParameters); + assertEquals(2, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().size()); + assertEquals(2, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().size()); + assertEquals(1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(0).getWeight(new EICode("10YBE----------2")), 1e-6); + assertEquals(-1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(0).getWeight(new EICode("10YFR-RTE------C")), 1e-6); + assertEquals(1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(1).getWeight(new EICode("10YBE----------2")), 1e-6); + assertEquals(-1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(1).getWeight(new EICode("22Y201903144---9")), 1e-6); } @Test void testSetBoundariesFromMixOfCodes() { - parameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); List stringBoundaries = new ArrayList<>(Collections.singletonList("{BE}-{22Y201903144---9}+{22Y201903145---4}-{DE}")); - parameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfBoundariesFromString(stringBoundaries); - assertEquals(1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().size()); - assertEquals(1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(0).getWeight(new EICode(Country.BE)), 1e-6); - assertEquals(-1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(0).getWeight(new EICode(Country.DE)), 1e-6); - assertEquals(1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(0).getWeight(new EICode("22Y201903145---4")), 1e-6); - assertEquals(-1, parameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().get(0).getWeight(new EICode("22Y201903144---9")), 1e-6); + com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters relativeMarginsParameters = new com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters(); + relativeMarginsParameters.setPtdfBoundariesFromString(stringBoundaries); + parameters.setRelativeMarginsParameters(relativeMarginsParameters); + assertEquals(1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().size()); + assertEquals(1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(0).getWeight(new EICode(Country.BE)), 1e-6); + assertEquals(-1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(0).getWeight(new EICode(Country.DE)), 1e-6); + assertEquals(1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(0).getWeight(new EICode("22Y201903145---4")), 1e-6); + assertEquals(-1, parameters.getRelativeMarginsParameters().get().getPtdfBoundaries().get(0).getWeight(new EICode("22Y201903144---9")), 1e-6); } @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 @@ -76,42 +86,37 @@ void testRelativeNetworkActionMinimumImpactThresholdBounds() { @Test void testMaxNumberOfBoundariesForSkippingNetworkActionsBounds() { - TopoOptimizationParameters topoOptimizationParameters = parameters.getTopoOptimizationParameters(); - topoOptimizationParameters.setMaxNumberOfBoundariesForSkippingActions(300); - assertEquals(300, topoOptimizationParameters.getMaxNumberOfBoundariesForSkippingActions()); - topoOptimizationParameters.setMaxNumberOfBoundariesForSkippingActions(-2); - assertEquals(0, topoOptimizationParameters.getMaxNumberOfBoundariesForSkippingActions()); + stParameters.getTopoOptimizationParameters().setMaxNumberOfBoundariesForSkippingActions(300); + assertEquals(300, stParameters.getTopoOptimizationParameters().getMaxNumberOfBoundariesForSkippingActions()); + stParameters.getTopoOptimizationParameters().setMaxNumberOfBoundariesForSkippingActions(-2); + assertEquals(0, stParameters.getTopoOptimizationParameters().getMaxNumberOfBoundariesForSkippingActions()); } @Test void testNegativeCurativeRaoMinObjImprovement() { - ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - objectiveFunctionParameters.setCurativeMinObjImprovement(100); - assertEquals(100, objectiveFunctionParameters.getCurativeMinObjImprovement(), 1e-6); - objectiveFunctionParameters.setCurativeMinObjImprovement(-100); - assertEquals(100, objectiveFunctionParameters.getCurativeMinObjImprovement(), 1e-6); + stParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(100); + assertEquals(100, stParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), 1e-6); + stParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(-100); + assertEquals(100, stParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), 1e-6); } @Test void testNegativeSensitivityFailureOverCost() { - LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters = parameters.getLoadFlowAndSensitivityParameters(); - loadFlowAndSensitivityParameters.setSensitivityFailureOvercost(60000); - assertEquals(60000, loadFlowAndSensitivityParameters.getSensitivityFailureOvercost(), 1e-6); - loadFlowAndSensitivityParameters.setSensitivityFailureOvercost(-20000); - assertEquals(20000, loadFlowAndSensitivityParameters.getSensitivityFailureOvercost(), 1e-6); + stParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(60000); + assertEquals(60000, stParameters.getLoadFlowAndSensitivityParameters().getSensitivityFailureOvercost(), 1e-6); + stParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(-20000); + assertEquals(20000, stParameters.getLoadFlowAndSensitivityParameters().getSensitivityFailureOvercost(), 1e-6); } @Test void testFailsOnLowSensitivityThreshold() { - RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); - - Exception e = assertThrows(OpenRaoException.class, () -> rangeActionsOptimizationParameters.setPstSensitivityThreshold(0.)); + Exception e = assertThrows(OpenRaoException.class, () -> stParameters.getRangeActionsOptimizationParameters().setPstSensitivityThreshold(0.)); assertEquals("pstSensitivityThreshold should be greater than 1e-6, to avoid numerical issues.", e.getMessage()); - e = assertThrows(OpenRaoException.class, () -> rangeActionsOptimizationParameters.setHvdcSensitivityThreshold(1e-7)); + e = assertThrows(OpenRaoException.class, () -> stParameters.getRangeActionsOptimizationParameters().setHvdcSensitivityThreshold(1e-7)); assertEquals("hvdcSensitivityThreshold should be greater than 1e-6, to avoid numerical issues.", e.getMessage()); - e = assertThrows(OpenRaoException.class, () -> rangeActionsOptimizationParameters.setInjectionRaSensitivityThreshold(0.)); + e = assertThrows(OpenRaoException.class, () -> stParameters.getRangeActionsOptimizationParameters().setInjectionRaSensitivityThreshold(0.)); assertEquals("injectionRaSensitivityThreshold should be greater than 1e-6, to avoid numerical issues.", e.getMessage()); } } 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..bbf513f890 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,11 +6,12 @@ */ 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; -import com.powsybl.openrao.raoapi.parameters.extensions.PtdfApproximation; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.*; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.PstModel; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.Solver; import com.powsybl.commons.config.*; import com.powsybl.commons.test.AbstractSerDeTest; import com.powsybl.iidm.network.Country; @@ -41,44 +42,42 @@ public RaoParameters loadRaoParameters(String configFile) { @Test void testConfigWithExtensions() throws IOException { RaoParameters parameters = loadRaoParameters("config_withExtensions"); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); - assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); - assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, objectiveFunctionParameters.getType()); + assertEquals(Unit.AMPERE, objectiveFunctionParameters.getUnit()); + assertEquals(3, searchTreeParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); - assertEquals(2, rangeActionsOptimizationParameters.getMaxMipIterations(), DOUBLE_TOLERANCE); - assertEquals(0.02, rangeActionsOptimizationParameters.getPstPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(0.2, rangeActionsOptimizationParameters.getPstSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS, rangeActionsOptimizationParameters.getPstModel()); - assertEquals(RangeActionsOptimizationParameters.RaRangeShrinking.DISABLED, rangeActionsOptimizationParameters.getRaRangeShrinking()); - assertEquals(0.002, rangeActionsOptimizationParameters.getHvdcPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(0.2, rangeActionsOptimizationParameters.getHvdcSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(0.003, rangeActionsOptimizationParameters.getInjectionRaPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(0.3, rangeActionsOptimizationParameters.getInjectionRaSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(RangeActionsOptimizationParameters.Solver.XPRESS, rangeActionsOptimizationParameters.getLinearOptimizationSolver().getSolver()); - assertEquals(0.004, rangeActionsOptimizationParameters.getLinearOptimizationSolver().getRelativeMipGap(), DOUBLE_TOLERANCE); - assertEquals("BLABLABLA", rangeActionsOptimizationParameters.getLinearOptimizationSolver().getSolverSpecificParameters()); + assertEquals(2, searchTreeParameters.getRangeActionsOptimizationParameters().getMaxMipIterations(), DOUBLE_TOLERANCE); + assertEquals(0.02, rangeActionsOptimizationParameters.getPstRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.2, searchTreeParameters.getRangeActionsOptimizationParameters().getPstSensitivityThreshold(), DOUBLE_TOLERANCE); + assertEquals(PstModel.APPROXIMATED_INTEGERS, searchTreeParameters.getRangeActionsOptimizationParameters().getPstModel()); + assertEquals(RaRangeShrinking.DISABLED, searchTreeParameters.getRangeActionsOptimizationParameters().getRaRangeShrinking()); + assertEquals(0.002, rangeActionsOptimizationParameters.getHvdcRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.2, searchTreeParameters.getRangeActionsOptimizationParameters().getHvdcSensitivityThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.003, rangeActionsOptimizationParameters.getInjectionRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.3, searchTreeParameters.getRangeActionsOptimizationParameters().getInjectionRaSensitivityThreshold(), DOUBLE_TOLERANCE); + assertEquals(Solver.XPRESS, searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getSolver()); + assertEquals(0.004, searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getRelativeMipGap(), DOUBLE_TOLERANCE); + assertEquals("BLABLABLA", searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getSolverSpecificParameters()); TopoOptimizationParameters topoOptimizationParameters = parameters.getTopoOptimizationParameters(); - assertEquals(3, topoOptimizationParameters.getMaxPreventiveSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(2, topoOptimizationParameters.getMaxAutoSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(3, topoOptimizationParameters.getMaxCurativeSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(List.of(List.of("na1", "na2"), List.of("na3", "na4", "na5")), topoOptimizationParameters.getPredefinedCombinations()); + assertEquals(3, searchTreeParameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(2, searchTreeParameters.getTopoOptimizationParameters().getMaxAutoSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(3, searchTreeParameters.getTopoOptimizationParameters().getMaxCurativeSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(List.of(List.of("na1", "na2"), List.of("na3", "na4", "na5")), searchTreeParameters.getTopoOptimizationParameters().getPredefinedCombinations()); assertEquals(0.02, topoOptimizationParameters.getRelativeMinImpactThreshold(), DOUBLE_TOLERANCE); assertEquals(2.0, topoOptimizationParameters.getAbsoluteMinImpactThreshold(), DOUBLE_TOLERANCE); - assertTrue(topoOptimizationParameters.getSkipActionsFarFromMostLimitingElement()); - assertEquals(3, topoOptimizationParameters.getMaxNumberOfBoundariesForSkippingActions(), DOUBLE_TOLERANCE); + assertTrue(searchTreeParameters.getTopoOptimizationParameters().getSkipActionsFarFromMostLimitingElement()); + assertEquals(3, searchTreeParameters.getTopoOptimizationParameters().getMaxNumberOfBoundariesForSkippingActions(), DOUBLE_TOLERANCE); - MultithreadingParameters multithreadingParameters = parameters.getMultithreadingParameters(); - assertEquals(4, multithreadingParameters.getContingencyScenariosInParallel(), DOUBLE_TOLERANCE); - assertEquals(5, multithreadingParameters.getPreventiveLeavesInParallel(), DOUBLE_TOLERANCE); - assertEquals(3, multithreadingParameters.getAutoLeavesInParallel(), DOUBLE_TOLERANCE); - assertEquals(6, multithreadingParameters.getCurativeLeavesInParallel(), DOUBLE_TOLERANCE); + MultithreadingParameters multithreadingParameters = searchTreeParameters.getMultithreadingParameters(); + assertEquals(5, multithreadingParameters.getAvailableCPUs(), DOUBLE_TOLERANCE); - SecondPreventiveRaoParameters secondPreventiveRaoParameters = parameters.getSecondPreventiveRaoParameters(); + SecondPreventiveRaoParameters secondPreventiveRaoParameters = searchTreeParameters.getSecondPreventiveRaoParameters(); assertEquals(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT, secondPreventiveRaoParameters.getExecutionCondition()); assertTrue(secondPreventiveRaoParameters.getReOptimizeCurativeRangeActions()); assertTrue(secondPreventiveRaoParameters.getHintFromFirstPreventiveRao()); @@ -86,35 +85,35 @@ void testConfigWithExtensions() throws IOException { NotOptimizedCnecsParameters notOptimizedCnecsParameters = parameters.getNotOptimizedCnecsParameters(); assertFalse(notOptimizedCnecsParameters.getDoNotOptimizeCurativeCnecsForTsosWithoutCras()); - LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters = parameters.getLoadFlowAndSensitivityParameters(); + LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class).getLoadFlowAndSensitivityParameters(); assertEquals("LOADFLOW_PROVIDER", loadFlowAndSensitivityParameters.getLoadFlowProvider()); assertEquals("SENSI_PROVIDER", loadFlowAndSensitivityParameters.getSensitivityProvider()); assertEquals(2, loadFlowAndSensitivityParameters.getSensitivityFailureOvercost(), DOUBLE_TOLERANCE); // EXTENSIONS - assertEquals(3, parameters.getExtensions().size()); - - LoopFlowParametersExtension loopFlowParameters = parameters.getExtension(LoopFlowParametersExtension.class); - assertNotNull(loopFlowParameters); - assertEquals(11, loopFlowParameters.getAcceptableIncrease(), DOUBLE_TOLERANCE); - assertEquals(PtdfApproximation.UPDATE_PTDF_WITH_TOPO, loopFlowParameters.getPtdfApproximation()); - assertEquals(12, loopFlowParameters.getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); - assertEquals(13, loopFlowParameters.getViolationCost(), DOUBLE_TOLERANCE); + assertEquals(1, parameters.getExtensions().size()); + + assertTrue(parameters.getLoopFlowParameters().isPresent()); + assertTrue(searchTreeParameters.getLoopFlowParameters().isPresent()); + assertEquals(11, parameters.getLoopFlowParameters().get().getAcceptableIncrease(), DOUBLE_TOLERANCE); + assertEquals(PtdfApproximation.UPDATE_PTDF_WITH_TOPO, searchTreeParameters.getLoopFlowParameters().get().getPtdfApproximation()); + assertEquals(12, searchTreeParameters.getLoopFlowParameters().get().getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); + assertEquals(13, searchTreeParameters.getLoopFlowParameters().get().getViolationCost(), DOUBLE_TOLERANCE); Set expectedCountries = Set.of(Country.FR, Country.ES, Country.PT); - assertEquals(expectedCountries, loopFlowParameters.getCountries()); + assertEquals(expectedCountries, parameters.getLoopFlowParameters().get().getCountries()); - MnecParametersExtension mnecParametersExtension = parameters.getExtension(MnecParametersExtension.class); - assertNotNull(mnecParametersExtension); - assertEquals(55, mnecParametersExtension.getAcceptableMarginDecrease(), DOUBLE_TOLERANCE); - assertEquals(11, mnecParametersExtension.getViolationCost(), DOUBLE_TOLERANCE); - assertEquals(12, mnecParametersExtension.getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); + assertTrue(parameters.getMnecParameters().isPresent()); + assertTrue(searchTreeParameters.getMnecParameters().isPresent()); + assertEquals(55, parameters.getMnecParameters().get().getAcceptableMarginDecrease(), DOUBLE_TOLERANCE); + assertEquals(11, searchTreeParameters.getMnecParameters().get().getViolationCost(), DOUBLE_TOLERANCE); + assertEquals(12, searchTreeParameters.getMnecParameters().get().getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); - RelativeMarginsParametersExtension relativeMarginsParametersExtension = parameters.getExtension(RelativeMarginsParametersExtension.class); - assertNotNull(relativeMarginsParametersExtension); + assertTrue(parameters.getRelativeMarginsParameters().isPresent()); + assertTrue(searchTreeParameters.getRelativeMarginsParameters().isPresent()); List expectedBoundaries = List.of("{FR}-{BE}", "{FR}-{DE}"); - assertEquals(PtdfApproximation.UPDATE_PTDF_WITH_TOPO_AND_PST, relativeMarginsParametersExtension.getPtdfApproximation()); - assertEquals(0.02, relativeMarginsParametersExtension.getPtdfSumLowerBound(), DOUBLE_TOLERANCE); - assertEquals(expectedBoundaries, relativeMarginsParametersExtension.getPtdfBoundariesAsString()); + assertEquals(PtdfApproximation.UPDATE_PTDF_WITH_TOPO_AND_PST, searchTreeParameters.getRelativeMarginsParameters().get().getPtdfApproximation()); + assertEquals(0.02, searchTreeParameters.getRelativeMarginsParameters().get().getPtdfSumLowerBound(), DOUBLE_TOLERANCE); + assertEquals(expectedBoundaries, parameters.getRelativeMarginsParameters().get().getPtdfBoundariesAsString()); // Compare to json roundTripTest(parameters, JsonRaoParameters::write, JsonRaoParameters::read, "/RaoParameters_config_withExtensions.json"); @@ -125,65 +124,27 @@ void testConfigWithoutExtensions() throws IOException { RaoParameters parameters = loadRaoParameters("config_withoutExtensions"); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_AMPERE, objectiveFunctionParameters.getType()); - assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); - assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, objectiveFunctionParameters.getType()); + assertEquals(Unit.AMPERE, objectiveFunctionParameters.getUnit()); assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); - assertEquals(2, rangeActionsOptimizationParameters.getMaxMipIterations(), DOUBLE_TOLERANCE); - assertEquals(0.02, rangeActionsOptimizationParameters.getPstPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(0.2, rangeActionsOptimizationParameters.getPstSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS, rangeActionsOptimizationParameters.getPstModel()); - assertEquals(RangeActionsOptimizationParameters.RaRangeShrinking.DISABLED, rangeActionsOptimizationParameters.getRaRangeShrinking()); - assertEquals(0.002, rangeActionsOptimizationParameters.getHvdcPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(0.2, rangeActionsOptimizationParameters.getHvdcSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(0.003, rangeActionsOptimizationParameters.getInjectionRaPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(0.3, rangeActionsOptimizationParameters.getInjectionRaSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(RangeActionsOptimizationParameters.Solver.XPRESS, rangeActionsOptimizationParameters.getLinearOptimizationSolver().getSolver()); - assertEquals(0.004, rangeActionsOptimizationParameters.getLinearOptimizationSolver().getRelativeMipGap(), DOUBLE_TOLERANCE); - assertEquals("BLABLABLA", rangeActionsOptimizationParameters.getLinearOptimizationSolver().getSolverSpecificParameters()); + assertEquals(0.02, rangeActionsOptimizationParameters.getPstRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.002, rangeActionsOptimizationParameters.getHvdcRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.003, rangeActionsOptimizationParameters.getInjectionRAMinImpactThreshold(), DOUBLE_TOLERANCE); TopoOptimizationParameters topoOptimizationParameters = parameters.getTopoOptimizationParameters(); - assertEquals(3, topoOptimizationParameters.getMaxPreventiveSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(2, topoOptimizationParameters.getMaxAutoSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(3, topoOptimizationParameters.getMaxCurativeSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(List.of(List.of("na1", "na2"), List.of("na3", "na4", "na5")), topoOptimizationParameters.getPredefinedCombinations()); assertEquals(0.02, topoOptimizationParameters.getRelativeMinImpactThreshold(), DOUBLE_TOLERANCE); assertEquals(2.0, topoOptimizationParameters.getAbsoluteMinImpactThreshold(), DOUBLE_TOLERANCE); - assertTrue(topoOptimizationParameters.getSkipActionsFarFromMostLimitingElement()); - assertEquals(3, topoOptimizationParameters.getMaxNumberOfBoundariesForSkippingActions(), DOUBLE_TOLERANCE); - - MultithreadingParameters multithreadingParameters = parameters.getMultithreadingParameters(); - assertEquals(4, multithreadingParameters.getContingencyScenariosInParallel(), DOUBLE_TOLERANCE); - assertEquals(5, multithreadingParameters.getPreventiveLeavesInParallel(), DOUBLE_TOLERANCE); - assertEquals(3, multithreadingParameters.getAutoLeavesInParallel(), DOUBLE_TOLERANCE); - assertEquals(6, multithreadingParameters.getCurativeLeavesInParallel(), DOUBLE_TOLERANCE); - - SecondPreventiveRaoParameters secondPreventiveRaoParameters = parameters.getSecondPreventiveRaoParameters(); - assertEquals(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT, secondPreventiveRaoParameters.getExecutionCondition()); - assertTrue(secondPreventiveRaoParameters.getReOptimizeCurativeRangeActions()); - assertTrue(secondPreventiveRaoParameters.getHintFromFirstPreventiveRao()); NotOptimizedCnecsParameters notOptimizedCnecsParameters = parameters.getNotOptimizedCnecsParameters(); assertFalse(notOptimizedCnecsParameters.getDoNotOptimizeCurativeCnecsForTsosWithoutCras()); - LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters = parameters.getLoadFlowAndSensitivityParameters(); - assertEquals("LOADFLOW_PROVIDER", loadFlowAndSensitivityParameters.getLoadFlowProvider()); - assertEquals("SENSI_PROVIDER", loadFlowAndSensitivityParameters.getSensitivityProvider()); - assertEquals(2, loadFlowAndSensitivityParameters.getSensitivityFailureOvercost(), DOUBLE_TOLERANCE); - // EXTENSIONS assertEquals(0, parameters.getExtensions().size()); - LoopFlowParametersExtension loopFlowParameters = parameters.getExtension(LoopFlowParametersExtension.class); - assertNull(loopFlowParameters); - - MnecParametersExtension mnecParametersExtension = parameters.getExtension(MnecParametersExtension.class); - assertNull(mnecParametersExtension); - - RelativeMarginsParametersExtension relativeMarginsParametersExtension = parameters.getExtension(RelativeMarginsParametersExtension.class); - assertNull(relativeMarginsParametersExtension); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); + assertNull(searchTreeParameters); // Compare to json roundTripTest(parameters, JsonRaoParameters::write, JsonRaoParameters::read, "/RaoParameters_config_withoutExtensions.json"); @@ -192,44 +153,42 @@ void testConfigWithoutExtensions() throws IOException { @Test void testConfigWithPartialExtensions() throws IOException { RaoParameters parameters = loadRaoParameters("config_withPartialExtensions"); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); ObjectiveFunctionParameters objectiveFunctionParameters = parameters.getObjectiveFunctionParameters(); - assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT, objectiveFunctionParameters.getType()); - assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); - assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); + assertEquals(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN, objectiveFunctionParameters.getType()); + assertEquals(Unit.MEGAWATT, objectiveFunctionParameters.getUnit()); + assertEquals(3, searchTreeParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertFalse(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); - assertEquals(10, rangeActionsOptimizationParameters.getMaxMipIterations(), DOUBLE_TOLERANCE); - assertEquals(0.02, rangeActionsOptimizationParameters.getPstPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(0.2, rangeActionsOptimizationParameters.getPstSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS, rangeActionsOptimizationParameters.getPstModel()); - assertEquals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED, rangeActionsOptimizationParameters.getRaRangeShrinking()); - assertEquals(0.002, rangeActionsOptimizationParameters.getHvdcPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(0.2, rangeActionsOptimizationParameters.getHvdcSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(0.003, rangeActionsOptimizationParameters.getInjectionRaPenaltyCost(), DOUBLE_TOLERANCE); - assertEquals(0.3, rangeActionsOptimizationParameters.getInjectionRaSensitivityThreshold(), DOUBLE_TOLERANCE); - assertEquals(RangeActionsOptimizationParameters.Solver.CBC, rangeActionsOptimizationParameters.getLinearOptimizationSolver().getSolver()); - assertEquals(0.004, rangeActionsOptimizationParameters.getLinearOptimizationSolver().getRelativeMipGap(), DOUBLE_TOLERANCE); - assertEquals("BLABLABLA", rangeActionsOptimizationParameters.getLinearOptimizationSolver().getSolverSpecificParameters()); + assertEquals(10, searchTreeParameters.getRangeActionsOptimizationParameters().getMaxMipIterations(), DOUBLE_TOLERANCE); + assertEquals(0.02, rangeActionsOptimizationParameters.getPstRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.2, searchTreeParameters.getRangeActionsOptimizationParameters().getPstSensitivityThreshold(), DOUBLE_TOLERANCE); + assertEquals(PstModel.APPROXIMATED_INTEGERS, searchTreeParameters.getRangeActionsOptimizationParameters().getPstModel()); + assertEquals(RaRangeShrinking.ENABLED, searchTreeParameters.getRangeActionsOptimizationParameters().getRaRangeShrinking()); + assertEquals(0.002, rangeActionsOptimizationParameters.getHvdcRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.2, searchTreeParameters.getRangeActionsOptimizationParameters().getHvdcSensitivityThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.003, rangeActionsOptimizationParameters.getInjectionRAMinImpactThreshold(), DOUBLE_TOLERANCE); + assertEquals(0.3, searchTreeParameters.getRangeActionsOptimizationParameters().getInjectionRaSensitivityThreshold(), DOUBLE_TOLERANCE); + assertEquals(Solver.CBC, searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getSolver()); + assertEquals(0.004, searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getRelativeMipGap(), DOUBLE_TOLERANCE); + assertEquals("BLABLABLA", searchTreeParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().getSolverSpecificParameters()); TopoOptimizationParameters topoOptimizationParameters = parameters.getTopoOptimizationParameters(); - assertEquals(3, topoOptimizationParameters.getMaxPreventiveSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(2, topoOptimizationParameters.getMaxAutoSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(3, topoOptimizationParameters.getMaxCurativeSearchTreeDepth(), DOUBLE_TOLERANCE); - assertEquals(List.of(List.of("na1", "na2"), List.of("na3", "na4", "na5")), topoOptimizationParameters.getPredefinedCombinations()); + assertEquals(3, searchTreeParameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(2, searchTreeParameters.getTopoOptimizationParameters().getMaxAutoSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(3, searchTreeParameters.getTopoOptimizationParameters().getMaxCurativeSearchTreeDepth(), DOUBLE_TOLERANCE); + assertEquals(List.of(List.of("na1", "na2"), List.of("na3", "na4", "na5")), searchTreeParameters.getTopoOptimizationParameters().getPredefinedCombinations()); assertEquals(0.02, topoOptimizationParameters.getRelativeMinImpactThreshold(), DOUBLE_TOLERANCE); assertEquals(2.0, topoOptimizationParameters.getAbsoluteMinImpactThreshold(), DOUBLE_TOLERANCE); - assertTrue(topoOptimizationParameters.getSkipActionsFarFromMostLimitingElement()); - assertEquals(2, topoOptimizationParameters.getMaxNumberOfBoundariesForSkippingActions(), DOUBLE_TOLERANCE); + assertTrue(searchTreeParameters.getTopoOptimizationParameters().getSkipActionsFarFromMostLimitingElement()); + assertEquals(2, searchTreeParameters.getTopoOptimizationParameters().getMaxNumberOfBoundariesForSkippingActions(), DOUBLE_TOLERANCE); - MultithreadingParameters multithreadingParameters = parameters.getMultithreadingParameters(); - assertEquals(1, multithreadingParameters.getContingencyScenariosInParallel(), DOUBLE_TOLERANCE); - assertEquals(5, multithreadingParameters.getPreventiveLeavesInParallel(), DOUBLE_TOLERANCE); - assertEquals(2, multithreadingParameters.getAutoLeavesInParallel(), DOUBLE_TOLERANCE); - assertEquals(6, multithreadingParameters.getCurativeLeavesInParallel(), DOUBLE_TOLERANCE); + MultithreadingParameters multithreadingParameters = searchTreeParameters.getMultithreadingParameters(); + assertEquals(5, multithreadingParameters.getAvailableCPUs(), DOUBLE_TOLERANCE); - SecondPreventiveRaoParameters secondPreventiveRaoParameters = parameters.getSecondPreventiveRaoParameters(); + SecondPreventiveRaoParameters secondPreventiveRaoParameters = searchTreeParameters.getSecondPreventiveRaoParameters(); assertEquals(SecondPreventiveRaoParameters.ExecutionCondition.DISABLED, secondPreventiveRaoParameters.getExecutionCondition()); assertTrue(secondPreventiveRaoParameters.getReOptimizeCurativeRangeActions()); assertTrue(secondPreventiveRaoParameters.getHintFromFirstPreventiveRao()); @@ -237,32 +196,34 @@ void testConfigWithPartialExtensions() throws IOException { NotOptimizedCnecsParameters notOptimizedCnecsParameters = parameters.getNotOptimizedCnecsParameters(); assertFalse(notOptimizedCnecsParameters.getDoNotOptimizeCurativeCnecsForTsosWithoutCras()); - LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters = parameters.getLoadFlowAndSensitivityParameters(); - assertEquals("OpenLoadFlow", loadFlowAndSensitivityParameters.getLoadFlowProvider()); - assertEquals("SENSI_PROVIDER", loadFlowAndSensitivityParameters.getSensitivityProvider()); - assertEquals(2, loadFlowAndSensitivityParameters.getSensitivityFailureOvercost(), DOUBLE_TOLERANCE); + LoadFlowAndSensitivityParameters loadFlowAndSensitivityParametersExt = parameters.getExtension(OpenRaoSearchTreeParameters.class).getLoadFlowAndSensitivityParameters(); + assertEquals("OpenLoadFlow", loadFlowAndSensitivityParametersExt.getLoadFlowProvider()); + assertEquals("SENSI_PROVIDER", loadFlowAndSensitivityParametersExt.getSensitivityProvider()); + assertEquals(2, loadFlowAndSensitivityParametersExt.getSensitivityFailureOvercost(), DOUBLE_TOLERANCE); // EXTENSIONS - assertEquals(2, parameters.getExtensions().size()); - - LoopFlowParametersExtension loopFlowParameters = parameters.getExtension(LoopFlowParametersExtension.class); - assertNotNull(loopFlowParameters); - assertEquals(0, loopFlowParameters.getAcceptableIncrease(), DOUBLE_TOLERANCE); - assertEquals(PtdfApproximation.UPDATE_PTDF_WITH_TOPO, loopFlowParameters.getPtdfApproximation()); - assertEquals(12, loopFlowParameters.getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); - assertEquals(13, loopFlowParameters.getViolationCost(), DOUBLE_TOLERANCE); + assertEquals(1, parameters.getExtensions().size()); + + assertTrue(parameters.getLoopFlowParameters().isPresent()); + assertTrue(searchTreeParameters.getLoopFlowParameters().isPresent()); + assertEquals(0, parameters.getLoopFlowParameters().get().getAcceptableIncrease(), DOUBLE_TOLERANCE); + assertEquals(PtdfApproximation.UPDATE_PTDF_WITH_TOPO, searchTreeParameters.getLoopFlowParameters().get().getPtdfApproximation()); + assertEquals(12, searchTreeParameters.getLoopFlowParameters().get().getConstraintAdjustmentCoefficient(), DOUBLE_TOLERANCE); + assertEquals(13, searchTreeParameters.getLoopFlowParameters().get().getViolationCost(), DOUBLE_TOLERANCE); Set expectedCountries = Set.of(Country.FR, Country.ES, Country.PT); - assertEquals(expectedCountries, loopFlowParameters.getCountries()); + assertEquals(expectedCountries, parameters.getLoopFlowParameters().get().getCountries()); + + assertTrue(parameters.getMnecParameters().isEmpty()); + assertTrue(searchTreeParameters.getMnecParameters().isEmpty()); - MnecParametersExtension mnecParametersExtension = parameters.getExtension(MnecParametersExtension.class); - assertNull(mnecParametersExtension); + assertTrue(searchTreeParameters.getRelativeMarginsParameters().isPresent()); + assertEquals(PtdfApproximation.UPDATE_PTDF_WITH_TOPO_AND_PST, searchTreeParameters.getRelativeMarginsParameters().get().getPtdfApproximation()); + assertEquals(0.02, searchTreeParameters.getRelativeMarginsParameters().get().getPtdfSumLowerBound(), DOUBLE_TOLERANCE); - RelativeMarginsParametersExtension relativeMarginsParametersExtension = parameters.getExtension(RelativeMarginsParametersExtension.class); - assertNotNull(relativeMarginsParametersExtension); - List expectedBoundaries = Collections.emptyList(); - assertEquals(PtdfApproximation.UPDATE_PTDF_WITH_TOPO_AND_PST, relativeMarginsParametersExtension.getPtdfApproximation()); - assertEquals(0.02, relativeMarginsParametersExtension.getPtdfSumLowerBound(), DOUBLE_TOLERANCE); - assertEquals(expectedBoundaries, relativeMarginsParametersExtension.getPtdfBoundariesAsString()); + // If SearchTreeRaoRelativeMarginsParameters is present on extension it should be created on rao-parameters, + // if it exists on rao-parameters it should be created on extension. + // The same rule exist for SearchTreeRaoMnecParameters and SearchTreeRaoLoopFlowParameters + assertTrue(parameters.getRelativeMarginsParameters().isPresent()); // Compare to json roundTripTest(parameters, JsonRaoParameters::write, JsonRaoParameters::read, "/RaoParameters_config_withPartialExtensions.json"); @@ -271,11 +232,11 @@ void testConfigWithPartialExtensions() throws IOException { @Test void testConfigWithOpenLoadFlowExtension() throws IOException { RaoParameters parameters = loadRaoParameters("config_withOpenLoadFlowExtension"); - LoadFlowAndSensitivityParameters loadFlowAndSensitivityParameters = parameters.getLoadFlowAndSensitivityParameters(); - assertEquals("OpenLoadFlow", loadFlowAndSensitivityParameters.getLoadFlowProvider()); - assertEquals("OpenLoadFlow", loadFlowAndSensitivityParameters.getSensitivityProvider()); - assertEquals(2, loadFlowAndSensitivityParameters.getSensitivityFailureOvercost(), DOUBLE_TOLERANCE); - OpenLoadFlowParameters olfParams = loadFlowAndSensitivityParameters.getSensitivityWithLoadFlowParameters().getLoadFlowParameters().getExtension(OpenLoadFlowParameters.class); + LoadFlowAndSensitivityParameters loadFlowAndSensitivityParametersExt = parameters.getExtension(OpenRaoSearchTreeParameters.class).getLoadFlowAndSensitivityParameters(); + assertEquals("OpenLoadFlow", loadFlowAndSensitivityParametersExt.getLoadFlowProvider()); + assertEquals("OpenLoadFlow", loadFlowAndSensitivityParametersExt.getSensitivityProvider()); + assertEquals(2, loadFlowAndSensitivityParametersExt.getSensitivityFailureOvercost(), DOUBLE_TOLERANCE); + OpenLoadFlowParameters olfParams = loadFlowAndSensitivityParametersExt.getSensitivityWithLoadFlowParameters().getLoadFlowParameters().getExtension(OpenLoadFlowParameters.class); assertNotNull(olfParams); assertEquals(0.444, olfParams.getMinPlausibleTargetVoltage(), DOUBLE_TOLERANCE); assertEquals(1.444, olfParams.getMaxPlausibleTargetVoltage(), DOUBLE_TOLERANCE); diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersError_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersError_v2.json index 0556eb9a8f..faf52c2a1c 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersError_v2.json @@ -1,4 +1,4 @@ { - "version" : "2.5", + "version" : "3.0", "unknownField" : "abcd" } \ No newline at end of file diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json index 30c532ab6c..bc60987dc8 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json @@ -1,99 +1,110 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-min-obj-improvement" : 983.0, + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : true }, "range-actions-optimization" : { - "max-mip-iterations" : 30, - "pst-penalty-cost" : 10.0, - "pst-sensitivity-threshold" : 0.2, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 1.0, - "hvdc-sensitivity-threshold" : 0.3, - "injection-ra-penalty-cost" : 1.2, - "injection-ra-sensitivity-threshold" : 0.7, - "ra-range-shrinking" : "ENABLED", - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 1.0E-5, - "solver-specific-parameters" : "TREEMEMORYLIMIT 20" - } + "pst-ra-min-impact-threshold" : 10.0, + "hvdc-ra-min-impact-threshold" : 1.0, + "injection-ra-min-impact-threshold" : 1.2 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 10, - "max-auto-search-tree-depth" : 3, - "max-curative-search-tree-depth" : 10, - "predefined-combinations" : [ [ "na-id-1", "na-id-2" ], [ "na-id-1", "na-id-3", "na-id-4" ] ], "relative-minimum-impact-threshold" : 0.1, - "absolute-minimum-impact-threshold" : 20.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : true + "absolute-minimum-impact-threshold" : 20.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlowProvider", - "sensitivity-provider" : "OpenSensitivityAnalysis", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.1", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0 - }, - "flow-flow-sensitivity-value-threshold" : 0.0, - "voltage-voltage-sensitivity-value-threshold" : 0.0, - "flow-voltage-sensitivity-value-threshold" : 0.0, - "angle-flow-sensitivity-value-threshold" : 0.0 - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 30.0 }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 15, - "preventive-leaves-in-parallel" : 21, - "auto-leaves-in-parallel" : 30, - "curative-leaves-in-parallel" : 22 + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{FR}-{ES}", "{ES}-{PT}", "{BE}-{22Y201903144---9}-{DE}-{22Y201903145---4}" ] + }, + "loop-flow-parameters" : { + "acceptable-increase" : 20.0, + "countries" : [ "BE", "FR" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 30.0, - "violation-cost" : 20.0, - "constraint-adjustment-coefficient" : 3.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{FR}-{ES}", "{ES}-{PT}", "{BE}-{22Y201903144---9}-{DE}-{22Y201903145---4}" ], - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", - "ptdf-sum-lower-bound" : 0.05 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 20.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 0.5, - "violation-cost" : 0.0, - "countries" : [ "BE", "FR" ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 983.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 30, + "pst-sensitivity-threshold" : 0.2, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 0.3, + "injection-ra-sensitivity-threshold" : 0.7, + "ra-range-shrinking" : "ENABLED", + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 1.0E-5, + "solver-specific-parameters" : "TREEMEMORYLIMIT 20" + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 10, + "max-auto-search-tree-depth" : 3, + "max-curative-search-tree-depth" : 10, + "predefined-combinations" : [ [ "na-id-1", "na-id-2" ], [ "na-id-1", "na-id-3", "na-id-4" ] ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : true + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlowProvider", + "sensitivity-provider" : "OpenSensitivityAnalysis", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.1", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : false, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0 + }, + "flow-flow-sensitivity-value-threshold" : 0.0, + "voltage-voltage-sensitivity-value-threshold" : 0.0, + "flow-voltage-sensitivity-value-threshold" : 0.0, + "angle-flow-sensitivity-value-threshold" : 0.0 + } + }, + "multi-threading" : { + "available-cpus" : 21 + }, + "mnec-parameters" : { + "violation-cost" : 20.0, + "constraint-adjustment-coefficient" : 3.0 + }, + "relative-margins-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", + "ptdf-sum-lower-bound" : 0.05 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 0.5, + "violation-cost" : 0.0 + } } } } \ No newline at end of file diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json index 800323d649..ed972e8c6a 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json @@ -1,82 +1,22 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-min-obj-improvement" : 0.0, + "type" : "SECURE_FLOW", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.1", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0 - }, - "flow-flow-sensitivity-value-threshold" : 0.0, - "voltage-voltage-sensitivity-value-threshold" : 0.0, - "flow-voltage-sensitivity-value-threshold" : 0.0, - "angle-flow-sensitivity-value-threshold" : 0.0 - } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, "extensions" : { "dummy-extension" : { } } 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..90bb871239 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json @@ -1,82 +1,89 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-min-obj-improvement" : 0.0 + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.8", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "FIXED_PTDF_WRONG", - "constraint-adjustment-coefficient" : 0.0, - "violation-cost" : 0.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.8", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "FIXED_PTDF_WRONG", + "constraint-adjustment-coefficient" : 0.0, + "violation-cost" : 0.0 + } } } } \ No newline at end of file diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithObjFuncTypeError_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithObjFuncTypeError_v2.json new file mode 100644 index 0000000000..0b6aca1ac7 --- /dev/null +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithObjFuncTypeError_v2.json @@ -0,0 +1,88 @@ +{ + "version" : "3.0", + "objective-function" : { + "type" : "WRONG" + }, + "range-actions-optimization" : { + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 + }, + "topological-actions-optimization" : { + "relative-minimum-impact-threshold" : 0.0, + "absolute-minimum-impact-threshold" : 0.0 + }, + "not-optimized-cnecs" : { + "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.8", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "FIXED_PTDF", + "constraint-adjustment-coefficient" : 0.0, + "violation-cost" : 0.0 + } + } + } +} \ No newline at end of file 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..7455b17aec 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json @@ -1,82 +1,89 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "WRONG", - "curative-min-obj-improvement" : 0.0 + "type" : "MAX_MIN_MARGIN", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.8", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "FIXED_PTDF", - "constraint-adjustment-coefficient" : 0.0, - "violation-cost" : 0.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.8", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "FIXED_PTDF", + "constraint-adjustment-coefficient" : 0.0, + "violation-cost" : 0.0 + } } } } \ No newline at end of file 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..3b4ac7e7e7 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json @@ -1,73 +1,80 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-min-obj-improvement" : 0.0 + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.8", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.8", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "wrong" : 1 } } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 } } \ No newline at end of file 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..2327020e63 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,179 +1,190 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-min-obj-improvement" : 3.0, + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 2, - "pst-penalty-cost" : 0.02, - "pst-sensitivity-threshold" : 0.2, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.002, - "hvdc-sensitivity-threshold" : 0.2, - "injection-ra-penalty-cost" : 0.003, - "injection-ra-sensitivity-threshold" : 0.3, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "XPRESS", - "relative-mip-gap" : 0.004, - "solver-specific-parameters" : "BLABLABLA" - } + "pst-ra-min-impact-threshold" : 0.02, + "hvdc-ra-min-impact-threshold" : 0.002, + "injection-ra-min-impact-threshold" : 0.003 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 3, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 3, - "predefined-combinations" : [ [ "na1", "na2" ], [ "na3", "na4", "na5" ] ], "relative-minimum-impact-threshold" : 0.02, - "absolute-minimum-impact-threshold" : 2.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 3 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : true + "absolute-minimum-impact-threshold" : 2.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "LOADFLOW_PROVIDER", - "sensitivity-provider" : "SENSI_PROVIDER", - "sensitivity-failure-overcost" : 2.0, - "sensitivity-parameters" : { - "version" : "1.1", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 5000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "generatorReactivePowerRemoteControl" : false, - "transformerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 15, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 2.0, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "actionableTransformersIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "disableVoltageControlOfGeneratorsOutsideActivePowerLimits" : false, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false, - "acSolverType" : "NEWTON_RAPHSON", - "maxNewtonKrylovIterations" : 100, - "newtonKrylovLineSearch" : false, - "referenceBusSelectionMode" : "FIRST_SLACK", - "writeReferenceTerminals" : true, - "voltageTargetPriorities" : [ "GENERATOR", "TRANSFORMER", "SHUNT" ], - "transformerVoltageControlUseInitialTapPosition" : false, - "generatorVoltageControlMinNominalVoltage" : -1.0, - "fictitiousGeneratorVoltageControlCheckMode" : "FORCED", - "areaInterchangeControl" : false, - "areaInterchangeControlAreaType" : "ControlArea", - "areaInterchangePMaxMismatch" : 2.0 - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 55.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{FR}-{BE}", "{FR}-{DE}" ] + }, + "loop-flow-parameters" : { + "acceptable-increase" : 11.0, + "countries" : [ "ES", "FR", "PT" ] + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 3.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 2, + "pst-sensitivity-threshold" : 0.2, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 0.2, + "injection-ra-sensitivity-threshold" : 0.3, + "ra-range-shrinking" : "DISABLED", + "linear-optimization-solver" : { + "solver" : "XPRESS", + "relative-mip-gap" : 0.004, + "solver-specific-parameters" : "BLABLABLA" } }, - "flow-flow-sensitivity-value-threshold" : 0.0, - "voltage-voltage-sensitivity-value-threshold" : 0.0, - "flow-voltage-sensitivity-value-threshold" : 0.0, - "angle-flow-sensitivity-value-threshold" : 0.0, - "extensions" : { - "open-sensitivity-parameters" : { - "debugDir" : null + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 3, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 3, + "predefined-combinations" : [ [ "na1", "na2" ], [ "na3", "na4", "na5" ] ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 3 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : true + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "LOADFLOW_PROVIDER", + "sensitivity-provider" : "SENSI_PROVIDER", + "sensitivity-failure-overcost" : 2.0, + "sensitivity-parameters" : { + "version" : "1.1", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : false, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 5000.0, + "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", + "maxActivePowerMismatch" : 0.01, + "maxReactivePowerMismatch" : 0.01, + "maxVoltageMismatch" : 1.0E-4, + "maxAngleMismatch" : 1.0E-5, + "maxRatioMismatch" : 1.0E-5, + "maxSusceptanceMismatch" : 1.0E-4, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "generatorReactivePowerRemoteControl" : false, + "transformerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 15, + "maxOuterLoopIterations" : 20, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minNominalVoltageTargetVoltageCheck" : 20.0, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 2.0, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3, + "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", + "alwaysUpdateNetwork" : false, + "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, + "reportedFeatures" : [ ], + "slackBusCountryFilter" : [ ], + "actionableSwitchesIds" : [ ], + "actionableTransformersIds" : [ ], + "asymmetrical" : false, + "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", + "outerLoopNames" : null, + "useActiveLimits" : true, + "disableVoltageControlOfGeneratorsOutsideActivePowerLimits" : false, + "lineSearchStateVectorScalingMaxIteration" : 10, + "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, + "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, + "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, + "linePerUnitMode" : "IMPEDANCE", + "useLoadModel" : false, + "dcApproximationType" : "IGNORE_R", + "simulateAutomationSystems" : false, + "acSolverType" : "NEWTON_RAPHSON", + "maxNewtonKrylovIterations" : 100, + "newtonKrylovLineSearch" : false, + "referenceBusSelectionMode" : "FIRST_SLACK", + "writeReferenceTerminals" : true, + "voltageTargetPriorities" : [ "GENERATOR", "TRANSFORMER", "SHUNT" ], + "transformerVoltageControlUseInitialTapPosition" : false, + "generatorVoltageControlMinNominalVoltage" : -1.0, + "fictitiousGeneratorVoltageControlCheckMode" : "FORCED", + "areaInterchangeControl" : false, + "areaInterchangeControlAreaType" : "ControlArea", + "areaInterchangePMaxMismatch" : 2.0 + } + } + }, + "flow-flow-sensitivity-value-threshold" : 0.0, + "voltage-voltage-sensitivity-value-threshold" : 0.0, + "flow-voltage-sensitivity-value-threshold" : 0.0, + "angle-flow-sensitivity-value-threshold" : 0.0, + "extensions" : { + "open-sensitivity-parameters" : { + "debugDir" : null + } + } } + }, + "multi-threading" : { + "available-cpus" : 5 + }, + "mnec-parameters" : { + "violation-cost" : 11.0, + "constraint-adjustment-coefficient" : 12.0 + }, + "relative-margins-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "ptdf-sum-lower-bound" : 0.02 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", + "constraint-adjustment-coefficient" : 12.0, + "violation-cost" : 13.0 } } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 4, - "preventive-leaves-in-parallel" : 5, - "auto-leaves-in-parallel" : 3, - "curative-leaves-in-parallel" : 6 - }, - "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 55.0, - "violation-cost" : 11.0, - "constraint-adjustment-coefficient" : 12.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{FR}-{BE}", "{FR}-{DE}" ], - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "ptdf-sum-lower-bound" : 0.02 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 11.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", - "constraint-adjustment-coefficient" : 12.0, - "violation-cost" : 13.0, - "countries" : [ "ES", "FR", "PT" ] - } } } \ No newline at end of file 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..6e5259d5fb 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,160 +1,167 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-min-obj-improvement" : 0.0, + "type" : "SECURE_FLOW", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 2.0, - "sensitivity-parameters" : { - "version" : "1.1", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "DC_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : true, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ "UA" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 5000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "generatorReactivePowerRemoteControl" : false, - "transformerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 111, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.444, - "maxPlausibleTargetVoltage" : 1.444, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 2.0, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "actionableTransformersIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "disableVoltageControlOfGeneratorsOutsideActivePowerLimits" : false, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false, - "acSolverType" : "NEWTON_RAPHSON", - "maxNewtonKrylovIterations" : 100, - "newtonKrylovLineSearch" : false, - "referenceBusSelectionMode" : "FIRST_SLACK", - "writeReferenceTerminals" : true, - "voltageTargetPriorities" : [ "GENERATOR", "TRANSFORMER", "SHUNT" ], - "transformerVoltageControlUseInitialTapPosition" : false, - "generatorVoltageControlMinNominalVoltage" : -1.0, - "fictitiousGeneratorVoltageControlCheckMode" : "FORCED", - "areaInterchangeControl" : false, - "areaInterchangeControlAreaType" : "ControlArea", - "areaInterchangePMaxMismatch" : 2.0 - } + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "ra-range-shrinking" : "DISABLED", + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null } }, - "flow-flow-sensitivity-value-threshold" : 0.0, - "voltage-voltage-sensitivity-value-threshold" : 0.0, - "flow-voltage-sensitivity-value-threshold" : 0.0, - "angle-flow-sensitivity-value-threshold" : 0.0, - "extensions" : { - "open-sensitivity-parameters" : { - "debugDir" : null + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 2.0, + "sensitivity-parameters" : { + "version" : "1.1", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "DC_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : true, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : false, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ "UA" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 5000.0, + "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", + "maxActivePowerMismatch" : 0.01, + "maxReactivePowerMismatch" : 0.01, + "maxVoltageMismatch" : 1.0E-4, + "maxAngleMismatch" : 1.0E-5, + "maxRatioMismatch" : 1.0E-5, + "maxSusceptanceMismatch" : 1.0E-4, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "generatorReactivePowerRemoteControl" : false, + "transformerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 111, + "maxOuterLoopIterations" : 20, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.444, + "maxPlausibleTargetVoltage" : 1.444, + "minNominalVoltageTargetVoltageCheck" : 20.0, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 2.0, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3, + "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", + "alwaysUpdateNetwork" : false, + "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, + "reportedFeatures" : [ ], + "slackBusCountryFilter" : [ ], + "actionableSwitchesIds" : [ ], + "actionableTransformersIds" : [ ], + "asymmetrical" : false, + "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", + "outerLoopNames" : null, + "useActiveLimits" : true, + "disableVoltageControlOfGeneratorsOutsideActivePowerLimits" : false, + "lineSearchStateVectorScalingMaxIteration" : 10, + "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, + "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, + "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, + "linePerUnitMode" : "IMPEDANCE", + "useLoadModel" : false, + "dcApproximationType" : "IGNORE_R", + "simulateAutomationSystems" : false, + "acSolverType" : "NEWTON_RAPHSON", + "maxNewtonKrylovIterations" : 100, + "newtonKrylovLineSearch" : false, + "referenceBusSelectionMode" : "FIRST_SLACK", + "writeReferenceTerminals" : true, + "voltageTargetPriorities" : [ "GENERATOR", "TRANSFORMER", "SHUNT" ], + "transformerVoltageControlUseInitialTapPosition" : false, + "generatorVoltageControlMinNominalVoltage" : -1.0, + "fictitiousGeneratorVoltageControlCheckMode" : "FORCED", + "areaInterchangeControl" : false, + "areaInterchangeControlAreaType" : "ControlArea", + "areaInterchangePMaxMismatch" : 2.0 + } + } + }, + "flow-flow-sensitivity-value-threshold" : 0.0, + "voltage-voltage-sensitivity-value-threshold" : 0.0, + "flow-voltage-sensitivity-value-threshold" : 0.0, + "angle-flow-sensitivity-value-threshold" : 0.0, + "extensions" : { + "open-sensitivity-parameters" : { + "debugDir" : null + } + } } + }, + "multi-threading" : { + "available-cpus" : 1 } } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 } } \ No newline at end of file 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..8790e724a9 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,174 +1,183 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-min-obj-improvement" : 3.0, + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.02, - "pst-sensitivity-threshold" : 0.2, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.002, - "hvdc-sensitivity-threshold" : 0.2, - "injection-ra-penalty-cost" : 0.003, - "injection-ra-sensitivity-threshold" : 0.3, - "ra-range-shrinking" : "ENABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.004, - "solver-specific-parameters" : "BLABLABLA" - } + "pst-ra-min-impact-threshold" : 0.02, + "hvdc-ra-min-impact-threshold" : 0.002, + "injection-ra-min-impact-threshold" : 0.003 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 3, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 3, - "predefined-combinations" : [ [ "na1", "na2" ], [ "na3", "na4", "na5" ] ], "relative-minimum-impact-threshold" : 0.02, - "absolute-minimum-impact-threshold" : 2.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : true + "absolute-minimum-impact-threshold" : 2.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "SENSI_PROVIDER", - "sensitivity-failure-overcost" : 2.0, - "sensitivity-parameters" : { - "version" : "1.1", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 5000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "generatorReactivePowerRemoteControl" : false, - "transformerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 15, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 2.0, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "actionableTransformersIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "disableVoltageControlOfGeneratorsOutsideActivePowerLimits" : false, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false, - "acSolverType" : "NEWTON_RAPHSON", - "maxNewtonKrylovIterations" : 100, - "newtonKrylovLineSearch" : false, - "referenceBusSelectionMode" : "FIRST_SLACK", - "writeReferenceTerminals" : true, - "voltageTargetPriorities" : [ "GENERATOR", "TRANSFORMER", "SHUNT" ], - "transformerVoltageControlUseInitialTapPosition" : false, - "generatorVoltageControlMinNominalVoltage" : -1.0, - "fictitiousGeneratorVoltageControlCheckMode" : "FORCED", - "areaInterchangeControl" : false, - "areaInterchangeControlAreaType" : "ControlArea", - "areaInterchangePMaxMismatch" : 2.0 - } + "relative-margins-parameters" : { + "ptdf-boundaries" : [ ] + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ "ES", "FR", "PT" ] + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 3.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 0.2, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 0.2, + "injection-ra-sensitivity-threshold" : 0.3, + "ra-range-shrinking" : "ENABLED", + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.004, + "solver-specific-parameters" : "BLABLABLA" } }, - "flow-flow-sensitivity-value-threshold" : 0.0, - "voltage-voltage-sensitivity-value-threshold" : 0.0, - "flow-voltage-sensitivity-value-threshold" : 0.0, - "angle-flow-sensitivity-value-threshold" : 0.0, - "extensions" : { - "open-sensitivity-parameters" : { - "debugDir" : null + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 3, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 3, + "predefined-combinations" : [ [ "na1", "na2" ], [ "na3", "na4", "na5" ] ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : true + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "SENSI_PROVIDER", + "sensitivity-failure-overcost" : 2.0, + "sensitivity-parameters" : { + "version" : "1.1", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : false, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 5000.0, + "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", + "maxActivePowerMismatch" : 0.01, + "maxReactivePowerMismatch" : 0.01, + "maxVoltageMismatch" : 1.0E-4, + "maxAngleMismatch" : 1.0E-5, + "maxRatioMismatch" : 1.0E-5, + "maxSusceptanceMismatch" : 1.0E-4, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "generatorReactivePowerRemoteControl" : false, + "transformerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 15, + "maxOuterLoopIterations" : 20, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minNominalVoltageTargetVoltageCheck" : 20.0, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 2.0, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3, + "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", + "alwaysUpdateNetwork" : false, + "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, + "reportedFeatures" : [ ], + "slackBusCountryFilter" : [ ], + "actionableSwitchesIds" : [ ], + "actionableTransformersIds" : [ ], + "asymmetrical" : false, + "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", + "outerLoopNames" : null, + "useActiveLimits" : true, + "disableVoltageControlOfGeneratorsOutsideActivePowerLimits" : false, + "lineSearchStateVectorScalingMaxIteration" : 10, + "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, + "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, + "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, + "linePerUnitMode" : "IMPEDANCE", + "useLoadModel" : false, + "dcApproximationType" : "IGNORE_R", + "simulateAutomationSystems" : false, + "acSolverType" : "NEWTON_RAPHSON", + "maxNewtonKrylovIterations" : 100, + "newtonKrylovLineSearch" : false, + "referenceBusSelectionMode" : "FIRST_SLACK", + "writeReferenceTerminals" : true, + "voltageTargetPriorities" : [ "GENERATOR", "TRANSFORMER", "SHUNT" ], + "transformerVoltageControlUseInitialTapPosition" : false, + "generatorVoltageControlMinNominalVoltage" : -1.0, + "fictitiousGeneratorVoltageControlCheckMode" : "FORCED", + "areaInterchangeControl" : false, + "areaInterchangeControlAreaType" : "ControlArea", + "areaInterchangePMaxMismatch" : 2.0 + } + } + }, + "flow-flow-sensitivity-value-threshold" : 0.0, + "voltage-voltage-sensitivity-value-threshold" : 0.0, + "flow-voltage-sensitivity-value-threshold" : 0.0, + "angle-flow-sensitivity-value-threshold" : 0.0, + "extensions" : { + "open-sensitivity-parameters" : { + "debugDir" : null + } + } } + }, + "multi-threading" : { + "available-cpus" : 5 + }, + "relative-margins-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "ptdf-sum-lower-bound" : 0.02 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", + "constraint-adjustment-coefficient" : 12.0, + "violation-cost" : 13.0 } } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 5, - "auto-leaves-in-parallel" : 2, - "curative-leaves-in-parallel" : 6 - }, - "extensions" : { - "relative-margins-parameters" : { - "ptdf-boundaries" : [ ], - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "ptdf-sum-lower-bound" : 0.02 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", - "constraint-adjustment-coefficient" : 12.0, - "violation-cost" : 13.0, - "countries" : [ "ES", "FR", "PT" ] - } } } \ No newline at end of file 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..e3f58641e1 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,160 +1,20 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-min-obj-improvement" : 3.0, + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 2, - "pst-penalty-cost" : 0.02, - "pst-sensitivity-threshold" : 0.2, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.002, - "hvdc-sensitivity-threshold" : 0.2, - "injection-ra-penalty-cost" : 0.003, - "injection-ra-sensitivity-threshold" : 0.3, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "XPRESS", - "relative-mip-gap" : 0.004, - "solver-specific-parameters" : "BLABLABLA" - } + "pst-ra-min-impact-threshold" : 0.02, + "hvdc-ra-min-impact-threshold" : 0.002, + "injection-ra-min-impact-threshold" : 0.003 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 3, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 3, - "predefined-combinations" : [ [ "na1", "na2" ], [ "na3", "na4", "na5" ] ], "relative-minimum-impact-threshold" : 0.02, - "absolute-minimum-impact-threshold" : 2.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 3 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : true + "absolute-minimum-impact-threshold" : 2.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false - }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "LOADFLOW_PROVIDER", - "sensitivity-provider" : "SENSI_PROVIDER", - "sensitivity-failure-overcost" : 2.0, - "sensitivity-parameters" : { - "version" : "1.1", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 5000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "generatorReactivePowerRemoteControl" : false, - "transformerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 15, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 2.0, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "actionableTransformersIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "disableVoltageControlOfGeneratorsOutsideActivePowerLimits" : false, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false, - "acSolverType" : "NEWTON_RAPHSON", - "maxNewtonKrylovIterations" : 100, - "newtonKrylovLineSearch" : false, - "referenceBusSelectionMode" : "FIRST_SLACK", - "writeReferenceTerminals" : true, - "voltageTargetPriorities" : [ "GENERATOR", "TRANSFORMER", "SHUNT" ], - "transformerVoltageControlUseInitialTapPosition" : false, - "generatorVoltageControlMinNominalVoltage" : -1.0, - "fictitiousGeneratorVoltageControlCheckMode" : "FORCED", - "areaInterchangeControl" : false, - "areaInterchangeControlAreaType" : "ControlArea", - "areaInterchangePMaxMismatch" : 2.0 - } - } - }, - "flow-flow-sensitivity-value-threshold" : 0.0, - "voltage-voltage-sensitivity-value-threshold" : 0.0, - "flow-voltage-sensitivity-value-threshold" : 0.0, - "angle-flow-sensitivity-value-threshold" : 0.0, - "extensions" : { - "open-sensitivity-parameters" : { - "debugDir" : null - } - } - } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 4, - "preventive-leaves-in-parallel" : 5, - "auto-leaves-in-parallel" : 3, - "curative-leaves-in-parallel" : 6 } } \ No newline at end of file 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..8d19f8ca5e 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,36 +1,42 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6 + "pst-ra-min-impact-threshold" : 0.01 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 5, "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : true }, - "multi-threading" : { - "preventive-leaves-in-parallel" : 8, - "auto-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 3 + "mnec-parameters" : { + "acceptable-margin-decrease" : 33.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 33.0, - "violation-cost" : 23.0, - "constraint-adjustment-coefficient" : 4.0 + "open-rao-search-tree-parameters" : { + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6 + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 5, + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "multi-threading" : { + "available-cpus" : 8 + }, + "mnec-parameters" : { + "violation-cost" : 23.0, + "constraint-adjustment-coefficient" : 4.0 + } } } } \ No newline at end of file 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..5b844e4282 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,33 +1,41 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6 + "pst-ra-min-impact-threshold" : 0.01 }, "topological-actions-optimization" : { - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true - }, - "second-preventive-rao" : { - "execution-condition" : "COST_INCREASE", - "hint-from-first-preventive-rao" : true + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : true }, - "extensions" : { "mnec-parameters" : { "acceptable-margin-decrease" : 888.0 }, "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{FR}-{ES}"], - "ptdf-sum-lower-bound" : 0.06 + "ptdf-boundaries" : [ "{FR}-{ES}" ] + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6 + }, + "topological-actions-optimization" : { + "skip-actions-far-from-most-limiting-element" : true + }, + "second-preventive-rao" : { + "execution-condition" : "COST_INCREASE", + "hint-from-first-preventive-rao" : true + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.06 + } + } } -} } \ No newline at end of file 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..faa076ecdd 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json @@ -1,80 +1,20 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-min-obj-improvement" : 0.0, + "type" : "SECURE_FLOW", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false - }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.1", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0 - }, - "flow-flow-sensitivity-value-threshold" : 0.0, - "voltage-voltage-sensitivity-value-threshold" : 0.0, - "flow-voltage-sensitivity-value-threshold" : 0.0, - "angle-flow-sensitivity-value-threshold" : 0.0 - } - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 } } \ No newline at end of file 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..30ccedc277 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withExtensions.yml @@ -1,65 +1,75 @@ rao-objective-function: - type: MAX_MIN_MARGIN_IN_AMPERE - preventive-stop-criterion: MIN_OBJECTIVE + type: MAX_MIN_MARGIN + unit: AMPERE curative-min-obj-improvement: 3.0 rao-range-actions-optimization: + pst-ra-min-impact-threshold: 0.02 + hvdc-ra-min-impact-threshold: 0.002 + injection-ra-min-impact-threshold: 0.003 + +rao-topological-actions-optimization: + relative-minimum-impact-threshold: 0.02 + absolute-minimum-impact-threshold: 2.0 + +rao-not-optimized-cnecs: + do-not-optimize-curative-cnecs-for-tsos-without-cras: false + +rao-loop-flow-parameters: + acceptable-increase: 11.0 + countries: [ "FR", "ES", "PT" ] + +search-tree-loop-flow-parameters: + ptdf-approximation: UPDATE_PTDF_WITH_TOPO + constraint-adjustment-coefficient: 12.0 + violation-cost: 13.0 + +rao-mnec-parameters: + acceptable-margin-decrease: 55.0 + +search-tree-mnec-parameters: + violation-cost: 11.0 + constraint-adjustment-coefficient: 12.0 + +rao-relative-margins-parameters: + ptdf-boundaries: [ "{FR}-{BE}", "{FR}-{DE}" ] + +search-tree-relative-margins-parameters: + ptdf-approximation: UPDATE_PTDF_WITH_TOPO_AND_PST + ptdf-sum-lower-bound: 0.02 + +search-tree-objective-function: + curative-min-obj-improvement: 3.0 + +search-tree-range-actions-optimization: max-mip-iterations: 2 - pst-penalty-cost: 0.02 pst-sensitivity-threshold: 0.2 pst-model: APPROXIMATED_INTEGERS - hvdc-penalty-cost: 0.002 hvdc-sensitivity-threshold: 0.2 - injection-ra-penalty-cost: 0.003 injection-ra-sensitivity-threshold: 0.3 -rao-linear-optimization-solver: +search-tree-linear-optimization-solver: solver: XPRESS relative-mip-gap: 0.004 solver-specific-parameters: BLABLABLA -rao-topological-actions-optimization: +search-tree-topological-actions-optimization: max-preventive-search-tree-depth: 3 max-auto-search-tree-depth: 2 max-curative-search-tree-depth: 3 predefined-combinations: [ "{na1}+{na2}", "{na3}+{na4}+{na5}" ] - relative-minimum-impact-threshold: 0.02 - absolute-minimum-impact-threshold: 2.0 skip-actions-far-from-most-limiting-element: true max-number-of-boundaries-for-skipping-actions: 3 -rao-second-preventive-rao: +search-tree-second-preventive-rao: execution-condition: POSSIBLE_CURATIVE_IMPROVEMENT re-optimize-curative-range-actions: true hint-from-first-preventive-rao: true -rao-not-optimized-cnecs: - do-not-optimize-curative-cnecs-for-tsos-without-cras: false - -rao-load-flow-and-sensitivity-computation: +search-tree-load-flow-and-sensitivity-computation: load-flow-provider: LOADFLOW_PROVIDER sensitivity-provider: SENSI_PROVIDER sensitivity-failure-overcost: 2 -rao-multi-threading: - contingency-scenarios-in-parallel: 4 - preventive-leaves-in-parallel: 5 - auto-leaves-in-parallel: 3 - curative-leaves-in-parallel: 6 - -rao-loop-flow-parameters: - acceptable-increase: 11.0 - ptdf-approximation: UPDATE_PTDF_WITH_TOPO - constraint-adjustment-coefficient: 12.0 - violation-cost: 13.0 - countries: [ "FR", "ES", "PT" ] - -rao-mnec-parameters: - acceptable-margin-decrease: 55.0 - violation-cost: 11.0 - constraint-adjustment-coefficient: 12.0 - -rao-relative-margins-parameters: - ptdf-boundaries: [ "{FR}-{BE}", "{FR}-{DE}" ] - ptdf-approximation: UPDATE_PTDF_WITH_TOPO_AND_PST - ptdf-sum-lower-bound: 0.02 \ No newline at end of file +search-tree-multi-threading: + available-cpus: 5 \ No newline at end of file diff --git a/ra-optimisation/rao-api/src/test/resources/config_withOpenLoadFlowExtension.yml b/ra-optimisation/rao-api/src/test/resources/config_withOpenLoadFlowExtension.yml index 6f33c0df49..3571ed2250 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withOpenLoadFlowExtension.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withOpenLoadFlowExtension.yml @@ -1,4 +1,4 @@ -rao-load-flow-and-sensitivity-computation: +search-tree-load-flow-and-sensitivity-computation: load-flow-provider: OpenLoadFlow sensitivity-provider: OpenLoadFlow sensitivity-failure-overcost: 2 diff --git a/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml b/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml index 3a37e14d7e..99629395bf 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withPartialExtensions.yml @@ -1,50 +1,56 @@ rao-objective-function: - preventive-stop-criterion: MIN_OBJECTIVE - curative-min-obj-improvement: 3.0 + type: MAX_MIN_MARGIN rao-range-actions-optimization: - pst-penalty-cost: 0.02 + pst-ra-min-impact-threshold: 0.02 + hvdc-ra-min-impact-threshold: 0.002 + injection-ra-min-impact-threshold: 0.003 + +rao-topological-actions-optimization: + relative-minimum-impact-threshold: 0.02 + absolute-minimum-impact-threshold: 2.0 + +rao-loop-flow-parameters: + countries: [ "FR", "ES", "PT" ] + +search-tree-loop-flow-parameters: + ptdf-approximation: UPDATE_PTDF_WITH_TOPO + constraint-adjustment-coefficient: 12.0 + violation-cost: 13.0 + +search-tree-relative-margins-parameters: + ptdf-approximation: UPDATE_PTDF_WITH_TOPO_AND_PST + ptdf-sum-lower-bound: 0.02 + +search-tree-objective-function: + curative-min-obj-improvement: 3.0 + +search-tree-range-actions-optimization: pst-sensitivity-threshold: 0.2 pst-model: APPROXIMATED_INTEGERS ra-range-shrinking: ENABLED - hvdc-penalty-cost: 0.002 hvdc-sensitivity-threshold: 0.2 - injection-ra-penalty-cost: 0.003 injection-ra-sensitivity-threshold: 0.3 -rao-linear-optimization-solver: +search-tree-linear-optimization-solver: relative-mip-gap: 0.004 solver-specific-parameters: BLABLABLA -rao-topological-actions-optimization: +search-tree-topological-actions-optimization: max-preventive-search-tree-depth: 3 max-auto-search-tree-depth: 2 max-curative-search-tree-depth: 3 predefined-combinations: [ "{na1}+{na2}", "{na3}+{na4}+{na5}" ] - relative-minimum-impact-threshold: 0.02 - absolute-minimum-impact-threshold: 2.0 skip-actions-far-from-most-limiting-element: true max-number-of-boundaries-for-skipping-actions: 2 -rao-second-preventive-rao: +search-tree-second-preventive-rao: re-optimize-curative-range-actions: true hint-from-first-preventive-rao: true -rao-load-flow-and-sensitivity-computation: +search-tree-load-flow-and-sensitivity-computation: sensitivity-provider: SENSI_PROVIDER sensitivity-failure-overcost: 2 -rao-multi-threading: - preventive-leaves-in-parallel: 5 - auto-leaves-in-parallel: 2 - curative-leaves-in-parallel: 6 - -rao-loop-flow-parameters: - ptdf-approximation: UPDATE_PTDF_WITH_TOPO - constraint-adjustment-coefficient: 12.0 - violation-cost: 13.0 - countries: [ "FR", "ES", "PT" ] - -rao-relative-margins-parameters: - ptdf-approximation: UPDATE_PTDF_WITH_TOPO_AND_PST - ptdf-sum-lower-bound: 0.02 \ No newline at end of file +search-tree-multi-threading: + available-cpus: 5 \ No newline at end of file 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..1897283562 100644 --- a/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml +++ b/ra-optimisation/rao-api/src/test/resources/config_withoutExtensions.yml @@ -1,50 +1,16 @@ rao-objective-function: - type: MAX_MIN_MARGIN_IN_AMPERE - preventive-stop-criterion: MIN_OBJECTIVE - curative-min-obj-improvement: 3.0 + type: MAX_MIN_MARGIN + unit: AMPERE enforce-curative-security: false rao-range-actions-optimization: - max-mip-iterations: 2 - pst-penalty-cost: 0.02 - pst-sensitivity-threshold: 0.2 - pst-model: APPROXIMATED_INTEGERS - ra-range-shrinking: DISABLED - hvdc-penalty-cost: 0.002 - hvdc-sensitivity-threshold: 0.2 - injection-ra-penalty-cost: 0.003 - injection-ra-sensitivity-threshold: 0.3 - -rao-linear-optimization-solver: - solver: XPRESS - relative-mip-gap: 0.004 - solver-specific-parameters: BLABLABLA + pst-ra-min-impact-threshold: 0.02 + hvdc-ra-min-impact-threshold: 0.002 + injection-ra-min-impact-threshold: 0.003 rao-topological-actions-optimization: - max-preventive-search-tree-depth: 3 - max-auto-search-tree-depth: 2 - max-curative-search-tree-depth: 3 - predefined-combinations: [ "{na1}+{na2}", "{na3}+{na4}+{na5}" ] relative-minimum-impact-threshold: 0.02 absolute-minimum-impact-threshold: 2.0 - skip-actions-far-from-most-limiting-element: true - max-number-of-boundaries-for-skipping-actions: 3 - -rao-second-preventive-rao: - execution-condition: POSSIBLE_CURATIVE_IMPROVEMENT - re-optimize-curative-range-actions: true - hint-from-first-preventive-rao: true rao-not-optimized-cnecs: - do-not-optimize-curative-cnecs-for-tsos-without-cras: false - -rao-load-flow-and-sensitivity-computation: - load-flow-provider: LOADFLOW_PROVIDER - sensitivity-provider: SENSI_PROVIDER - sensitivity-failure-overcost: 2 - -rao-multi-threading: - contingency-scenarios-in-parallel: 4 - preventive-leaves-in-parallel: 5 - auto-leaves-in-parallel: 3 - curative-leaves-in-parallel: 6 \ No newline at end of file + do-not-optimize-curative-cnecs-for-tsos-without-cras: false \ No newline at end of file diff --git a/ra-optimisation/search-tree-rao/pom.xml b/ra-optimisation/search-tree-rao/pom.xml index 0b5050f2f7..25c86fefee 100644 --- a/ra-optimisation/search-tree-rao/pom.xml +++ b/ra-optimisation/search-tree-rao/pom.xml @@ -103,6 +103,11 @@ junit-jupiter test + + org.junit.platform + junit-platform-launcher + test + org.mockito mockito-core 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 718848b87c..00b2e08c3b 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 @@ -56,6 +56,8 @@ import static com.powsybl.openrao.commons.Unit.MEGAWATT; import static com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider.*; +import static com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters.getLoadFlowProvider; +import static com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters.getSensitivityWithLoadFlowParameters; import static com.powsybl.openrao.searchtreerao.commons.RaoUtil.applyRemedialActions; /** @@ -83,7 +85,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; @@ -106,7 +108,7 @@ AutomatonPerimeterResultImpl simulateAutomatonState(State automatonState, Set> disableHvdcAngleDroopActi } TECHNICAL_LOGS.debug("Running load-flow computation to access HvdcAngleDroopActivePowerControl set-point values."); - Map controls = computeHvdcAngleDroopActivePowerControlValues(network, automatonState, raoParameters.getLoadFlowAndSensitivityParameters().getLoadFlowProvider(), raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters()); + Map controls = computeHvdcAngleDroopActivePowerControlValues(network, automatonState, getLoadFlowProvider(raoParameters), getSensitivityWithLoadFlowParameters(raoParameters).getLoadFlowParameters()); // Next, disable AngleDroopActivePowerControl on HVDCs and set their active power set-points to the value // previously computed by the AngleDroopActivePowerControl. @@ -502,7 +504,7 @@ Pair> disableHvdcAngleDroopActi // Finally, run a sensitivity analysis to get sensitivity values in DC set-point mode if needed TECHNICAL_LOGS.info("Running sensitivity analysis after disabling AngleDroopActivePowerControl on HVDC RAs."); PrePerimeterResult result = preAutoPerimeterSensitivityAnalysis.runBasedOnInitialResults(network, crac, initialFlowResult, operatorsNotSharingCras, null); - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, result, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), numberLoggedElementsDuringRao); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, result, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), raoParameters.getObjectiveFunctionParameters().getUnit(), numberLoggedElementsDuringRao); return Pair.of(result, activePowerSetpoints); } @@ -658,7 +660,7 @@ RangeAutomatonSimulationResult shiftRangeActionsUntilFlowCnecsSecure(List optimizeContingencyScenarios(Network netwo // Create an automaton simulator AutomatonSimulator automatonSimulator = new AutomatonSimulator(crac, raoParameters, toolProvider, initialSensitivityOutput, prePerimeterSensitivityOutput, stateTree.getOperatorsNotSharingCras(), NUMBER_LOGGED_ELEMENTS_DURING_RAO); // Go through all contingency scenarios - try (AbstractNetworkPool networkPool = AbstractNetworkPool.create(network, newVariant, raoParameters.getMultithreadingParameters().getContingencyScenariosInParallel(), true)) { + try (AbstractNetworkPool networkPool = AbstractNetworkPool.create(network, newVariant, getAvailableCPUs(raoParameters), true)) { AtomicInteger remainingScenarios = new AtomicInteger(stateTree.getContingencyScenarios().size()); List> tasks = stateTree.getContingencyScenarios().stream().map(optimizedScenario -> networkPool.submit(() -> runScenario(prePerimeterSensitivityOutput, automatonsOnly, optimizedScenario, networkPool, automatonSimulator, contingencyScenarioResults, remainingScenarios)) @@ -112,7 +114,7 @@ private Object runScenario(PrePerimeterResult prePerimeterSensitivityOutput, boo Set curativeStates = new HashSet<>(); optimizedScenario.getCurativePerimeters().forEach(perimeter -> curativeStates.addAll(perimeter.getAllStates())); PrePerimeterResult preCurativeResult = prePerimeterSensitivityOutput; - double sensitivityFailureOvercost = raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityFailureOvercost(); + double sensitivityFailureOvercost = getSensitivityFailureOvercost(raoParameters); // Simulate automaton instant boolean autoStateSensiFailed = false; diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java index 015e2f159d..9414ac3fde 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimization.java @@ -125,9 +125,6 @@ public CompletableFuture run() { currentStep = "post-PRA sensitivity analysis"; // mutualise the pre-perimeter sensi analysis for all contingency scenario + get after-PRA result over all CNECs - double preventiveOptimalCost = preventiveResult.getCost(); - TreeParameters automatonTreeParameters = TreeParameters.buildForAutomatonPerimeter(raoParameters); - TreeParameters curativeTreeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, preventiveOptimalCost); network.getVariantManager().setWorkingVariant(INITIAL_SCENARIO); network.getVariantManager().cloneVariant(network.getVariantManager().getWorkingVariantId(), PREVENTIVE_SCENARIO, true); network.getVariantManager().setWorkingVariant(PREVENTIVE_SCENARIO); @@ -153,16 +150,19 @@ public CompletableFuture run() { // If stop criterion is SECURE and preventive perimeter was not secure, do not run post-contingency RAOs // (however RAO could continue depending on parameter optimize-curative-if-basecase-unsecure) + double preventiveOptimalCost = preventiveResult.getCost(); if (shouldStopOptimisationIfPreventiveUnsecure(preventiveOptimalCost)) { 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, raoParameters.getObjectiveFunctionParameters()); // 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()); } BUSINESS_LOGS.info("----- Post-contingency perimeters optimization [start]"); + TreeParameters automatonTreeParameters = TreeParameters.buildForAutomatonPerimeter(raoParameters); + TreeParameters curativeTreeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, preventiveOptimalCost); CastorContingencyScenarios castorContingencyScenarios = new CastorContingencyScenarios(crac, raoParameters, toolProvider, stateTree, automatonTreeParameters, curativeTreeParameters, initialOutput); Map postContingencyResults = castorContingencyScenarios.optimizeContingencyScenarios(network, preCurativeSensitivityAnalysisOutput, false); BUSINESS_LOGS.info("----- Post-contingency perimeters optimization [end]"); @@ -186,7 +186,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()); @@ -197,7 +197,7 @@ public CompletableFuture run() { } private boolean shouldStopOptimisationIfPreventiveUnsecure(double preventiveOptimalCost) { - return raoParameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE) + return raoParameters.getObjectiveFunctionParameters().getType().equals(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW) && preventiveOptimalCost > 0 && !raoParameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity(); } @@ -245,7 +245,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 f3f3fe209d..2d1099e4bd 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 @@ -24,7 +24,7 @@ import com.powsybl.openrao.data.raoresult.api.RaoResult; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.SecondPreventiveRaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SecondPreventiveRaoParameters; import com.powsybl.openrao.searchtreerao.commons.NetworkActionCombination; import com.powsybl.openrao.searchtreerao.commons.RaoLogger; import com.powsybl.openrao.searchtreerao.commons.ToolProvider; @@ -47,6 +47,9 @@ import static com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider.*; import static com.powsybl.openrao.data.crac.api.range.RangeType.RELATIVE_TO_PREVIOUS_INSTANT; import static com.powsybl.openrao.data.raoresult.api.ComputationStatus.FAILURE; +import static com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters.getSensitivityFailureOvercost; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoObjectiveFunctionParameters.getCurativeMinObjImprovement; +import static com.powsybl.openrao.raoapi.parameters.extensions.SecondPreventiveRaoParameters.*; /** * @author Joris Mancini {@literal } @@ -87,22 +90,22 @@ public CastorSecondPreventive(Crac crac, */ boolean shouldRunSecondPreventiveRao(OptimizationResult firstPreventiveResult, Collection curativeRaoResults, RaoResult postFirstRaoResult, long estimatedPreventiveRaoTimeInSeconds) { Instant lastCurativeInstant = crac.getLastInstant(); - if (raoParameters.getSecondPreventiveRaoParameters().getExecutionCondition().equals(SecondPreventiveRaoParameters.ExecutionCondition.DISABLED)) { + if (getSecondPreventiveExecutionCondition(raoParameters).equals(SecondPreventiveRaoParameters.ExecutionCondition.DISABLED)) { return false; } if (!Objects.isNull(targetEndInstant) && ChronoUnit.SECONDS.between(java.time.Instant.now(), targetEndInstant) < estimatedPreventiveRaoTimeInSeconds) { BUSINESS_LOGS.info("There is not enough time to run a 2nd preventive RAO (target end time: {}, estimated time needed based on first preventive RAO: {} seconds)", targetEndInstant, estimatedPreventiveRaoTimeInSeconds); return false; } - if (raoParameters.getSecondPreventiveRaoParameters().getExecutionCondition().equals(SecondPreventiveRaoParameters.ExecutionCondition.COST_INCREASE) + if (getSecondPreventiveExecutionCondition(raoParameters).equals(SecondPreventiveRaoParameters.ExecutionCondition.COST_INCREASE) && postFirstRaoResult.getCost(lastCurativeInstant) <= postFirstRaoResult.getCost(null)) { BUSINESS_LOGS.info("Cost has not increased during RAO, there is no need to run a 2nd preventive RAO."); // it is not necessary to compare initial & post-preventive costs since the preventive RAO cannot increase its own cost // only compare initial cost with the curative costs return false; } - ObjectiveFunctionParameters.PreventiveStopCriterion preventiveStopCriterion = raoParameters.getObjectiveFunctionParameters().getPreventiveStopCriterion(); - if (preventiveStopCriterion.equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE)) { + ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunctionType = raoParameters.getObjectiveFunctionParameters().getType(); + if (objectiveFunctionType.equals(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW)) { if (firstPreventiveResult.getCost() > 0) { // in case of curative optimization even if preventive unsecure (see parameter enforce-curative-security) // we do not want to run a second preventive that would not be able to fix the situation, to save time @@ -111,9 +114,9 @@ boolean shouldRunSecondPreventiveRao(OptimizationResult firstPreventiveResult, C } // Run 2nd preventive RAO if one perimeter of the curative optimization is unsecure return isAnyResultUnsecure(curativeRaoResults); - } else { // MIN_OBJECTIVE + } else { // MIN OBJECTIVE // Run 2nd preventive RAO if the final result has a worse cost than the preventive perimeter - return isFinalCostWorseThanPreventive(raoParameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), firstPreventiveResult, postFirstRaoResult, lastCurativeInstant); + return isFinalCostWorseThanPreventive(getCurativeMinObjImprovement(raoParameters), firstPreventiveResult, postFirstRaoResult, lastCurativeInstant); } } @@ -160,7 +163,7 @@ RaoResult runSecondPreventiveAndAutoRao(CastorContingencyScenarios castorConting // ------ appliedCras from secondPreventiveRaoResult AppliedRemedialActions appliedArasAndCras = secondPreventiveRaoResult.appliedArasAndCras().copyCurative(); // ------ + curative range actions optimized during second preventive with global optimization - if (raoParameters.getSecondPreventiveRaoParameters().getReOptimizeCurativeRangeActions()) { + if (getSecondPreventiveReOptimizeCurativeRangeActions(raoParameters)) { for (Map.Entry entry : postContingencyResults.entrySet()) { State state = entry.getKey(); if (!state.getInstant().isCurative()) { @@ -194,12 +197,12 @@ RaoResult runSecondPreventiveAndAutoRao(CastorContingencyScenarios castorConting // Specific case : curative state was previously skipped because it led to a sensitivity analysis failure. // Curative state is still a SkippedOptimizationResultImpl, but its computation status must be updated if (entry.getValue() instanceof SkippedOptimizationResultImpl) { - newPostContingencyResults.put(state, new SkippedOptimizationResultImpl(state, new HashSet<>(), new HashSet<>(), postCraSensitivityAnalysisOutput.getSensitivityStatus(entry.getKey()), raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityFailureOvercost())); + newPostContingencyResults.put(state, new SkippedOptimizationResultImpl(state, new HashSet<>(), new HashSet<>(), postCraSensitivityAnalysisOutput.getSensitivityStatus(entry.getKey()), getSensitivityFailureOvercost(raoParameters))); } else { newPostContingencyResults.put(state, new CurativeWithSecondPraoResult(state, entry.getValue(), secondPreventiveRaoResult.perimeterResult(), secondPreventiveRaoResult.remedialActionsExcluded(), postCraSensitivityAnalysisOutput, raoParameters.getObjectiveFunctionParameters().getType().costOptimization())); } } - 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, @@ -246,7 +249,7 @@ private SecondPreventiveRaoResult runSecondPreventiveRao(PrePerimeterSensitivity // that the optimal setpoints of the curative results stay coherent with their allowed range and close to // optimality in their perimeters. These range actions will be excluded from 2nd preventive RAO. Set> remedialActionsExcluded = new HashSet<>(); - if (!raoParameters.getSecondPreventiveRaoParameters().getReOptimizeCurativeRangeActions()) { // keep old behaviour + if (!getSecondPreventiveReOptimizeCurativeRangeActions(raoParameters)) { // keep old behaviour remedialActionsExcluded = new HashSet<>(getRangeActionsExcludedFromSecondPreventive(firstPreventiveResult, postContingencyResults)); applyPreventiveResultsForAutoOrCurativeRangeActions(firstPreventiveResult); addAppliedRangeActionsPostContingency(crac.getInstants(InstantKind.CURATIVE), appliedArasAndCras, postContingencyResults); @@ -322,7 +325,7 @@ private CompletableFuture optimizeSecondPreventivePer State preventiveState = crac.getPreventiveState(); Set> excludedRangeActions = getRangeActionsExcludedFromSecondPreventive(firstPreventiveResult, postContingencyResults); - if (raoParameters.getSecondPreventiveRaoParameters().getReOptimizeCurativeRangeActions()) { + if (getSecondPreventiveReOptimizeCurativeRangeActions(raoParameters)) { optPerimeter = GlobalOptimizationPerimeter.build(crac, network, raoParameters, prePerimeterResult); } else { Set> rangeActionsFor2p = new HashSet<>(crac.getRangeActions()); @@ -340,13 +343,13 @@ private CompletableFuture optimizeSecondPreventivePer .build(); // update RaUsageLimits with already applied RangeActions - if (!raoParameters.getSecondPreventiveRaoParameters().getReOptimizeCurativeRangeActions() && searchTreeParameters.getRaLimitationParameters().containsKey(preventiveInstant)) { + if (!getSecondPreventiveReOptimizeCurativeRangeActions(raoParameters) && searchTreeParameters.getRaLimitationParameters().containsKey(preventiveInstant)) { Set> activatedPreventiveRangeActions = firstPreventiveResult.getActivatedRangeActions(preventiveState); Set> excludedActivatedRangeActions = excludedRangeActions.stream().filter(activatedPreventiveRangeActions::contains).collect(Collectors.toSet()); searchTreeParameters.setRaLimitationsForSecondPreventive(searchTreeParameters.getRaLimitationParameters().get(preventiveInstant), excludedActivatedRangeActions, preventiveInstant); } - if (raoParameters.getSecondPreventiveRaoParameters().getHintFromFirstPreventiveRao()) { + if (getSecondPreventiveHintFromFirstPreventiveRao(raoParameters)) { // Set the optimal set of network actions decided in 1st preventive RAO as a hint for 2nd preventive RAO searchTreeParameters.getNetworkActionParameters().addNetworkActionCombination(new NetworkActionCombination(firstPreventiveResult.getActivatedNetworkActions(), true)); } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysis.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysis.java index 51396186ba..5343529ae2 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysis.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/PrePerimeterSensitivityAnalysis.java @@ -6,13 +6,13 @@ */ package com.powsybl.openrao.searchtreerao.castor.algorithm; +import com.powsybl.openrao.commons.OpenRaoException; import com.powsybl.openrao.data.crac.api.Crac; import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; import com.powsybl.openrao.searchtreerao.result.api.*; import com.powsybl.openrao.searchtreerao.result.impl.PrePerimeterSensitivityResultImpl; import com.powsybl.openrao.searchtreerao.commons.SensitivityComputer; @@ -23,8 +23,11 @@ import com.powsybl.openrao.sensitivityanalysis.AppliedRemedialActions; import com.powsybl.iidm.network.Network; +import java.util.Objects; import java.util.Set; +import static java.lang.String.format; + /** * This class aims at performing the sensitivity analysis before the optimization of a perimeter. At these specific * instants we actually want to compute all the results on the network. They will be useful either for the optimization @@ -61,7 +64,7 @@ public PrePerimeterResult runInitialSensitivityAnalysis(Network network, Crac cr public PrePerimeterResult runInitialSensitivityAnalysis(Network network, Crac crac, Set optimizedStates) { SensitivityComputer.SensitivityComputerBuilder sensitivityComputerBuilder = buildSensiBuilder() .withOutageInstant(crac.getOutageInstant()); - if (raoParameters.hasExtension(LoopFlowParametersExtension.class)) { + if (raoParameters.getLoopFlowParameters().isPresent()) { sensitivityComputerBuilder.withCommercialFlowsResults(toolProvider.getLoopFlowComputation(), toolProvider.getLoopFlowCnecs(flowCnecs)); } if (raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) { @@ -82,15 +85,21 @@ public PrePerimeterResult runBasedOnInitialResults(Network network, SensitivityComputer.SensitivityComputerBuilder sensitivityComputerBuilder = buildSensiBuilder() .withOutageInstant(crac.getOutageInstant()); - if (raoParameters.hasExtension(LoopFlowParametersExtension.class)) { - if (raoParameters.getExtension(LoopFlowParametersExtension.class).getPtdfApproximation().shouldUpdatePtdfWithTopologicalChange()) { - sensitivityComputerBuilder.withCommercialFlowsResults(toolProvider.getLoopFlowComputation(), toolProvider.getLoopFlowCnecs(flowCnecs)); - } else { - sensitivityComputerBuilder.withCommercialFlowsResults(initialFlowResult); - } + OpenRaoSearchTreeParameters searchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); + if (!Objects.isNull(searchTreeParameters)) { + searchTreeParameters.getLoopFlowParameters().ifPresent(loopFlowParameters -> { + if (loopFlowParameters.getPtdfApproximation().shouldUpdatePtdfWithTopologicalChange()) { + sensitivityComputerBuilder.withCommercialFlowsResults(toolProvider.getLoopFlowComputation(), toolProvider.getLoopFlowCnecs(flowCnecs)); + } else { + sensitivityComputerBuilder.withCommercialFlowsResults(initialFlowResult); + } + }); } if (raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) { - if (raoParameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfApproximation().shouldUpdatePtdfWithTopologicalChange()) { + if (Objects.isNull(searchTreeParameters)) { + throw new OpenRaoException(format("Objective function %s requires an extension with relative margins parameters", raoParameters.getObjectiveFunctionParameters().getType())); + } + if (searchTreeParameters.getRelativeMarginsParameters().orElseThrow().getPtdfApproximation().shouldUpdatePtdfWithTopologicalChange()) { sensitivityComputerBuilder.withPtdfsResults(toolProvider.getAbsolutePtdfSumsComputation(), flowCnecs); } else { sensitivityComputerBuilder.withPtdfsResults(initialFlowResult); 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 1c9dc61516..40bdcb1d58 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 @@ -67,6 +67,7 @@ public static void logSensitivityAnalysisResults(String prefix, RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, sensitivityAnalysisResult, raoParameters.getObjectiveFunctionParameters().getType(), + raoParameters.getObjectiveFunctionParameters().getUnit(), numberOfLoggedLimitingElements); } @@ -93,16 +94,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, @@ -110,8 +111,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); } @@ -119,9 +121,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); @@ -133,7 +135,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, @@ -150,11 +152,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); @@ -167,8 +169,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); } @@ -177,9 +180,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..1305c9c265 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 @@ -7,6 +7,8 @@ package com.powsybl.openrao.searchtreerao.commons; +import com.powsybl.iidm.network.Network; +import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.commons.OpenRaoException; import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider; @@ -14,7 +16,6 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.cnec.Cnec; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; -import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.data.crac.api.usagerule.OnConstraint; import com.powsybl.openrao.data.crac.api.usagerule.OnContingencyState; @@ -24,13 +25,11 @@ import com.powsybl.openrao.data.crac.api.usagerule.UsageRule; import com.powsybl.openrao.data.refprog.referenceprogram.ReferenceProgramBuilder; import com.powsybl.openrao.raoapi.RaoInput; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.PstModel; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; -import com.powsybl.openrao.searchtreerao.result.api.*; -import com.powsybl.iidm.network.Network; +import com.powsybl.openrao.searchtreerao.result.api.FlowResult; +import com.powsybl.openrao.searchtreerao.result.api.OptimizationResult; import org.apache.commons.lang3.tuple.Pair; import java.util.Objects; @@ -38,6 +37,9 @@ import java.util.Set; import java.util.stream.Collectors; +import static com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters.getLoadFlowProvider; +import static com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters.getSensitivityWithLoadFlowParameters; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.getPstModel; import static java.lang.String.format; /** @@ -57,28 +59,28 @@ public static void initNetwork(Network network, String networkVariantId) { } public static void checkParameters(RaoParameters raoParameters, RaoInput raoInput) { - if (raoParameters.getObjectiveFunctionParameters().getType().getUnit().equals(Unit.AMPERE) - && raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().isDc()) { - throw new OpenRaoException(format("Objective function %s cannot be calculated with a DC default sensitivity engine", raoParameters.getObjectiveFunctionParameters().getType().toString())); + if (raoParameters.getObjectiveFunctionParameters().getUnit().equals(Unit.AMPERE) + && getSensitivityWithLoadFlowParameters(raoParameters).getLoadFlowParameters().isDc()) { + 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()) { if (raoInput.getGlskProvider() == null) { throw new OpenRaoException(format("Objective function %s requires glsks", raoParameters.getObjectiveFunctionParameters().getType())); } - if (!raoParameters.hasExtension(RelativeMarginsParametersExtension.class) || raoParameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().isEmpty()) { + if (raoParameters.getRelativeMarginsParameters().map(relativeMarginsParameters -> relativeMarginsParameters.getPtdfBoundaries().isEmpty()).orElse(true)) { throw new OpenRaoException(format("Objective function %s requires a config with a non empty boundary set", raoParameters.getObjectiveFunctionParameters().getType())); } } - if ((raoParameters.hasExtension(LoopFlowParametersExtension.class) + if ((raoParameters.getLoopFlowParameters().isPresent() || raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) && (Objects.isNull(raoInput.getReferenceProgram()))) { OpenRaoLoggerProvider.BUSINESS_WARNS.warn("No ReferenceProgram provided. A ReferenceProgram will be generated using information in the network file."); - raoInput.setReferenceProgram(ReferenceProgramBuilder.buildReferenceProgram(raoInput.getNetwork(), raoParameters.getLoadFlowAndSensitivityParameters().getLoadFlowProvider(), raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters())); + raoInput.setReferenceProgram(ReferenceProgramBuilder.buildReferenceProgram(raoInput.getNetwork(), getLoadFlowProvider(raoParameters), getSensitivityWithLoadFlowParameters(raoParameters).getLoadFlowParameters())); } - if (raoParameters.hasExtension(LoopFlowParametersExtension.class) && (Objects.isNull(raoInput.getReferenceProgram()) || Objects.isNull(raoInput.getGlskProvider()))) { + if (raoParameters.getLoopFlowParameters().isPresent() && (Objects.isNull(raoInput.getReferenceProgram()) || Objects.isNull(raoInput.getGlskProvider()))) { String msg = format( "Loopflow computation cannot be performed on CRAC %s because it lacks a ReferenceProgram or a GlskProvider", raoInput.getCrac().getId()); @@ -86,7 +88,7 @@ public static void checkParameters(RaoParameters raoParameters, RaoInput raoInpu throw new OpenRaoException(msg); } - if (!RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS.equals(raoParameters.getRangeActionsOptimizationParameters().getPstModel()) + if (!PstModel.APPROXIMATED_INTEGERS.equals(getPstModel(raoParameters)) && raoInput.getCrac().getRaUsageLimitsPerInstant().values().stream().anyMatch(raUsageLimits -> !raUsageLimits.getMaxElementaryActionsPerTso().isEmpty())) { String msg = "The PSTs must be approximated as integers to use the limitations of elementary actions as a constraint in the RAO."; OpenRaoLoggerProvider.BUSINESS_LOGS.error(msg); @@ -170,7 +172,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/ToolProvider.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/ToolProvider.java index e19100e717..2acda4cfb5 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/ToolProvider.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/ToolProvider.java @@ -19,8 +19,8 @@ import com.powsybl.openrao.loopflowcomputation.LoopFlowComputationImpl; import com.powsybl.openrao.raoapi.RaoInput; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters; import com.powsybl.openrao.sensitivityanalysis.AppliedRemedialActions; import com.powsybl.openrao.sensitivityanalysis.SystematicSensitivityInterface; import com.powsybl.glsk.commons.ZonalData; @@ -32,6 +32,9 @@ import java.util.*; import java.util.stream.Collectors; +import static com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters.getSensitivityProvider; +import static com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters.getSensitivityWithLoadFlowParameters; + /** * @author Joris Mancini {@literal } */ @@ -60,10 +63,10 @@ private boolean hasLoopFlowExtension(FlowCnec cnec) { } public Set getLoopFlowCnecs(Set allCnecs) { - LoopFlowParametersExtension loopFlowParameters = raoParameters.getExtension(LoopFlowParametersExtension.class); - if (raoParameters.hasExtension(LoopFlowParametersExtension.class) && !loopFlowParameters.getCountries().isEmpty()) { + Optional loopFlowParametersOptional = raoParameters.getLoopFlowParameters(); + if (loopFlowParametersOptional.isPresent() && !loopFlowParametersOptional.get().getCountries().isEmpty()) { return allCnecs.stream() - .filter(cnec -> hasLoopFlowExtension(cnec) && cnecIsInCountryList(cnec, network, loopFlowParameters.getCountries())) + .filter(cnec -> hasLoopFlowExtension(cnec) && cnecIsInCountryList(cnec, network, loopFlowParametersOptional.get().getCountries())) .collect(Collectors.toSet()); } else { return allCnecs.stream() @@ -91,13 +94,13 @@ public SystematicSensitivityInterface getSystematicSensitivityInterface(Set getEicForObjectiveFunction() { - if (!raoParameters.hasExtension(RelativeMarginsParametersExtension.class)) { + Optional optionalRelativeMarginsParameters = raoParameters.getRelativeMarginsParameters(); + if (optionalRelativeMarginsParameters.isEmpty()) { throw new OpenRaoException("No relative margins parameters were defined"); } - return raoParameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries().stream(). + return optionalRelativeMarginsParameters.get().getPtdfBoundaries().stream(). flatMap(boundary -> boundary.getEiCodes().stream()). map(EICode::getAreaCode). collect(Collectors.toSet()); @@ -211,14 +215,15 @@ public static ToolProvider buildFromRaoInputAndParameters(RaoInput raoInput, Rao ); } if (raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) { - if (!raoParameters.hasExtension(RelativeMarginsParametersExtension.class)) { + Optional optionalRelativeMarginsParameters = raoParameters.getRelativeMarginsParameters(); + if (optionalRelativeMarginsParameters.isEmpty()) { throw new OpenRaoException("No relative margins parameters were defined with objective function " + raoParameters.getObjectiveFunctionParameters().getType()); } toolProviderBuilder.withAbsolutePtdfSumsComputation( raoInput.getGlskProvider(), new AbsolutePtdfSumsComputation( raoInput.getGlskProvider(), - raoParameters.getExtension(RelativeMarginsParametersExtension.class).getPtdfBoundaries() + optionalRelativeMarginsParameters.get().getPtdfBoundaries() ) ); } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/AbstractObjectiveFunctionCreator.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/AbstractObjectiveFunctionCreator.java index c2d7868389..315987a7ea 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/AbstractObjectiveFunctionCreator.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/AbstractObjectiveFunctionCreator.java @@ -34,7 +34,7 @@ protected AbstractObjectiveFunctionCreator(Set flowCnecs, Set o this.flowCnecs = flowCnecs; this.optimizedStates = optimizedStates; this.raoParameters = raoParameters; - this.unit = raoParameters.getObjectiveFunctionParameters().getType().getUnit(); + this.unit = raoParameters.getObjectiveFunctionParameters().getUnit(); } protected MarginEvaluator getMarginEvaluator() { diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/InitialSensitivityAnalysisObjectiveFunctionCreator.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/InitialSensitivityAnalysisObjectiveFunctionCreator.java index f923b186cd..2a1e702325 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/InitialSensitivityAnalysisObjectiveFunctionCreator.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/InitialSensitivityAnalysisObjectiveFunctionCreator.java @@ -10,6 +10,7 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters; import com.powsybl.openrao.searchtreerao.commons.marginevaluator.MarginEvaluator; import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.CostEvaluator; import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.MinMarginViolationEvaluator; @@ -38,8 +39,8 @@ protected List getVirtualCostEvaluators(MarginEvaluator marginEva // sensitivity failure over-cost should be computed on initial sensitivity result too // (this allows the RAO to prefer RAs that can remove sensitivity failures) - if (raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityFailureOvercost() > 0) { - virtualCostEvaluators.add(new SensitivityFailureOvercostEvaluator(flowCnecs, raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityFailureOvercost())); + if (LoadFlowAndSensitivityParameters.getSensitivityFailureOvercost(raoParameters) > 0) { + virtualCostEvaluators.add(new SensitivityFailureOvercostEvaluator(flowCnecs, LoadFlowAndSensitivityParameters.getSensitivityFailureOvercost(raoParameters))); } return virtualCostEvaluators; diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/ObjectiveFunctionCreator.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/ObjectiveFunctionCreator.java index 428e4e218d..5a97a3e284 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/ObjectiveFunctionCreator.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/ObjectiveFunctionCreator.java @@ -10,20 +10,21 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.cnec.Cnec; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.MnecParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoMnecParameters; import com.powsybl.openrao.searchtreerao.commons.marginevaluator.MarginEvaluator; import com.powsybl.openrao.searchtreerao.commons.marginevaluator.MarginEvaluatorWithMarginDecreaseUnoptimizedCnecs; -import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.CostEvaluator; -import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.LoopFlowViolationCostEvaluator; -import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.MinMarginViolationEvaluator; -import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.MnecViolationCostEvaluator; -import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.SensitivityFailureOvercostEvaluator; +import com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator.*; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -58,29 +59,41 @@ protected List getVirtualCostEvaluators(MarginEvaluator marginEva virtualCostEvaluators.add(new MinMarginViolationEvaluator(flowCnecs, unit, marginEvaluator)); } + OpenRaoSearchTreeParameters openRaoSearchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); + // mnec virtual cost evaluator - if (raoParameters.hasExtension(MnecParametersExtension.class)) { - virtualCostEvaluators.add(new MnecViolationCostEvaluator( - flowCnecs.stream().filter(Cnec::isMonitored).collect(Collectors.toSet()), - raoParameters.getObjectiveFunctionParameters().getType().getUnit(), - initialFlowResult, - raoParameters.getExtension(MnecParametersExtension.class) - )); + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + Optional mnecParametersOptional = raoParameters.getMnecParameters(); + Optional mnecParametersExtensionOptional = raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getMnecParameters(); + if (mnecParametersOptional.isPresent() && mnecParametersExtensionOptional.isPresent()) { + virtualCostEvaluators.add(new MnecViolationCostEvaluator( + flowCnecs.stream().filter(Cnec::isMonitored).collect(Collectors.toSet()), + raoParameters.getObjectiveFunctionParameters().getUnit(), + initialFlowResult, + mnecParametersOptional.get().getAcceptableMarginDecrease(), + mnecParametersExtensionOptional.get().getViolationCost() + )); + } } // loop-flow virtual cost evaluator - if (raoParameters.hasExtension(LoopFlowParametersExtension.class)) { - virtualCostEvaluators.add(new LoopFlowViolationCostEvaluator( - loopFlowCnecs, - initialFlowResult, - raoParameters.getExtension(LoopFlowParametersExtension.class) - )); + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + Optional loopFlowParametersOptional = raoParameters.getLoopFlowParameters(); + Optional loopFlowParametersExtensionOptional = raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getLoopFlowParameters(); + if (loopFlowParametersOptional.isPresent() && loopFlowParametersExtensionOptional.isPresent()) { + virtualCostEvaluators.add(new LoopFlowViolationCostEvaluator( + loopFlowCnecs, + initialFlowResult, + loopFlowParametersOptional.get().getAcceptableIncrease(), + loopFlowParametersExtensionOptional.get().getViolationCost() + )); + } } // If sensi failed, create a high virtual cost via SensitivityFailureOvercostEvaluator // to ensure that corresponding leaf is not selected - if (raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityFailureOvercost() > 0) { - virtualCostEvaluators.add(new SensitivityFailureOvercostEvaluator(flowCnecs, raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityFailureOvercost())); + if (LoadFlowAndSensitivityParameters.getSensitivityFailureOvercost(raoParameters) > 0) { + virtualCostEvaluators.add(new SensitivityFailureOvercostEvaluator(flowCnecs, LoadFlowAndSensitivityParameters.getSensitivityFailureOvercost(raoParameters))); } return virtualCostEvaluators; diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluator.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluator.java index 86020a19a4..2739e79d40 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluator.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluator.java @@ -12,7 +12,6 @@ import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.loopflowextension.LoopFlowThreshold; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.openrao.searchtreerao.commons.costevaluatorresult.CostEvaluatorResult; import com.powsybl.openrao.searchtreerao.commons.costevaluatorresult.SumCostEvaluatorResult; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; @@ -37,11 +36,11 @@ public class LoopFlowViolationCostEvaluator implements CostEvaluator { public LoopFlowViolationCostEvaluator(Set loopflowCnecs, FlowResult initialLoopFlowResult, - LoopFlowParametersExtension loopFlowParameters) { + double loopFlowAcceptableAugmentation, double loopFlowViolationCost) { this.loopflowCnecs = loopflowCnecs; this.initialLoopFlowResult = initialLoopFlowResult; - this.loopFlowViolationCost = loopFlowParameters.getViolationCost(); - this.loopFlowAcceptableAugmentation = loopFlowParameters.getAcceptableIncrease(); + this.loopFlowViolationCost = loopFlowViolationCost; + this.loopFlowAcceptableAugmentation = loopFlowAcceptableAugmentation; } @Override diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluator.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluator.java index 84cd311e39..210043a4cc 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluator.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluator.java @@ -11,7 +11,6 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.cnec.Cnec; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; import com.powsybl.openrao.searchtreerao.commons.costevaluatorresult.CostEvaluatorResult; import com.powsybl.openrao.searchtreerao.commons.costevaluatorresult.SumCostEvaluatorResult; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; @@ -38,12 +37,12 @@ public class MnecViolationCostEvaluator implements CostEvaluator { private final double mnecAcceptableMarginDecrease; private final double mnecViolationCost; - public MnecViolationCostEvaluator(Set flowCnecs, Unit unit, FlowResult initialFlowResult, MnecParametersExtension mnecParametersExtension) { + public MnecViolationCostEvaluator(Set flowCnecs, Unit unit, FlowResult initialFlowResult, double mnecAcceptableMarginDecrease, double mnecViolationCost) { this.flowCnecs = flowCnecs; this.unit = unit; this.initialFlowResult = initialFlowResult; - this.mnecAcceptableMarginDecrease = mnecParametersExtension.getAcceptableMarginDecrease(); - this.mnecViolationCost = mnecParametersExtension.getViolationCost(); + this.mnecAcceptableMarginDecrease = mnecAcceptableMarginDecrease; + this.mnecViolationCost = mnecViolationCost; } @Override diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/AbstractOptimizationPerimeter.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/AbstractOptimizationPerimeter.java index d9769298ee..fa333d0c1a 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/AbstractOptimizationPerimeter.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/AbstractOptimizationPerimeter.java @@ -14,7 +14,6 @@ import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.data.crac.loopflowextension.LoopFlowThreshold; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.openrao.searchtreerao.result.api.RangeActionSetpointResult; import com.powsybl.iidm.network.Network; @@ -120,21 +119,21 @@ public Set> getRangeActions() { } public static Set getLoopFlowCnecs(Set flowCnecs, RaoParameters raoParameters, Network network) { - if (raoParameters.hasExtension(LoopFlowParametersExtension.class) - && !raoParameters.getExtension(LoopFlowParametersExtension.class).getCountries().isEmpty()) { - // loopFlow limited, and set of country for which loop-flow are monitored is defined - return flowCnecs.stream() - .filter(cnec -> !Objects.isNull(cnec.getExtension(LoopFlowThreshold.class)) && - cnec.getLocation(network).stream().anyMatch(country -> country.isPresent() && raoParameters.getExtension(LoopFlowParametersExtension.class).getCountries().contains(country.get()))) - .collect(Collectors.toSet()); - } else if (raoParameters.hasExtension(LoopFlowParametersExtension.class)) { - - // loopFlow limited, but no set of country defined - return flowCnecs.stream() - .filter(cnec -> !Objects.isNull(cnec.getExtension(LoopFlowThreshold.class))) - .collect(Collectors.toSet()); + Optional loopFlowParametersOptional = raoParameters.getLoopFlowParameters(); + if (loopFlowParametersOptional.isPresent()) { + if (!loopFlowParametersOptional.get().getCountries().isEmpty()) { + // loopFlow limited, and set of country for which loop-flow are monitored is defined + return flowCnecs.stream() + .filter(cnec -> !Objects.isNull(cnec.getExtension(LoopFlowThreshold.class)) && + cnec.getLocation(network).stream().anyMatch(country -> country.isPresent() && loopFlowParametersOptional.get().getCountries().contains(country.get()))) + .collect(Collectors.toSet()); + } else { + // loopFlow limited, but no set of country defined + return flowCnecs.stream() + .filter(cnec -> !Objects.isNull(cnec.getExtension(LoopFlowThreshold.class))) + .collect(Collectors.toSet()); + } } else { - //no loopFLow limitation return Collections.emptySet(); } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/NetworkActionParameters.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/NetworkActionParameters.java index cfe713b94c..020704250c 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/NetworkActionParameters.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/NetworkActionParameters.java @@ -8,12 +8,14 @@ import com.powsybl.openrao.data.crac.api.Crac; import com.powsybl.openrao.data.crac.api.networkaction.NetworkAction; +import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.openrao.raoapi.parameters.TopoOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.NetworkActionCombination; import java.util.*; import static com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider.BUSINESS_WARNS; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoTopoOptimizationParameters.*; /** * @author Baptiste Seguinot {@literal } @@ -60,12 +62,13 @@ public int getMaxNumberOfBoundariesForSkippingNetworkActions() { return maxNumberOfBoundariesForSkippingNetworkActions; } - public static NetworkActionParameters buildFromRaoParameters(TopoOptimizationParameters topoOptimizationParameters, Crac crac) { - return new NetworkActionParameters(computePredefinedCombinations(crac, topoOptimizationParameters), + public static NetworkActionParameters buildFromRaoParameters(RaoParameters raoParameters, Crac crac) { + TopoOptimizationParameters topoOptimizationParameters = raoParameters.getTopoOptimizationParameters(); + return new NetworkActionParameters(computePredefinedCombinations(crac, raoParameters), topoOptimizationParameters.getAbsoluteMinImpactThreshold(), topoOptimizationParameters.getRelativeMinImpactThreshold(), - topoOptimizationParameters.getSkipActionsFarFromMostLimitingElement(), - topoOptimizationParameters.getMaxNumberOfBoundariesForSkippingActions()); + isSkipActionsFarFromMostLimitingElement(raoParameters), + getMaxNumberOfBoundariesForSkippingActions(raoParameters)); } public void addNetworkActionCombination(NetworkActionCombination networkActionCombination) { @@ -95,8 +98,8 @@ public int hashCode() { return Objects.hash(predefinedCombinations, absoluteNetworkActionMinimumImpactThreshold, relativeNetworkActionMinimumImpactThreshold, skipNetworkActionFarFromMostLimitingElements, maxNumberOfBoundariesForSkippingNetworkActions); } - public static List computePredefinedCombinations(Crac crac, TopoOptimizationParameters topoOptimizationParameters) { - List> predefinedCombinationsIds = topoOptimizationParameters.getPredefinedCombinations(); + public static List computePredefinedCombinations(Crac crac, RaoParameters raoParameters) { + List> predefinedCombinationsIds = getPredefinedCombinations(raoParameters); List computedPredefinedCombinations = new ArrayList<>(); predefinedCombinationsIds.forEach(networkActionIds -> { Optional optNaCombination = computePredefinedCombinationsFromIds(networkActionIds, crac); diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java index 256bbab297..6b9a2599c6 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java @@ -6,11 +6,15 @@ */ package com.powsybl.openrao.searchtreerao.commons.parameters; -import com.powsybl.openrao.commons.OpenRaoException; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import static com.powsybl.openrao.raoapi.parameters.extensions.MultithreadingParameters.*; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoObjectiveFunctionParameters.getCurativeMinObjImprovement; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.getRaRangeShrinking; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoTopoOptimizationParameters.*; + /** * This class contains internal Open RAO parameters used in the SearchTree algorithm. * These parameters are dynamically generated by the SearchTreeRaoProvider depending on the context and on @@ -27,70 +31,62 @@ public enum StopCriterion { } public static TreeParameters buildForPreventivePerimeter(RaoParameters parameters) { - RangeActionsOptimizationParameters.RaRangeShrinking raRangeShrinking = parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking(); - boolean shouldShrinkRaRange = raRangeShrinking.equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO) || - raRangeShrinking.equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); - switch (parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()) { - case MIN_OBJECTIVE: - return new TreeParameters(StopCriterion.MIN_OBJECTIVE, - 0.0, // value does not matter - parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), - parameters.getMultithreadingParameters().getPreventiveLeavesInParallel(), - shouldShrinkRaRange); - case SECURE: - return new TreeParameters(StopCriterion.AT_TARGET_OBJECTIVE_VALUE, - 0.0, // secure - parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), - parameters.getMultithreadingParameters().getPreventiveLeavesInParallel(), - shouldShrinkRaRange); - default: - throw new OpenRaoException("Unknown preventive stop criterion: " + parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()); + SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking raRangeShrinking = getRaRangeShrinking(parameters); + boolean shouldShrinkRaRange = raRangeShrinking.equals(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO) || + raRangeShrinking.equals(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); + if (parameters.getObjectiveFunctionParameters().getType() == ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW) { + return new TreeParameters(StopCriterion.AT_TARGET_OBJECTIVE_VALUE, + 0.0, // secure + getMaxPreventiveSearchTreeDepth(parameters), + getAvailableCPUs(parameters), + shouldShrinkRaRange); + } else { + return new TreeParameters(StopCriterion.MIN_OBJECTIVE, + 0.0, // value does not matter + getMaxPreventiveSearchTreeDepth(parameters), + getAvailableCPUs(parameters), + shouldShrinkRaRange); } } public static TreeParameters buildForAutomatonPerimeter(RaoParameters parameters) { - return new TreeParameters(StopCriterion.AT_TARGET_OBJECTIVE_VALUE, 0.0, parameters.getTopoOptimizationParameters().getMaxAutoSearchTreeDepth(), parameters.getMultithreadingParameters().getAutoLeavesInParallel(), false); + return new TreeParameters(StopCriterion.AT_TARGET_OBJECTIVE_VALUE, 0.0, getMaxAutoSearchTreeDepth(parameters), 1, false); } public static TreeParameters buildForCurativePerimeter(RaoParameters parameters, Double preventiveOptimizedCost) { StopCriterion stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; double targetObjectiveValue; - switch (parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()) { - case MIN_OBJECTIVE: - targetObjectiveValue = preventiveOptimizedCost - parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(); - if (parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()) { - targetObjectiveValue = Math.min(targetObjectiveValue, 0); - } - break; - case SECURE: - targetObjectiveValue = 0.0; - break; - default: - throw new OpenRaoException("Unknown preventive stop criterion: " + parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion()); + if (parameters.getObjectiveFunctionParameters().getType() == ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW) { + targetObjectiveValue = 0.0; + } else { + targetObjectiveValue = preventiveOptimizedCost - getCurativeMinObjImprovement(parameters); + if (parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()) { + targetObjectiveValue = Math.min(targetObjectiveValue, 0); + } } - RangeActionsOptimizationParameters.RaRangeShrinking raRangeShrinking = parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking(); - boolean shouldShrinkRaRange = raRangeShrinking.equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO) || - raRangeShrinking.equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); + SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking raRangeShrinking = getRaRangeShrinking(parameters); + boolean shouldShrinkRaRange = raRangeShrinking.equals(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO) || + raRangeShrinking.equals(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); return new TreeParameters(stopCriterion, targetObjectiveValue, - parameters.getTopoOptimizationParameters().getMaxCurativeSearchTreeDepth(), - parameters.getMultithreadingParameters().getCurativeLeavesInParallel(), + getMaxCurativeSearchTreeDepth(parameters), + 1, shouldShrinkRaRange); } public static TreeParameters buildForSecondPreventivePerimeter(RaoParameters parameters) { - boolean raRangeShrinking = parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking().equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); - if (parameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE)) { + boolean raRangeShrinking = getRaRangeShrinking(parameters).equals(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); + if (parameters.getObjectiveFunctionParameters().getType().equals(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW)) { return new TreeParameters(StopCriterion.AT_TARGET_OBJECTIVE_VALUE, 0.0, // secure - parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), - parameters.getMultithreadingParameters().getPreventiveLeavesInParallel(), + getMaxPreventiveSearchTreeDepth(parameters), + getAvailableCPUs(parameters), raRangeShrinking); } else { return new TreeParameters(StopCriterion.MIN_OBJECTIVE, 0.0, // value does not matter - parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), - parameters.getMultithreadingParameters().getPreventiveLeavesInParallel(), + getMaxPreventiveSearchTreeDepth(parameters), + getAvailableCPUs(parameters), raRangeShrinking); } } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizer.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizer.java index 59af589272..2fa5fc04e3 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizer.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/IteratingLinearOptimizer.java @@ -9,7 +9,7 @@ import com.powsybl.openrao.data.crac.api.rangeaction.PstRangeAction; import com.powsybl.openrao.data.raoresult.api.ComputationStatus; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.PstModel; import com.powsybl.openrao.searchtreerao.commons.SensitivityComputer; import com.powsybl.openrao.searchtreerao.commons.objectivefunction.ObjectiveFunction; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.GlobalOptimizationPerimeter; @@ -29,6 +29,7 @@ import java.util.Locale; import static com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider.*; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.getPstModel; /** * @author Joris Mancini {@literal } @@ -129,7 +130,7 @@ private static SensitivityComputer runSensitivityAnalysis(SensitivityComputer se private static RangeActionActivationResult resolveIfApproximatedPstTaps(IteratingLinearOptimizationResultImpl bestResult, LinearProblem linearProblem, int iteration, RangeActionActivationResult currentRangeActionActivationResult, IteratingLinearOptimizerInput input, IteratingLinearOptimizerParameters parameters) { LinearProblemStatus solveStatus; RangeActionActivationResult rangeActionActivationResult = currentRangeActionActivationResult; - if (parameters.getRangeActionParameters().getPstModel().equals(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS)) { + if (getPstModel(parameters.getRangeActionParametersExtension()).equals(PstModel.APPROXIMATED_INTEGERS)) { // if the PST approximation is APPROXIMATED_INTEGERS, we re-solve the optimization problem // but first, we update it, with an adjustment of the PSTs angleToTap conversion factors, to @@ -190,7 +191,7 @@ private static SensitivityComputer createSensitivityComputer(AppliedRemedialActi .withToolProvider(input.toolProvider()) .withOutageInstant(input.outageInstant()); - if (parameters.isRaoWithLoopFlowLimitation() && parameters.getLoopFlowParameters().getPtdfApproximation().shouldUpdatePtdfWithPstChange()) { + if (parameters.isRaoWithLoopFlowLimitation() && parameters.getLoopFlowParametersExtension().getPtdfApproximation().shouldUpdatePtdfWithPstChange()) { builder.withCommercialFlowsResults(input.toolProvider().getLoopFlowComputation(), input.optimizationPerimeter().getLoopFlowCnecs()); } else if (parameters.isRaoWithLoopFlowLimitation()) { builder.withCommercialFlowsResults(input.preOptimizationFlowResult()); @@ -244,7 +245,7 @@ private static RangeActionActivationResult roundResult(RangeActionActivationResu } private static RangeActionActivationResultImpl roundPsts(RangeActionActivationResult linearProblemResult, IteratingLinearOptimizationResultImpl previousResult, IteratingLinearOptimizerInput input, IteratingLinearOptimizerParameters parameters) { - if (parameters.getRangeActionParameters().getPstModel().equals(RangeActionsOptimizationParameters.PstModel.CONTINUOUS)) { + if (getPstModel(parameters.getRangeActionParametersExtension()).equals(PstModel.CONTINUOUS)) { return BestTapFinder.round( linearProblemResult, input.network(), diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/AbstractCoreProblemFiller.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/AbstractCoreProblemFiller.java index a5725b1eea..24779e3029 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/AbstractCoreProblemFiller.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/AbstractCoreProblemFiller.java @@ -22,6 +22,8 @@ import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.data.crac.api.rangeaction.StandardRangeAction; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.PstModel; import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblem; @@ -34,14 +36,10 @@ import org.apache.commons.lang3.NotImplementedException; import org.apache.commons.lang3.tuple.Pair; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; -import java.time.OffsetDateTime; import java.util.*; +import java.time.OffsetDateTime; + +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.*; /** * @author Pengbo Wang {@literal } @@ -54,25 +52,28 @@ public abstract class AbstractCoreProblemFiller implements ProblemFiller { protected final RangeActionSetpointResult prePerimeterRangeActionSetpoints; protected final Set flowCnecs; protected final RangeActionsOptimizationParameters rangeActionParameters; + protected final SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension; protected final Unit unit; protected int iteration = 0; protected static final double RANGE_SHRINK_RATE = 0.667; protected final boolean raRangeShrinking; - protected final RangeActionsOptimizationParameters.PstModel pstModel; + protected final PstModel pstModel; protected final OffsetDateTime timestamp; protected AbstractCoreProblemFiller(OptimizationPerimeter optimizationContext, RangeActionSetpointResult prePerimeterRangeActionSetpoints, RangeActionsOptimizationParameters rangeActionParameters, + SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension, Unit unit, boolean raRangeShrinking, - RangeActionsOptimizationParameters.PstModel pstModel, + PstModel pstModel, OffsetDateTime timestamp) { this.optimizationContext = optimizationContext; this.prePerimeterRangeActionSetpoints = prePerimeterRangeActionSetpoints; this.flowCnecs = new TreeSet<>(Comparator.comparing(Identifiable::getId)); this.flowCnecs.addAll(optimizationContext.getFlowCnecs()); this.rangeActionParameters = rangeActionParameters; + this.rangeActionParametersExtension = rangeActionParametersExtension; this.unit = unit; this.raRangeShrinking = raRangeShrinking; this.pstModel = pstModel; @@ -203,11 +204,11 @@ private void addImpactOfRangeActionOnCnec(LinearProblem linearProblem, Sensitivi private boolean isRangeActionSensitivityAboveThreshold(RangeAction rangeAction, double sensitivity) { if (rangeAction instanceof PstRangeAction) { - return sensitivity >= rangeActionParameters.getPstSensitivityThreshold(); + return sensitivity >= getPstSensitivityThreshold(rangeActionParametersExtension); } else if (rangeAction instanceof HvdcRangeAction) { - return sensitivity >= rangeActionParameters.getHvdcSensitivityThreshold(); + return sensitivity >= getHvdcSensitivityThreshold(rangeActionParametersExtension); } else if (rangeAction instanceof InjectionRangeAction) { - return sensitivity >= rangeActionParameters.getInjectionRaSensitivityThreshold(); + return sensitivity >= getInjectionRaSensitivityThreshold(rangeActionParametersExtension); } else { throw new OpenRaoException("Type of RangeAction not yet handled by the LinearRao."); } @@ -315,7 +316,7 @@ protected void addSetPointConstraints(LinearProblem linearProblem, RangeAction> getAvailableRangeActionsOnSameAction(RangeAction protected static double getRangeActionPenaltyCost(RangeAction rangeAction, RangeActionsOptimizationParameters rangeActionParameters) { if (rangeAction instanceof PstRangeAction) { - return rangeActionParameters.getPstPenaltyCost(); + return rangeActionParameters.getPstRAMinImpactThreshold(); } else if (rangeAction instanceof HvdcRangeAction) { - return rangeActionParameters.getHvdcPenaltyCost(); + return rangeActionParameters.getHvdcRAMinImpactThreshold(); } else if (rangeAction instanceof InjectionRangeAction) { - return rangeActionParameters.getInjectionRaPenaltyCost(); + return rangeActionParameters.getInjectionRAMinImpactThreshold(); } else { throw new OpenRaoException("Unexpected type of range action: '%s'.".formatted(rangeAction.getClass().getSimpleName())); } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/CostCoreProblemFiller.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/CostCoreProblemFiller.java index a4110cbb03..c1341f06d6 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/CostCoreProblemFiller.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/CostCoreProblemFiller.java @@ -14,6 +14,7 @@ import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.data.crac.api.rangeaction.VariationDirection; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblem; @@ -34,12 +35,13 @@ public class CostCoreProblemFiller extends AbstractCoreProblemFiller { public CostCoreProblemFiller(OptimizationPerimeter optimizationContext, RangeActionSetpointResult prePerimeterRangeActionSetpoints, RangeActionsOptimizationParameters rangeActionParameters, + SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension, Unit unit, boolean raRangeShrinking, - RangeActionsOptimizationParameters.PstModel pstModel, + SearchTreeRaoRangeActionsOptimizationParameters.PstModel pstModel, OffsetDateTime timestamp) { - super(optimizationContext, prePerimeterRangeActionSetpoints, rangeActionParameters, unit, raRangeShrinking, pstModel, timestamp); - if (pstModel.equals(RangeActionsOptimizationParameters.PstModel.CONTINUOUS)) { + super(optimizationContext, prePerimeterRangeActionSetpoints, rangeActionParameters, rangeActionParametersExtension, unit, raRangeShrinking, pstModel, timestamp); + if (pstModel.equals(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS)) { throw new OpenRaoException("Costly remedial action optimization is only available for the APPROXIMATED_INTEGERS mode of PST range actions."); } } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstTapFiller.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstTapFiller.java index 354d44612d..a1d2b2840a 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstTapFiller.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstTapFiller.java @@ -295,7 +295,7 @@ private Pair getMinAndMaxRelativeTaps(PstRangeAction pstRangeAct private void fillObjective(LinearProblem linearProblem) { if (costOptimization) { - double defaultCost = rangeActionsParameters.getPstPenaltyCost(); + double defaultCost = rangeActionsParameters.getPstRAMinImpactThreshold(); OpenRaoMPObjective objective = linearProblem.getObjective(); rangeActions.forEach((state, pstRangeActions) -> pstRangeActions.forEach(pstRangeAction -> { objective.setCoefficient(linearProblem.getTotalPstRangeActionTapVariationVariable(pstRangeAction, state, LinearProblem.VariationDirectionExtension.UPWARD, Optional.ofNullable(timestamp)), pstRangeAction.getVariationCost(VariationDirection.UP).orElse(defaultCost)); diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MarginCoreProblemFiller.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MarginCoreProblemFiller.java index 3c6cb00bc7..1741514a4d 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MarginCoreProblemFiller.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MarginCoreProblemFiller.java @@ -11,6 +11,7 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPVariable; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblem; @@ -27,11 +28,12 @@ public class MarginCoreProblemFiller extends AbstractCoreProblemFiller { public MarginCoreProblemFiller(OptimizationPerimeter optimizationContext, RangeActionSetpointResult prePerimeterRangeActionSetpoints, RangeActionsOptimizationParameters rangeActionParameters, + SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension, Unit unit, boolean raRangeShrinking, - RangeActionsOptimizationParameters.PstModel pstModel, + SearchTreeRaoRangeActionsOptimizationParameters.PstModel pstModel, OffsetDateTime timestamp) { - super(optimizationContext, prePerimeterRangeActionSetpoints, rangeActionParameters, unit, raRangeShrinking, pstModel, timestamp); + super(optimizationContext, prePerimeterRangeActionSetpoints, rangeActionParameters, rangeActionParametersExtension, unit, raRangeShrinking, pstModel, timestamp); } /** diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxLoopFlowFiller.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxLoopFlowFiller.java index f88b67e42d..cb89e95d4b 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxLoopFlowFiller.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxLoopFlowFiller.java @@ -11,8 +11,9 @@ import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.loopflowextension.LoopFlowThreshold; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; import com.powsybl.openrao.raoapi.parameters.extensions.PtdfApproximation; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPConstraint; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPVariable; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblem; @@ -39,14 +40,18 @@ public class MaxLoopFlowFiller implements ProblemFiller { private final OffsetDateTime timestamp; private FlowResult preOptimFlowResult; // = flow result used in the first "fill" iteration - public MaxLoopFlowFiller(Set loopFlowCnecs, FlowResult initialFlowResult, LoopFlowParametersExtension loopFlowParameters, OffsetDateTime timestamp) { + public MaxLoopFlowFiller(Set loopFlowCnecs, + FlowResult initialFlowResult, + LoopFlowParameters loopFlowParameters, + SearchTreeRaoLoopFlowParameters loopFlowParametersExtension, + OffsetDateTime timestamp) { this.loopFlowCnecs = new TreeSet<>(Comparator.comparing(Identifiable::getId)); this.loopFlowCnecs.addAll(FillersUtil.getFlowCnecsNotNaNFlow(loopFlowCnecs, initialFlowResult)); this.initialFlowResult = initialFlowResult; - this.loopFlowPtdfApproximationLevel = loopFlowParameters.getPtdfApproximation(); + this.loopFlowPtdfApproximationLevel = loopFlowParametersExtension.getPtdfApproximation(); this.loopFlowAcceptableAugmentation = loopFlowParameters.getAcceptableIncrease(); - this.loopFlowViolationCost = loopFlowParameters.getViolationCost(); - this.loopFlowConstraintAdjustmentCoefficient = loopFlowParameters.getConstraintAdjustmentCoefficient(); + this.loopFlowViolationCost = loopFlowParametersExtension.getViolationCost(); + this.loopFlowConstraintAdjustmentCoefficient = loopFlowParametersExtension.getConstraintAdjustmentCoefficient(); this.timestamp = timestamp; } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinRelativeMarginFiller.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinRelativeMarginFiller.java index 46977a3a30..3786725d59 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinRelativeMarginFiller.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinRelativeMarginFiller.java @@ -11,7 +11,7 @@ import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.raoapi.parameters.extensions.PtdfApproximation; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPConstraint; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPVariable; @@ -41,7 +41,7 @@ public class MaxMinRelativeMarginFiller extends MaxMinMarginFiller { public MaxMinRelativeMarginFiller(Set optimizedCnecs, FlowResult preOptimFlowResult, Unit unit, - RelativeMarginsParametersExtension maxMinRelativeMarginParameters, + SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters, OffsetDateTime timestamp) { super(optimizedCnecs, unit, false, timestamp); this.preOptimFlowResult = preOptimFlowResult; diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MnecFiller.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MnecFiller.java index b7663d8b8e..4b67124ff4 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MnecFiller.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MnecFiller.java @@ -9,7 +9,6 @@ import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.crac.api.Identifiable; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPConstraint; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPVariable; @@ -38,14 +37,20 @@ public class MnecFiller implements ProblemFiller { private final double mnecConstraintAdjustmentCoefficient; private final OffsetDateTime timestamp; - public MnecFiller(FlowResult initialFlowResult, Set monitoredCnecs, Unit unit, MnecParametersExtension mnecParameters, OffsetDateTime timestamp) { + public MnecFiller(FlowResult initialFlowResult, + Set monitoredCnecs, + Unit unit, + double mnecViolationCost, + double mnecAcceptableMarginDecrease, + double mnecConstraintAdjustmentCoefficient, + OffsetDateTime timestamp) { this.initialFlowResult = initialFlowResult; this.monitoredCnecs = new TreeSet<>(Comparator.comparing(Identifiable::getId)); this.monitoredCnecs.addAll(FillersUtil.getFlowCnecsNotNaNFlow(monitoredCnecs, initialFlowResult)); this.unit = unit; - this.mnecViolationCost = mnecParameters.getViolationCost(); - this.mnecAcceptableMarginDecrease = mnecParameters.getAcceptableMarginDecrease(); - this.mnecConstraintAdjustmentCoefficient = mnecParameters.getConstraintAdjustmentCoefficient(); + this.mnecViolationCost = mnecViolationCost; + this.mnecAcceptableMarginDecrease = mnecAcceptableMarginDecrease; + this.mnecConstraintAdjustmentCoefficient = mnecConstraintAdjustmentCoefficient; this.timestamp = timestamp; } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblem.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblem.java index 72fc825b2d..ebbbd5ff66 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblem.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblem.java @@ -12,7 +12,7 @@ import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.api.rangeaction.PstRangeAction; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.fillers.ProblemFiller; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; import com.powsybl.openrao.searchtreerao.result.api.LinearProblemStatus; @@ -84,7 +84,7 @@ public static LinearProblemBuilder create() { return new LinearProblemBuilder(); } - LinearProblem(List fillerList, RangeActionActivationResult raActivationFromParentLeaf, RangeActionsOptimizationParameters.Solver solver, double relativeMipGap, String solverSpecificParameters) { + LinearProblem(List fillerList, RangeActionActivationResult raActivationFromParentLeaf, SearchTreeRaoRangeActionsOptimizationParameters.Solver solver, double relativeMipGap, String solverSpecificParameters) { this.solver = new OpenRaoMPSolver(OPT_PROBLEM_NAME, solver); this.fillerList = fillerList; this.raActivationFromParentLeaf = raActivationFromParentLeaf; 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 19530134d3..5c941aa631 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 @@ -9,7 +9,7 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.rangeaction.PstRangeAction; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.CurativeOptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.fillers.*; import com.powsybl.openrao.searchtreerao.linearoptimisation.inputs.IteratingLinearOptimizerInput; @@ -19,14 +19,16 @@ import java.util.*; import java.util.stream.Collectors; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.getPstModel; + /** * @author Baptiste Seguinot {@literal } */ public class LinearProblemBuilder { private final List problemFillers = new ArrayList<>(); - private RangeActionsOptimizationParameters.Solver solver; - private double relativeMipGap = RangeActionsOptimizationParameters.LinearOptimizationSolver.DEFAULT_RELATIVE_MIP_GAP; - private String solverSpecificParameters = RangeActionsOptimizationParameters.LinearOptimizationSolver.DEFAULT_SOLVER_SPECIFIC_PARAMETERS; + private SearchTreeRaoRangeActionsOptimizationParameters.Solver solver; + private double relativeMipGap = SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver.DEFAULT_RELATIVE_MIP_GAP; + private String solverSpecificParameters = SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver.DEFAULT_SOLVER_SPECIFIC_PARAMETERS; private RangeActionActivationResult initialRangeActionActivationResult; private IteratingLinearOptimizerInput inputs; private IteratingLinearOptimizerParameters parameters; @@ -68,7 +70,7 @@ public LinearProblem buildFromInputsAndParameters(IteratingLinearOptimizerInput } // MIP optimization vs. CONTINUOUS optimization - if (parameters.getRangeActionParameters().getPstModel().equals(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS)) { + if (getPstModel(parameters.getRangeActionParametersExtension()).equals(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS)) { Map> pstRangeActions = copyOnlyPstRangeActions(inputs.optimizationPerimeter().getRangeActionsPerState()); Map>> otherRa = copyWithoutPstRangeActions(inputs.optimizationPerimeter().getRangeActionsPerState()); this.withProblemFiller(buildIntegerPstTapFiller(pstRangeActions)); @@ -97,7 +99,7 @@ public LinearProblemBuilder withProblemFiller(ProblemFiller problemFiller) { return this; } - public LinearProblemBuilder withSolver(RangeActionsOptimizationParameters.Solver solver) { + public LinearProblemBuilder withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver solver) { this.solver = solver; return this; } @@ -122,17 +124,19 @@ private ProblemFiller buildCoreProblemFiller() { inputs.optimizationPerimeter(), inputs.prePerimeterSetpoints(), parameters.getRangeActionParameters(), + parameters.getRangeActionParametersExtension(), parameters.getObjectiveFunctionUnit(), parameters.getRaRangeShrinking(), - parameters.getRangeActionParameters().getPstModel(), + getPstModel(parameters.getRangeActionParametersExtension()), null ) : new MarginCoreProblemFiller( inputs.optimizationPerimeter(), inputs.prePerimeterSetpoints(), parameters.getRangeActionParameters(), + parameters.getRangeActionParametersExtension(), parameters.getObjectiveFunctionUnit(), parameters.getRaRangeShrinking(), - parameters.getRangeActionParameters().getPstModel(), + getPstModel(parameters.getRangeActionParametersExtension()), null ); } @@ -141,9 +145,10 @@ private ProblemFiller buildMaxMinRelativeMarginFiller() { return new MaxMinRelativeMarginFiller( inputs.optimizationPerimeter().getOptimizedFlowCnecs(), inputs.preOptimizationFlowResult(), - parameters.getObjectiveFunction().getUnit(), + parameters.getObjectiveFunctionUnit(), parameters.getMaxMinRelativeMarginParameters(), - null); + null + ); } private ProblemFiller buildMaxMinMarginFiller() { @@ -159,7 +164,9 @@ private ProblemFiller buildMnecFiller() { inputs.initialFlowResult(), inputs.optimizationPerimeter().getMonitoredFlowCnecs(), parameters.getObjectiveFunctionUnit(), - parameters.getMnecParameters(), + parameters.getMnecParametersExtension().getViolationCost(), + parameters.getMnecParameters().getAcceptableMarginDecrease(), + parameters.getMnecParametersExtension().getConstraintAdjustmentCoefficient(), null); } @@ -168,7 +175,9 @@ private ProblemFiller buildLoopFlowFiller() { inputs.optimizationPerimeter().getLoopFlowCnecs(), inputs.initialFlowResult(), parameters.getLoopFlowParameters(), - null); + parameters.getLoopFlowParametersExtension(), + null + ); } private ProblemFiller buildUnoptimizedCnecFiller() { @@ -207,8 +216,10 @@ private ProblemFiller buildRaUsageLimitsFiller() { inputs.optimizationPerimeter().getRangeActionsPerState(), inputs.prePerimeterSetpoints(), parameters.getRaLimitationParameters(), - parameters.getRangeActionParameters().getPstModel() == RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS, - inputs.network(), parameters.getObjectiveFunction().costOptimization(), null); + getPstModel(parameters.getRangeActionParametersExtension()) == SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS, + inputs.network(), + parameters.getObjectiveFunction().costOptimization(), + null); } private Map>> copyWithoutPstRangeActions(Map>> inRangeActions) { diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/OpenRaoMPSolver.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/OpenRaoMPSolver.java index b879396ffa..8e56cc3e5a 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/OpenRaoMPSolver.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/OpenRaoMPSolver.java @@ -12,7 +12,7 @@ import com.google.ortools.linearsolver.MPSolverParameters; import com.powsybl.openrao.commons.OpenRaoException; import com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.result.api.LinearProblemStatus; import java.util.Map; @@ -36,13 +36,13 @@ public class OpenRaoMPSolver { private static final int NUMBER_OF_BITS_TO_ROUND_OFF = 30; private static final double MIN_DOUBLE = 1e-6; - private static final Map SOLVER_INFINITY = Map.of( - RangeActionsOptimizationParameters.Solver.CBC, Double.POSITIVE_INFINITY, - RangeActionsOptimizationParameters.Solver.SCIP, 1E20, - RangeActionsOptimizationParameters.Solver.XPRESS, 1E20 + private static final Map SOLVER_INFINITY = Map.of( + SearchTreeRaoRangeActionsOptimizationParameters.Solver.CBC, Double.POSITIVE_INFINITY, + SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP, 1E20, + SearchTreeRaoRangeActionsOptimizationParameters.Solver.XPRESS, 1E20 ); - private final RangeActionsOptimizationParameters.Solver solver; + private final SearchTreeRaoRangeActionsOptimizationParameters.Solver solver; private final String optProblemName; private MPSolver mpSolver; private final MPSolverParameters solveConfiguration; @@ -52,7 +52,7 @@ public class OpenRaoMPSolver { OpenRaoMPObjective objective; private boolean objectiveMinimization = true; - public OpenRaoMPSolver(String optProblemName, RangeActionsOptimizationParameters.Solver solver) { + public OpenRaoMPSolver(String optProblemName, SearchTreeRaoRangeActionsOptimizationParameters.Solver solver) { this.solver = solver; this.optProblemName = optProblemName; solveConfiguration = new MPSolverParameters(); @@ -72,11 +72,11 @@ public void resetModel() { } } - public RangeActionsOptimizationParameters.Solver getSolver() { + public SearchTreeRaoRangeActionsOptimizationParameters.Solver getSolver() { return solver; } - private MPSolver.OptimizationProblemType getOrToolsProblemType(RangeActionsOptimizationParameters.Solver solver) { + private MPSolver.OptimizationProblemType getOrToolsProblemType(SearchTreeRaoRangeActionsOptimizationParameters.Solver solver) { Objects.requireNonNull(solver); return switch (solver) { case CBC -> MPSolver.OptimizationProblemType.CBC_MIXED_INTEGER_PROGRAMMING; 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..f899365407 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 @@ -11,9 +11,13 @@ import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoMnecParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.MnecParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; import com.powsybl.openrao.searchtreerao.commons.parameters.*; /** @@ -22,33 +26,45 @@ public final class IteratingLinearOptimizerParameters { private final ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private final Unit objectiveFunctionUnit; private final RangeActionsOptimizationParameters rangeActionParameters; - private final MnecParametersExtension mnecParameters; - private final RelativeMarginsParametersExtension maxMinRelativeMarginParameters; - private final LoopFlowParametersExtension loopFlowParameters; + private final SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension; + private final MnecParameters mnecParameters; + private final SearchTreeRaoMnecParameters mnecParametersExtension; + private final SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters; + private final LoopFlowParameters loopFlowParameters; + private final SearchTreeRaoLoopFlowParameters loopFlowParametersExtension; private final UnoptimizedCnecParameters unoptimizedCnecParameters; private final RangeActionLimitationParameters raLimitationParameters; - private final RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters; + private final LinearOptimizationSolver solverParameters; private final int maxNumberOfIterations; private final boolean raRangeShrinking; private IteratingLinearOptimizerParameters(ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit objectiveFunctionUnit, RangeActionsOptimizationParameters rangeActionParameters, - MnecParametersExtension mnecParameters, - RelativeMarginsParametersExtension maxMinRelativeMarginParameters, - LoopFlowParametersExtension loopFlowParameters, + SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension, + MnecParameters mnecParameters, + SearchTreeRaoMnecParameters mnecParametersExtension, + SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters, + LoopFlowParameters loopFlowParameters, + SearchTreeRaoLoopFlowParameters loopFlowParametersExtension, UnoptimizedCnecParameters unoptimizedCnecParameters, RangeActionLimitationParameters raLimitationParameters, - RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters, + LinearOptimizationSolver solverParameters, int maxNumberOfIterations, boolean raRangeShrinking) { this.objectiveFunction = objectiveFunction; + this.objectiveFunctionUnit = objectiveFunctionUnit; this.rangeActionParameters = rangeActionParameters; + this.rangeActionParametersExtension = rangeActionParametersExtension; this.mnecParameters = mnecParameters; + this.mnecParametersExtension = mnecParametersExtension; this.maxMinRelativeMarginParameters = maxMinRelativeMarginParameters; this.loopFlowParameters = loopFlowParameters; + this.loopFlowParametersExtension = loopFlowParametersExtension; this.unoptimizedCnecParameters = unoptimizedCnecParameters; this.raLimitationParameters = raLimitationParameters; this.solverParameters = solverParameters; @@ -61,7 +77,7 @@ public ObjectiveFunctionParameters.ObjectiveFunctionType getObjectiveFunction() } public Unit getObjectiveFunctionUnit() { - return getObjectiveFunction().getUnit(); + return objectiveFunctionUnit; } public boolean hasRelativeMargins() { @@ -74,29 +90,41 @@ public boolean hasOperatorsNotToOptimize() { } public boolean isRaoWithLoopFlowLimitation() { - return loopFlowParameters != null; + return loopFlowParameters != null && loopFlowParametersExtension != null; } public boolean isRaoWithMnecLimitation() { - return mnecParameters != null; + return mnecParameters != null && mnecParametersExtension != null; } public RangeActionsOptimizationParameters getRangeActionParameters() { return rangeActionParameters; } - public MnecParametersExtension getMnecParameters() { + public SearchTreeRaoRangeActionsOptimizationParameters getRangeActionParametersExtension() { + return rangeActionParametersExtension; + } + + public MnecParameters getMnecParameters() { return mnecParameters; } - public RelativeMarginsParametersExtension getMaxMinRelativeMarginParameters() { + public SearchTreeRaoMnecParameters getMnecParametersExtension() { + return mnecParametersExtension; + } + + public SearchTreeRaoRelativeMarginsParameters getMaxMinRelativeMarginParameters() { return maxMinRelativeMarginParameters; } - public LoopFlowParametersExtension getLoopFlowParameters() { + public LoopFlowParameters getLoopFlowParameters() { return loopFlowParameters; } + public SearchTreeRaoLoopFlowParameters getLoopFlowParametersExtension() { + return loopFlowParametersExtension; + } + public UnoptimizedCnecParameters getUnoptimizedCnecParameters() { return unoptimizedCnecParameters; } @@ -105,7 +133,7 @@ public RangeActionLimitationParameters getRaLimitationParameters() { return raLimitationParameters; } - public RangeActionsOptimizationParameters.LinearOptimizationSolver getSolverParameters() { + public LinearOptimizationSolver getSolverParameters() { return solverParameters; } @@ -124,13 +152,18 @@ public static LinearOptimizerParametersBuilder create() { public static class LinearOptimizerParametersBuilder { private ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private Unit objectiveFunctionUnit; private RangeActionsOptimizationParameters rangeActionParameters; - private MnecParametersExtension mnecParameters; - private RelativeMarginsParametersExtension maxMinRelativeMarginParameters; - private LoopFlowParametersExtension loopFlowParameters; + private SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension; + + private MnecParameters mnecParameters; + private SearchTreeRaoMnecParameters mnecParametersExtension; + private SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters; + private LoopFlowParameters loopFlowParameters; + private SearchTreeRaoLoopFlowParameters loopFlowParametersExtension; private UnoptimizedCnecParameters unoptimizedCnecParameters; private RangeActionLimitationParameters raLimitationParameters; - private RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters; + private LinearOptimizationSolver solverParameters; private int maxNumberOfIterations; private boolean raRangeShrinking; @@ -139,26 +172,46 @@ 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; } - public LinearOptimizerParametersBuilder withMnecParameters(MnecParametersExtension mnecParameters) { + public LinearOptimizerParametersBuilder withRangeActionParametersExtension(SearchTreeRaoRangeActionsOptimizationParameters rangeActionParameters) { + this.rangeActionParametersExtension = rangeActionParameters; + return this; + } + + public LinearOptimizerParametersBuilder withMnecParameters(MnecParameters mnecParameters) { this.mnecParameters = mnecParameters; return this; } - public LinearOptimizerParametersBuilder withMaxMinRelativeMarginParameters(RelativeMarginsParametersExtension maxMinRelativeMarginParameters) { + public LinearOptimizerParametersBuilder withMnecParametersExtension(SearchTreeRaoMnecParameters mnecParametersExtension) { + this.mnecParametersExtension = mnecParametersExtension; + return this; + } + + public LinearOptimizerParametersBuilder withMaxMinRelativeMarginParameters(SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters) { this.maxMinRelativeMarginParameters = maxMinRelativeMarginParameters; return this; } - public LinearOptimizerParametersBuilder withLoopFlowParameters(LoopFlowParametersExtension loopFlowParameters) { + public LinearOptimizerParametersBuilder withLoopFlowParameters(LoopFlowParameters loopFlowParameters) { this.loopFlowParameters = loopFlowParameters; return this; } + public LinearOptimizerParametersBuilder withLoopFlowParametersExtension(SearchTreeRaoLoopFlowParameters loopFlowParametersExtension) { + this.loopFlowParametersExtension = loopFlowParametersExtension; + return this; + } + public LinearOptimizerParametersBuilder withUnoptimizedCnecParameters(UnoptimizedCnecParameters unoptimizedCnecParameters) { this.unoptimizedCnecParameters = unoptimizedCnecParameters; return this; @@ -169,7 +222,7 @@ public LinearOptimizerParametersBuilder withRaLimitationParameters(RangeActionLi return this; } - public LinearOptimizerParametersBuilder withSolverParameters(RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters) { + public LinearOptimizerParametersBuilder withSolverParameters(LinearOptimizationSolver solverParameters) { this.solverParameters = solverParameters; return this; } @@ -191,10 +244,14 @@ public IteratingLinearOptimizerParameters build() { return new IteratingLinearOptimizerParameters( objectiveFunction, + objectiveFunctionUnit, rangeActionParameters, + rangeActionParametersExtension, mnecParameters, + mnecParametersExtension, maxMinRelativeMarginParameters, loopFlowParameters, + loopFlowParametersExtension, unoptimizedCnecParameters, raLimitationParameters, solverParameters, 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 ab8a0a4510..2df78c5c2d 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 @@ -213,10 +213,14 @@ void optimize(SearchTreeInput searchTreeInput, SearchTreeParameters parameters) // build parameters IteratingLinearOptimizerParameters linearOptimizerParameters = IteratingLinearOptimizerParameters.create() .withObjectiveFunction(parameters.getObjectiveFunction()) + .withObjectiveFunctionUnit(parameters.getObjectiveFunctionUnit()) .withRangeActionParameters(parameters.getRangeActionParameters()) + .withRangeActionParametersExtension(parameters.getRangeActionParametersExtension()) .withMnecParameters(parameters.getMnecParameters()) + .withMnecParametersExtension(parameters.getMnecParametersExtension()) .withMaxMinRelativeMarginParameters(parameters.getMaxMinRelativeMarginParameters()) .withLoopFlowParameters(parameters.getLoopFlowParameters()) + .withLoopFlowParametersExtension(parameters.getLoopFlowParametersExtension()) .withUnoptimizedCnecParameters(parameters.getUnoptimizedCnecParameters()) .withRaLimitationParameters(getRaLimitationParameters(searchTreeInput.getOptimizationPerimeter(), parameters)) .withSolverParameters(parameters.getSolverParameters()) 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 be9aa9794e..d67f7f2102 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); } @@ -385,10 +385,12 @@ private SensitivityComputer getSensitivityComputerForEvaluation(boolean isRootLe } } - if (parameters.getLoopFlowParameters() != null && parameters.getLoopFlowParameters().getPtdfApproximation().shouldUpdatePtdfWithTopologicalChange()) { - sensitivityComputerBuilder.withCommercialFlowsResults(input.getToolProvider().getLoopFlowComputation(), input.getOptimizationPerimeter().getLoopFlowCnecs()); - } else if (parameters.getLoopFlowParameters() != null) { - sensitivityComputerBuilder.withCommercialFlowsResults(input.getInitialFlowResult()); + if (parameters.getLoopFlowParametersExtension() != null) { + if (parameters.getLoopFlowParametersExtension().getPtdfApproximation().shouldUpdatePtdfWithTopologicalChange()) { + sensitivityComputerBuilder.withCommercialFlowsResults(input.getToolProvider().getLoopFlowComputation(), input.getOptimizationPerimeter().getLoopFlowCnecs()); + } else { + sensitivityComputerBuilder.withCommercialFlowsResults(input.getInitialFlowResult()); + } } return sensitivityComputerBuilder.build(); @@ -506,7 +508,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..2b215acd22 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; @@ -14,10 +15,12 @@ import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.*; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.MnecParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; import com.powsybl.openrao.searchtreerao.commons.parameters.*; import com.powsybl.openrao.searchtreerao.result.api.OptimizationResult; import com.powsybl.openrao.searchtreerao.result.api.PrePerimeterResult; @@ -27,12 +30,16 @@ import java.util.Map; import java.util.Set; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.getLinearOptimizationSolver; +import static com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.getMaxMipIterations; + /** * @author Baptiste Seguinot {@literal } */ public class SearchTreeParameters { private final ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private final Unit objectiveFunctionUnit; // required for the search tree algorithm private final TreeParameters treeParameters; @@ -41,32 +48,45 @@ public class SearchTreeParameters { // required for sub-module iterating linear optimizer private final RangeActionsOptimizationParameters rangeActionParameters; - private final MnecParametersExtension mnecParameters; - private final RelativeMarginsParametersExtension maxMinRelativeMarginParameters; - private final LoopFlowParametersExtension loopFlowParameters; + private final SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension; + + private final MnecParameters mnecParameters; + private final SearchTreeRaoMnecParameters mnecParametersExtension; + + private final SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters; + private final LoopFlowParameters loopFlowParameters; + private final SearchTreeRaoLoopFlowParameters loopFlowParametersExtension; + private final UnoptimizedCnecParameters unoptimizedCnecParameters; - private final RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters; + private final LinearOptimizationSolver solverParameters; private final int maxNumberOfIterations; public SearchTreeParameters(ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, - TreeParameters treeParameters, + Unit objectiveFunctionUnit, TreeParameters treeParameters, NetworkActionParameters networkActionParameters, Map raLimitationParameters, RangeActionsOptimizationParameters rangeActionParameters, - MnecParametersExtension mnecParameters, - RelativeMarginsParametersExtension maxMinRelativeMarginParameters, - LoopFlowParametersExtension loopFlowParameters, + SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension, + MnecParameters mnecParameters, + SearchTreeRaoMnecParameters mnecParametersExtension, + SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters, + LoopFlowParameters loopFlowParameters, + SearchTreeRaoLoopFlowParameters loopFlowParametersExtension, UnoptimizedCnecParameters unoptimizedCnecParameters, - RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters, + LinearOptimizationSolver solverParameters, int maxNumberOfIterations) { this.objectiveFunction = objectiveFunction; + this.objectiveFunctionUnit = objectiveFunctionUnit; this.treeParameters = treeParameters; this.networkActionParameters = networkActionParameters; this.raLimitationParameters = raLimitationParameters; this.rangeActionParameters = rangeActionParameters; + this.rangeActionParametersExtension = rangeActionParametersExtension; this.mnecParameters = mnecParameters; + this.mnecParametersExtension = mnecParametersExtension; this.maxMinRelativeMarginParameters = maxMinRelativeMarginParameters; this.loopFlowParameters = loopFlowParameters; + this.loopFlowParametersExtension = loopFlowParametersExtension; this.unoptimizedCnecParameters = unoptimizedCnecParameters; this.solverParameters = solverParameters; this.maxNumberOfIterations = maxNumberOfIterations; @@ -76,6 +96,10 @@ public ObjectiveFunctionParameters.ObjectiveFunctionType getObjectiveFunction() return objectiveFunction; } + public Unit getObjectiveFunctionUnit() { + return objectiveFunctionUnit; + } + public TreeParameters getTreeParameters() { return treeParameters; } @@ -92,23 +116,35 @@ public RangeActionsOptimizationParameters getRangeActionParameters() { return rangeActionParameters; } - public MnecParametersExtension getMnecParameters() { + public SearchTreeRaoRangeActionsOptimizationParameters getRangeActionParametersExtension() { + return rangeActionParametersExtension; + } + + public MnecParameters getMnecParameters() { return mnecParameters; } - public RelativeMarginsParametersExtension getMaxMinRelativeMarginParameters() { + public SearchTreeRaoMnecParameters getMnecParametersExtension() { + return mnecParametersExtension; + } + + public SearchTreeRaoRelativeMarginsParameters getMaxMinRelativeMarginParameters() { return maxMinRelativeMarginParameters; } - public LoopFlowParametersExtension getLoopFlowParameters() { + public LoopFlowParameters getLoopFlowParameters() { return loopFlowParameters; } + public SearchTreeRaoLoopFlowParameters getLoopFlowParametersExtension() { + return loopFlowParametersExtension; + } + public UnoptimizedCnecParameters getUnoptimizedCnecParameters() { return unoptimizedCnecParameters; } - public RangeActionsOptimizationParameters.LinearOptimizationSolver getSolverParameters() { + public LinearOptimizationSolver getSolverParameters() { return solverParameters; } @@ -236,27 +272,44 @@ public static SearchTreeParametersBuilder create() { public static class SearchTreeParametersBuilder { private ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction; + private Unit objectiveFunctionUnit; private TreeParameters treeParameters; private NetworkActionParameters networkActionParameters; private Map raLimitationParameters; private RangeActionsOptimizationParameters rangeActionParameters; - private MnecParametersExtension mnecParameters; - private RelativeMarginsParametersExtension maxMinRelativeMarginParameters; - private LoopFlowParametersExtension loopFlowParameters; + private SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension; + private MnecParameters mnecParameters; + private SearchTreeRaoMnecParameters mnecParametersExtension; + + private SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters; + private LoopFlowParameters loopFlowParameters; + private SearchTreeRaoLoopFlowParameters loopFlowParametersExtension; private UnoptimizedCnecParameters unoptimizedCnecParameters; - private RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters; + private LinearOptimizationSolver solverParameters; private int maxNumberOfIterations; public SearchTreeParametersBuilder withConstantParametersOverAllRao(RaoParameters raoParameters, Crac crac) { this.objectiveFunction = raoParameters.getObjectiveFunctionParameters().getType(); - this.networkActionParameters = NetworkActionParameters.buildFromRaoParameters(raoParameters.getTopoOptimizationParameters(), crac); + this.objectiveFunctionUnit = raoParameters.getObjectiveFunctionParameters().getUnit(); + this.networkActionParameters = NetworkActionParameters.buildFromRaoParameters(raoParameters, crac); this.raLimitationParameters = new HashMap<>(crac.getRaUsageLimitsPerInstant()); - this.rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); - this.mnecParameters = raoParameters.getExtension(MnecParametersExtension.class); - this.maxMinRelativeMarginParameters = raoParameters.getExtension(RelativeMarginsParametersExtension.class); - this.loopFlowParameters = raoParameters.getExtension(LoopFlowParametersExtension.class); - this.solverParameters = raoParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver(); - this.maxNumberOfIterations = raoParameters.getRangeActionsOptimizationParameters().getMaxMipIterations(); + this.rangeActionParameters = raoParameters.getRangeActionsOptimizationParameters(); + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + this.rangeActionParametersExtension = raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getRangeActionsOptimizationParameters(); + } + this.mnecParameters = raoParameters.getMnecParameters().orElse(null); + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + this.mnecParametersExtension = raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getMnecParameters().orElse(null); + } + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + this.maxMinRelativeMarginParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getRelativeMarginsParameters().orElse(null); + } + this.loopFlowParameters = raoParameters.getLoopFlowParameters().orElse(null); + if (raoParameters.hasExtension(OpenRaoSearchTreeParameters.class)) { + this.loopFlowParametersExtension = raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getLoopFlowParameters().orElse(null); + } + this.solverParameters = getLinearOptimizationSolver(raoParameters); + this.maxNumberOfIterations = getMaxMipIterations(raoParameters); return this; } @@ -265,6 +318,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; @@ -285,17 +343,22 @@ public SearchTreeParametersBuilder withRangeActionParameters(RangeActionsOptimiz return this; } - public SearchTreeParametersBuilder withMnecParameters(MnecParametersExtension mnecParameters) { + public SearchTreeParametersBuilder withRangeActionParametersExtension(SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension) { + this.rangeActionParametersExtension = rangeActionParametersExtension; + return this; + } + + public SearchTreeParametersBuilder withMnecParameters(MnecParameters mnecParameters) { this.mnecParameters = mnecParameters; return this; } - public SearchTreeParametersBuilder withMaxMinRelativeMarginParameters(RelativeMarginsParametersExtension maxMinRelativeMarginParameters) { + public SearchTreeParametersBuilder withMaxMinRelativeMarginParameters(SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters) { this.maxMinRelativeMarginParameters = maxMinRelativeMarginParameters; return this; } - public SearchTreeParametersBuilder withLoopFlowParameters(LoopFlowParametersExtension loopFlowParameters) { + public SearchTreeParametersBuilder withLoopFlowParameters(LoopFlowParameters loopFlowParameters) { this.loopFlowParameters = loopFlowParameters; return this; } @@ -305,7 +368,7 @@ public SearchTreeParametersBuilder withUnoptimizedCnecParameters(UnoptimizedCnec return this; } - public SearchTreeParametersBuilder withSolverParameters(RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters) { + public SearchTreeParametersBuilder withSolverParameters(LinearOptimizationSolver solverParameters) { this.solverParameters = solverParameters; return this; } @@ -316,14 +379,19 @@ public SearchTreeParametersBuilder withMaxNumberOfIterations(int maxNumberOfIter } public SearchTreeParameters build() { - return new SearchTreeParameters(objectiveFunction, + return new SearchTreeParameters( + objectiveFunction, + objectiveFunctionUnit, treeParameters, networkActionParameters, raLimitationParameters, rangeActionParameters, + rangeActionParametersExtension, mnecParameters, + mnecParametersExtension, maxMinRelativeMarginParameters, loopFlowParameters, + loopFlowParametersExtension, unoptimizedCnecParameters, solverParameters, maxNumberOfIterations); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulatorTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulatorTest.java index 20c59e22ad..76d8c66564 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 @@ -28,6 +28,7 @@ import com.powsybl.openrao.data.raoresult.api.ComputationStatus; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; import com.powsybl.openrao.searchtreerao.commons.ToolProvider; import com.powsybl.openrao.searchtreerao.commons.objectivefunction.ObjectiveFunction; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; @@ -233,8 +234,11 @@ public void setup() { autoState = crac.getState(contingency1, autoInstant); RaoParameters raoParameters = new RaoParameters(); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT); - raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityProvider("OpenLoadFlow"); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.MEGAWATT); + searchTreeParameters.getLoadFlowAndSensitivityParameters().setSensitivityProvider("OpenLoadFlow"); mockedPreAutoPerimeterSensitivityAnalysis = mock(PrePerimeterSensitivityAnalysis.class); mockedPrePerimeterResult = mock(PrePerimeterResult.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 80110d503a..028e2d6bc7 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimizationTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorFullOptimizationTest.java @@ -30,10 +30,11 @@ import com.powsybl.openrao.data.raoresult.api.OptimizationStepsExecuted; import com.powsybl.openrao.raoapi.RaoInput; import com.powsybl.openrao.raoapi.json.JsonRaoParameters; -import com.powsybl.openrao.raoapi.parameters.MultithreadingParameters; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.SecondPreventiveRaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoTopoOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SecondPreventiveRaoParameters; import com.powsybl.openrao.searchtreerao.result.impl.FailedRaoResultImpl; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -96,9 +97,10 @@ void smallRaoWith2P() throws IOException { // Same RAO as before but activating 2P => results should be better setup("small-network-2P.uct", "small-crac-2P.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); + OpenRaoSearchTreeParameters searchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); // Activate 2P - raoParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); + searchTreeParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -115,10 +117,11 @@ void smallRaoWithGlobal2P() throws IOException { // Same RAO as before but activating Global 2P => results should be the same (there are no range actions) setup("small-network-2P.uct", "small-crac-2P.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); + OpenRaoSearchTreeParameters searchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); // Activate global 2P - raoParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); - raoParameters.getSecondPreventiveRaoParameters().setReOptimizeCurativeRangeActions(true); + searchTreeParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); + searchTreeParameters.getSecondPreventiveRaoParameters().setReOptimizeCurativeRangeActions(true); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -194,7 +197,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(); @@ -288,7 +292,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(); @@ -426,7 +431,7 @@ void curativeOptimizationShouldNotBeDoneIfPreventiveUnsecure() throws IOExceptio setup("small-network-2P.uct", "small-crac-to-check-curative-optimization-if-preventive-unsecure.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); // Run RAO @@ -439,7 +444,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveSecure() throws IOException { setup("small-network-2P.uct", "small-crac-to-check-curative-optimization-if-preventive-secure.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); // Run RAO @@ -464,7 +469,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveUnsecureAndAssociatedParameterS setup("small-network-2P.uct", "small-crac-to-check-curative-optimization-if-preventive-secure.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO @@ -477,7 +482,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveSecureAndAssociatedParameterSet setup("small-network-2P.uct", "small-crac-to-check-curative-optimization-if-preventive-secure.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO @@ -521,8 +526,10 @@ void catchDuringDataInitialization() throws IOException { @Test void catchDuringInitialSensitivity() throws IOException { setup("small-network-2P.uct", "small-crac-2P.json"); - RaoParameters raoParameters = Mockito.spy(new RaoParameters()); - when(raoParameters.getLoadFlowAndSensitivityParameters()).thenThrow(new OpenRaoException("Testing exception handling")); + RaoParameters raoParameters = new RaoParameters(); + OpenRaoSearchTreeParameters searchTreeParameters = Mockito.spy(new OpenRaoSearchTreeParameters()); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, searchTreeParameters); + when(searchTreeParameters.getLoadFlowAndSensitivityParameters()).thenThrow(new OpenRaoException("Testing exception handling")); RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); assertInstanceOf(FailedRaoResultImpl.class, raoResult); assertEquals("RAO failed during initial sensitivity analysis : Testing exception handling", raoResult.getExecutionDetails()); @@ -542,9 +549,9 @@ void catchDuringFirstPreventive() throws IOException { void catchDuringContingencyScenarios() throws IOException { setup("small-network-2P.uct", "small-crac-2P.json"); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - MultithreadingParameters multithreadingParameters = Mockito.spy(raoParameters.getMultithreadingParameters()); - when(multithreadingParameters.getContingencyScenariosInParallel()).thenThrow(new OpenRaoException("Testing exception handling")); - raoParameters.setMultithreadingParameters(multithreadingParameters); + SearchTreeRaoTopoOptimizationParameters topoOptimizationParameters = Mockito.spy(raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getTopoOptimizationParameters()); + when(topoOptimizationParameters.getMaxCurativeSearchTreeDepth()).thenThrow(new OpenRaoException("Testing exception handling")); + raoParameters.getExtension(OpenRaoSearchTreeParameters.class).setTopoOptimizationParameters(topoOptimizationParameters); RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); assertEquals("RAO failed during contingency scenarios : Testing exception handling", raoResult.getExecutionDetails()); @@ -553,8 +560,12 @@ void catchDuringContingencyScenarios() throws IOException { @Test void catchDuringSecondPreventive() throws IOException { setup("small-network-2P.uct", "small-crac-2P.json"); - RaoParameters raoParameters = Mockito.spy(JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json"))); - when(raoParameters.getSecondPreventiveRaoParameters()).thenThrow(new OpenRaoException("Testing exception handling")); + RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); + OpenRaoSearchTreeParameters searchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); + OpenRaoSearchTreeParameters searchTreeParametersSpied = Mockito.spy(searchTreeParameters); + raoParameters.removeExtension(OpenRaoSearchTreeParameters.class); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, searchTreeParametersSpied); + when(searchTreeParametersSpied.getSecondPreventiveRaoParameters()).thenThrow(new OpenRaoException("Testing exception handling")); RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); assertEquals("RAO failed during second preventive optimization : Testing exception handling", raoResult.getExecutionDetails()); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java index 8ade5dbfe8..53d317ae8a 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/castor/algorithm/CastorSecondPreventiveTest.java @@ -29,7 +29,8 @@ import com.powsybl.openrao.data.raoresult.api.RaoResult; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.SecondPreventiveRaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SecondPreventiveRaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; import com.powsybl.openrao.searchtreerao.result.api.OptimizationResult; import com.powsybl.openrao.searchtreerao.result.api.PrePerimeterResult; import com.powsybl.openrao.sensitivityanalysis.AppliedRemedialActions; @@ -264,6 +265,8 @@ void setUp() { @Test void testShouldRunSecondPreventiveRaoSimple() { RaoParameters parameters = new RaoParameters(); + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); OptimizationResult preventiveResult = Mockito.mock(OptimizationResult.class); OptimizationResult optimizationResult1 = Mockito.mock(OptimizationResult.class); OptimizationResult optimizationResult2 = Mockito.mock(OptimizationResult.class); @@ -274,12 +277,12 @@ void testShouldRunSecondPreventiveRaoSimple() { assertFalse(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, null, 0)); // Deactivated in parameters - parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.DISABLED); + searchTreeParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.DISABLED); assertFalse(castorSecondPreventive.shouldRunSecondPreventiveRao(preventiveResult, curativeResults, null, 0)); // PreventiveStopCriterion.SECURE, secure case - parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); - parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + searchTreeParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); + parameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); Mockito.doReturn(-1.).when(optimizationResult1).getFunctionalCost(); Mockito.doReturn(-10.).when(optimizationResult2).getFunctionalCost(); Mockito.doReturn(0.).when(optimizationResult1).getVirtualCost(); @@ -306,20 +309,22 @@ private void setCost(OptimizationResult optimizationResultMock, double cost) { @Test void testShouldRunSecondPreventiveRaoAdvanced() { RaoParameters parameters = new RaoParameters(); + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); OptimizationResult preventiveResult = Mockito.mock(OptimizationResult.class); RaoResult postFirstPreventiveRaoResult = Mockito.mock(RaoResult.class); OptimizationResult optimizationResult1 = Mockito.mock(OptimizationResult.class); OptimizationResult optimizationResult2 = Mockito.mock(OptimizationResult.class); Collection curativeResults = Set.of(optimizationResult1, optimizationResult2); - parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); - parameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(10.); - parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + searchTreeParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); + searchTreeParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(10.); + parameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); when(preventiveResult.getCost()).thenReturn(-500.); CastorSecondPreventive castorSecondPreventive = new CastorSecondPreventive(crac, parameters, network, null, null, null); // PreventiveStopCriterion.MIN_OBJECTIVE - parameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); + parameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); setCost(preventiveResult, -100.); // case 1 : final cost is better than preventive (cost < preventive cost - minObjImprovement) when(postFirstPreventiveRaoResult.getCost(curativeInstant)).thenReturn(-200.); @@ -335,12 +340,14 @@ void testShouldRunSecondPreventiveRaoAdvanced() { @Test void testShouldRunSecondPreventiveRaoTime() { RaoParameters parameters = new RaoParameters(); + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); OptimizationResult preventiveResult = Mockito.mock(OptimizationResult.class); OptimizationResult optimizationResult1 = Mockito.mock(OptimizationResult.class); OptimizationResult optimizationResult2 = Mockito.mock(OptimizationResult.class); Collection curativeResults = Set.of(optimizationResult1, optimizationResult2); - parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); + searchTreeParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.POSSIBLE_CURATIVE_IMPROVEMENT); // Default objective function parameters are enough for SecondPreventiveRaoParameters to be true if there is enough time CastorSecondPreventive castorSecondPreventive = new CastorSecondPreventive(crac, parameters, network, null, null, java.time.Instant.now().plusSeconds(200)); @@ -356,12 +363,14 @@ void testShouldRunSecondPreventiveRaoTime() { @Test void testShouldRunSecondPreventiveRaoCostIncrease() { RaoParameters parameters = new RaoParameters(); + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); OptimizationResult preventiveResult = Mockito.mock(OptimizationResult.class); OptimizationResult optimizationResult1 = Mockito.mock(OptimizationResult.class); OptimizationResult optimizationResult2 = Mockito.mock(OptimizationResult.class); Collection curativeResults = Set.of(optimizationResult1, optimizationResult2); - parameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.COST_INCREASE); + searchTreeParameters.getSecondPreventiveRaoParameters().setExecutionCondition(SecondPreventiveRaoParameters.ExecutionCondition.COST_INCREASE); // Default objective function parameters are enough for SecondPreventiveRaoParameters to be true if cost at curative allows it RaoResult postFirstRaoResult = Mockito.mock(RaoResult.class); 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 6f35d7f50f..32a2745588 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 @@ -17,9 +17,11 @@ import com.powsybl.openrao.loopflowcomputation.LoopFlowResult; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; import com.powsybl.openrao.raoapi.parameters.extensions.PtdfApproximation; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; import com.powsybl.openrao.searchtreerao.commons.AbsolutePtdfSumsComputation; import com.powsybl.openrao.searchtreerao.commons.ToolProvider; import com.powsybl.openrao.searchtreerao.result.api.OptimizationResult; @@ -96,7 +98,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); @@ -108,7 +111,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()); @@ -116,9 +120,7 @@ void testRunWithPtdf() { @Test 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.setLoopFlowParameters(new LoopFlowParameters()); mockSystematicSensitivityInterface(false, true); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); @@ -127,9 +129,8 @@ void testRunWithLf() { @Test 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.setLoopFlowParameters(new LoopFlowParameters()); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); mockSystematicSensitivityInterface(true, true); PrePerimeterResult result = prePerimeterSensitivityAnalysis.runInitialSensitivityAnalysis(network, crac); @@ -138,11 +139,16 @@ void testRunWithPtdfAndLf() { @Test void testRunWithFixedPtdfAndLf() { - raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); - 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); + OpenRaoSearchTreeParameters searchTreeParameters = new OpenRaoSearchTreeParameters(); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, searchTreeParameters); + SearchTreeRaoLoopFlowParameters loopFlowParameters = new SearchTreeRaoLoopFlowParameters(); + searchTreeParameters.setLoopFlowParameters(loopFlowParameters); + loopFlowParameters.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); + SearchTreeRaoRelativeMarginsParameters relativeMarginsParameters = new SearchTreeRaoRelativeMarginsParameters(); + searchTreeParameters.setRelativeMarginsParameters(relativeMarginsParameters); + relativeMarginsParameters.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); + 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()); @@ -153,11 +159,16 @@ void testRunWithFixedPtdfAndLf() { @Test void testRunAndRecomputePtdf() { - raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); - 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); + OpenRaoSearchTreeParameters searchTreeParameters = new OpenRaoSearchTreeParameters(); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, searchTreeParameters); + SearchTreeRaoLoopFlowParameters loopFlowParameters = new SearchTreeRaoLoopFlowParameters(); + searchTreeParameters.setLoopFlowParameters(loopFlowParameters); + loopFlowParameters.setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO); + SearchTreeRaoRelativeMarginsParameters relativeMarginsParameters = new SearchTreeRaoRelativeMarginsParameters(); + searchTreeParameters.setRelativeMarginsParameters(relativeMarginsParameters); + relativeMarginsParameters.setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO); + 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..20d48a9a68 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 @@ -24,9 +24,10 @@ import com.powsybl.openrao.data.crac.impl.utils.NetworkImportsUtil; import com.powsybl.openrao.raoapi.RaoInput; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; import com.powsybl.openrao.searchtreerao.result.api.PrePerimeterResult; import com.powsybl.glsk.commons.ZonalData; @@ -84,46 +85,49 @@ private void addGlskProvider() { @Test 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); + RelativeMarginsParameters relativeMarginsParameters = new RelativeMarginsParameters(); + raoParameters.setRelativeMarginsParameters(relativeMarginsParameters); + relativeMarginsParameters.setPtdfBoundariesFromString(new ArrayList<>(Arrays.asList("{FR}-{ES}", "{ES}-{PT}"))); + 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 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); + RelativeMarginsParameters relativeMarginsParameters = new RelativeMarginsParameters(); + raoParameters.setRelativeMarginsParameters(relativeMarginsParameters); + relativeMarginsParameters.setPtdfBoundariesFromString(new ArrayList<>()); + 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.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().setDc(true); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); + searchTreeParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().setDc(true); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); 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 @@ -347,7 +351,8 @@ private void assertIsOnFlowInCountryAvailable(RemedialAction ra, State optimi @Test void testElementaryActionsLimitWithNonDiscretePsts() { - raoParameters.getRangeActionsOptimizationParameters().setPstModel(RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getRangeActionsOptimizationParameters().setPstModel(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); raoInput.getCrac().newRaUsageLimits(PREVENTIVE_INSTANT_ID).withMaxElementaryActionPerTso(Map.of("TSO", 2)).add(); OpenRaoException exception = assertThrows(OpenRaoException.class, () -> RaoUtil.checkParameters(raoParameters, raoInput)); assertEquals("The PSTs must be approximated as integers to use the limitations of elementary actions as a constraint in the RAO.", exception.getMessage()); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/ToolProviderTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/ToolProviderTest.java index 89d15ec516..16bf5f9991 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/ToolProviderTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/ToolProviderTest.java @@ -10,8 +10,8 @@ import com.powsybl.openrao.commons.EICode; import com.powsybl.openrao.data.crac.api.Instant; import com.powsybl.openrao.data.crac.api.State; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.RelativeMarginsParameters; import com.powsybl.glsk.commons.ZonalData; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; @@ -88,8 +88,9 @@ void testCnecInCountry() { @Test void testGetEicForObjectiveFunction() { - raoParameters.addExtension(RelativeMarginsParametersExtension.class, new RelativeMarginsParametersExtension()); - raoParameters.getExtension(RelativeMarginsParametersExtension.class).setPtdfBoundariesFromString( + RelativeMarginsParameters relativeMarginsParameters = new RelativeMarginsParameters(); + raoParameters.setRelativeMarginsParameters(relativeMarginsParameters); + relativeMarginsParameters.setPtdfBoundariesFromString( List.of("{FR}-{BE}", "{ES}-{FR}") ); ToolProvider toolProvider = ToolProvider.create() @@ -152,8 +153,9 @@ void testGetLoopFlowCnecs() { assertEquals(Set.of(cnec1), toolProvider.getLoopFlowCnecs(Set.of(cnec1))); assertEquals(Set.of(cnec2), toolProvider.getLoopFlowCnecs(Set.of(cnec2))); - raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); - raoParameters.getExtension(LoopFlowParametersExtension.class).setCountries(List.of("FR")); + LoopFlowParameters loopFlowParameters = new LoopFlowParameters(); + raoParameters.setLoopFlowParameters(loopFlowParameters); + loopFlowParameters.setCountries(List.of("FR")); assertEquals(Set.of(cnec1), toolProvider.getLoopFlowCnecs(Set.of(cnec1, cnec2))); } diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/ObjectiveFunctionTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/ObjectiveFunctionTest.java index 00fd14cf6f..97ec3a8268 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/ObjectiveFunctionTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunction/ObjectiveFunctionTest.java @@ -12,10 +12,13 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.openrao.data.crac.loopflowextension.LoopFlowThreshold; +import com.powsybl.openrao.raoapi.parameters.MnecParameters; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoMnecParameters; import com.powsybl.openrao.searchtreerao.result.api.*; import com.powsybl.openrao.searchtreerao.result.impl.RangeActionSetpointResultImpl; import com.powsybl.openrao.searchtreerao.result.impl.RemedialActionActivationResultImpl; @@ -64,7 +67,9 @@ public void setUp() { @Test void testWithFunctionalCostOnly() { RaoParameters raoParameters = new RaoParameters(); - raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(0.0); + OpenRaoSearchTreeParameters openRaoSearchTreeParameters = new OpenRaoSearchTreeParameters(); + openRaoSearchTreeParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(0.0); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, openRaoSearchTreeParameters); ObjectiveFunction objectiveFunction = ObjectiveFunction.build(Set.of(cnec1, cnec2), Set.of(), null, null, Set.of(), raoParameters, Set.of()); // ObjectiveFunctionResult @@ -79,11 +84,17 @@ void testWithFunctionalCostOnly() { @Test void testWithFunctionalAndVirtualCost() { RaoParameters raoParameters = new RaoParameters(); - raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(0.0); - raoParameters.addExtension(MnecParametersExtension.class, new MnecParametersExtension()); - raoParameters.getExtension(MnecParametersExtension.class).setAcceptableMarginDecrease(200.0); - raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); - raoParameters.getExtension(LoopFlowParametersExtension.class).setViolationCost(10.0); + OpenRaoSearchTreeParameters openRaoSearchTreeParameters = new OpenRaoSearchTreeParameters(); + openRaoSearchTreeParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(0.0); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, openRaoSearchTreeParameters); + MnecParameters mnecParameters = new MnecParameters(); + mnecParameters.setAcceptableMarginDecrease(200.0); + raoParameters.setMnecParameters(mnecParameters); + openRaoSearchTreeParameters.setMnecParameters(new SearchTreeRaoMnecParameters()); + raoParameters.setLoopFlowParameters(new LoopFlowParameters()); + SearchTreeRaoLoopFlowParameters loopFlowParameters = new SearchTreeRaoLoopFlowParameters(); + loopFlowParameters.setViolationCost(10.); + openRaoSearchTreeParameters.setLoopFlowParameters(loopFlowParameters); FlowResult initialFlowResult = Mockito.mock(FlowResult.class); @@ -126,15 +137,12 @@ void testWithFunctionalAndVirtualCost() { void testBuildForInitialSensitivityComputation() { RaoParameters raoParameters = new RaoParameters(); - raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(0.); + OpenRaoSearchTreeParameters openRaoSearchTreeParameters = new OpenRaoSearchTreeParameters(); + openRaoSearchTreeParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(1.0); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, openRaoSearchTreeParameters); ObjectiveFunction objectiveFunction = ObjectiveFunction.buildForInitialSensitivityComputation( Set.of(cnec1, cnec2), raoParameters, Set.of() ); - - raoParameters.getLoadFlowAndSensitivityParameters().setSensitivityFailureOvercost(1.); - objectiveFunction = ObjectiveFunction.buildForInitialSensitivityComputation( - Set.of(cnec1, cnec2), raoParameters, Set.of() - ); assertNotNull(objectiveFunction); assertEquals(Set.of("sensitivity-failure-cost"), objectiveFunction.evaluate(flowResult, null).getVirtualCostNames()); } @@ -142,7 +150,8 @@ void testBuildForInitialSensitivityComputation() { @Test void testBuildForInitialSensitivityComputationCostlyOptimizationAmpere() { RaoParameters raoParameters = new RaoParameters(); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MIN_COST_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MIN_COST); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); assertTrue(raoParameters.getObjectiveFunctionParameters().getType().costOptimization()); ObjectiveFunction objectiveFunction = ObjectiveFunction.buildForInitialSensitivityComputation(Set.of(), raoParameters, Set.of()); @@ -153,7 +162,8 @@ void testBuildForInitialSensitivityComputationCostlyOptimizationAmpere() { @Test void testBuildForInitialSensitivityComputationCostlyOptimizationMegawatt() { RaoParameters raoParameters = new RaoParameters(); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MIN_COST_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MIN_COST); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.MEGAWATT); assertTrue(raoParameters.getObjectiveFunctionParameters().getType().costOptimization()); ObjectiveFunction objectiveFunction = ObjectiveFunction.buildForInitialSensitivityComputation(Set.of(), raoParameters, Set.of()); @@ -164,7 +174,8 @@ void testBuildForInitialSensitivityComputationCostlyOptimizationMegawatt() { @Test void testBuildCostlyOptimizationAmpere() { RaoParameters raoParameters = new RaoParameters(); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MIN_COST_IN_AMPERE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MIN_COST); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.AMPERE); assertTrue(raoParameters.getObjectiveFunctionParameters().getType().costOptimization()); ObjectiveFunction objectiveFunction = ObjectiveFunction.build(Set.of(), Set.of(), null, null, Set.of(), raoParameters, Set.of()); @@ -175,7 +186,8 @@ void testBuildCostlyOptimizationAmpere() { @Test void testBuildCostlyOptimizationMegawatt() { RaoParameters raoParameters = new RaoParameters(); - raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MIN_COST_IN_MEGAWATT); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MIN_COST); + raoParameters.getObjectiveFunctionParameters().setUnit(Unit.MEGAWATT); assertTrue(raoParameters.getObjectiveFunctionParameters().getType().costOptimization()); ObjectiveFunction objectiveFunction = ObjectiveFunction.build(Set.of(), Set.of(), null, null, Set.of(), raoParameters, Set.of()); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluatorTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluatorTest.java index 07425a0daa..bea8678608 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluatorTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/LoopFlowViolationCostEvaluatorTest.java @@ -11,7 +11,8 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.openrao.data.crac.loopflowextension.LoopFlowThreshold; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -35,7 +36,9 @@ class LoopFlowViolationCostEvaluatorTest { private FlowCnec cnec2; private FlowResult initialLoopFlows; private FlowResult currentLoopFlows; - private LoopFlowParametersExtension parameters; + private LoopFlowParameters parameters; + private SearchTreeRaoLoopFlowParameters parametersExtension; + private LoopFlowViolationCostEvaluator evaluator; @BeforeEach @@ -56,7 +59,8 @@ public void setUp() { initialLoopFlows = Mockito.mock(FlowResult.class); currentLoopFlows = Mockito.mock(FlowResult.class); - parameters = Mockito.mock(LoopFlowParametersExtension.class); + parameters = Mockito.mock(LoopFlowParameters.class); + parametersExtension = Mockito.mock(SearchTreeRaoLoopFlowParameters.class); } private void setInputThresholdWithReliabilityMargin(FlowCnec branchCnec, double inputThresholdWIthReliabilityMargin) { @@ -77,11 +81,11 @@ private void setAcceptableAugmentationInMW(double acceptableAugmentationInMW) { } private void setViolationCost(double violationCost) { - when(parameters.getViolationCost()).thenReturn(violationCost); + when(parametersExtension.getViolationCost()).thenReturn(violationCost); } private void buildLoopFlowViolationCostEvaluator() { - evaluator = new LoopFlowViolationCostEvaluator(Set.of(cnec1, cnec2), initialLoopFlows, parameters); + evaluator = new LoopFlowViolationCostEvaluator(Set.of(cnec1, cnec2), initialLoopFlows, parameters.getAcceptableIncrease(), parametersExtension.getViolationCost()); } @Test diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluatorTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluatorTest.java index 105218b749..ca3817db8a 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluatorTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/MnecViolationCostEvaluatorTest.java @@ -9,7 +9,6 @@ import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -57,27 +56,17 @@ public void setUp() { initialFlowResult = Mockito.mock(FlowResult.class); currentFlowResult = Mockito.mock(FlowResult.class); - MnecParametersExtension mnecExtension1 = new MnecParametersExtension(); - mnecExtension1.setAcceptableMarginDecrease(50); - mnecExtension1.setViolationCost(10); - mnecExtension1.setConstraintAdjustmentCoefficient(1); - - MnecParametersExtension mnecExtension2 = new MnecParametersExtension(); - mnecExtension2.setAcceptableMarginDecrease(20); - mnecExtension2.setViolationCost(2); - mnecExtension2.setConstraintAdjustmentCoefficient(1); - evaluator1 = new MnecViolationCostEvaluator( Set.of(mnec1, pureCnec), Unit.MEGAWATT, initialFlowResult, - mnecExtension1 + 50, 10 ); evaluator2 = new MnecViolationCostEvaluator( Set.of(mnec1, pureCnec), Unit.MEGAWATT, initialFlowResult, - mnecExtension2 + 20, 2 ); } @@ -87,16 +76,11 @@ private MnecViolationCostEvaluator createEvaluatorWithCosts(double violationCost when(initialFlowResult.getMargin(mnec2, unit)).thenReturn(-200.); when(currentFlowResult.getMargin(mnec2, unit)).thenReturn(-400.); - MnecParametersExtension mnec = new MnecParametersExtension(); - mnec.setAcceptableMarginDecrease(50); - mnec.setViolationCost(violationCost); - mnec.setConstraintAdjustmentCoefficient(1); - return new MnecViolationCostEvaluator( Set.of(mnec1, mnec2, pureCnec), unit, initialFlowResult, - mnec + 50, violationCost ); } diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/RemedialActionCostEvaluatorImplTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/RemedialActionCostEvaluatorImplTest.java index 687a7a2da6..83d92f38aa 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/RemedialActionCostEvaluatorImplTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/RemedialActionCostEvaluatorImplTest.java @@ -36,9 +36,9 @@ class RemedialActionCostEvaluatorImplTest { @BeforeEach void setUp() { RangeActionsOptimizationParameters rangeActionsOptimizationParameters = new RangeActionsOptimizationParameters(); - rangeActionsOptimizationParameters.setPstPenaltyCost(0.01); - rangeActionsOptimizationParameters.setInjectionRaPenaltyCost(0.02); - rangeActionsOptimizationParameters.setHvdcPenaltyCost(0.5); + rangeActionsOptimizationParameters.setPstRAMinImpactThreshold(0.01); + rangeActionsOptimizationParameters.setInjectionRAMinImpactThreshold(0.02); + rangeActionsOptimizationParameters.setHvdcRAMinImpactThreshold(0.5); PstRangeAction pstRangeAction1 = Mockito.mock(PstRangeAction.class); Mockito.when(pstRangeAction1.getActivationCost()).thenReturn(Optional.empty()); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/CurativeOptimizationPerimeterTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/CurativeOptimizationPerimeterTest.java index e742033b05..8432cce54c 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/CurativeOptimizationPerimeterTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/CurativeOptimizationPerimeterTest.java @@ -7,7 +7,6 @@ package com.powsybl.openrao.searchtreerao.commons.optimizationperimeters; import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -29,7 +28,6 @@ public void setUp() { @Test void curativePerimeterTest() { - raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); Mockito.when(prePerimeterResult.getSetpoint(cRA)).thenReturn(500.); OptimizationPerimeter optPerimeter = CurativeOptimizationPerimeter.build(cState1, crac, network, raoParameters, prePerimeterResult); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/GlobalOptimizationPerimeterTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/GlobalOptimizationPerimeterTest.java index c5afea4a14..76938ece4e 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/GlobalOptimizationPerimeterTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/GlobalOptimizationPerimeterTest.java @@ -6,7 +6,7 @@ */ package com.powsybl.openrao.searchtreerao.commons.optimizationperimeters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -29,7 +29,7 @@ public void setUp() { @Test void globalOptimizationPerimeterTest() { - raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); + raoParameters.setLoopFlowParameters(new LoopFlowParameters()); Mockito.when(prePerimeterResult.getSetpoint(pRA)).thenReturn(-500.); Mockito.when(prePerimeterResult.getSetpoint(cRA)).thenReturn(-500.); GlobalOptimizationPerimeter optPerimeter = GlobalOptimizationPerimeter.build(crac, network, raoParameters, prePerimeterResult); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/PreventiveOptimizationPerimeterTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/PreventiveOptimizationPerimeterTest.java index 75f1c6ff71..ba1f54dd50 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/PreventiveOptimizationPerimeterTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/optimizationperimeters/PreventiveOptimizationPerimeterTest.java @@ -7,7 +7,7 @@ package com.powsybl.openrao.searchtreerao.commons.optimizationperimeters; import com.powsybl.openrao.data.raoresult.api.ComputationStatus; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; import com.powsybl.openrao.searchtreerao.castor.algorithm.Perimeter; import com.powsybl.iidm.network.Country; import org.junit.jupiter.api.BeforeEach; @@ -56,7 +56,7 @@ void fullPreventivePerimeter1Test() { @Test void fullPreventivePerimeter2Test() { - raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); + raoParameters.setLoopFlowParameters(new LoopFlowParameters()); Mockito.when(prePerimeterResult.getSetpoint(pRA)).thenReturn(10000.); Mockito.when(prePerimeterResult.getSensitivityStatus(Mockito.any())).thenReturn(ComputationStatus.DEFAULT); Perimeter preventivePerimeter = new Perimeter(pState, Set.of(oState1, oState2, cState2)); @@ -69,8 +69,9 @@ void fullPreventivePerimeter2Test() { @Test void fullPreventivePerimeter3Test() { - raoParameters.addExtension(LoopFlowParametersExtension.class, new LoopFlowParametersExtension()); - raoParameters.getExtension(LoopFlowParametersExtension.class).setCountries(Set.of(Country.BE)); + LoopFlowParameters loopFlowParameters = new LoopFlowParameters(); + loopFlowParameters.setCountries(Set.of(Country.BE)); + raoParameters.setLoopFlowParameters(loopFlowParameters); Mockito.when(prePerimeterResult.getSensitivityStatus(Mockito.any())).thenReturn(ComputationStatus.DEFAULT); Perimeter preventivePerimeter = new Perimeter(pState, Set.of(oState1, oState2, cState2)); OptimizationPerimeter optPerimeter = PreventiveOptimizationPerimeter.buildFromBasecaseScenario(preventivePerimeter, crac, network, raoParameters, prePerimeterResult); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/NetworkActionParametersTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/NetworkActionParametersTest.java index 13d026ec18..270465cda1 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/NetworkActionParametersTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/NetworkActionParametersTest.java @@ -14,6 +14,7 @@ import com.powsybl.openrao.data.crac.api.usagerule.UsageMethod; import com.powsybl.openrao.data.crac.impl.utils.ExhaustiveCracCreation; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; import com.powsybl.openrao.searchtreerao.commons.NetworkActionCombination; import org.junit.jupiter.api.Test; import org.mockito.Mockito; @@ -37,14 +38,16 @@ class NetworkActionParametersTest { void buildFromRaoParametersTestOk() { crac = ExhaustiveCracCreation.create(); RaoParameters raoParameters = new RaoParameters(); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); - raoParameters.getTopoOptimizationParameters().setPredefinedCombinations(Collections.singletonList(List.of("complexNetworkActionId", "switchPairRaId"))); + searchTreeParameters.getTopoOptimizationParameters().setPredefinedCombinations(Collections.singletonList(List.of("complexNetworkActionId", "switchPairRaId"))); raoParameters.getTopoOptimizationParameters().setAbsoluteMinImpactThreshold(20.); raoParameters.getTopoOptimizationParameters().setRelativeMinImpactThreshold(0.01); - raoParameters.getTopoOptimizationParameters().setSkipActionsFarFromMostLimitingElement(true); - raoParameters.getTopoOptimizationParameters().setMaxNumberOfBoundariesForSkippingActions(4); + searchTreeParameters.getTopoOptimizationParameters().setSkipActionsFarFromMostLimitingElement(true); + searchTreeParameters.getTopoOptimizationParameters().setMaxNumberOfBoundariesForSkippingActions(4); - NetworkActionParameters nap = NetworkActionParameters.buildFromRaoParameters(raoParameters.getTopoOptimizationParameters(), crac); + NetworkActionParameters nap = NetworkActionParameters.buildFromRaoParameters(raoParameters, crac); assertEquals(1, nap.getNetworkActionCombinations().size()); assertEquals(2, nap.getNetworkActionCombinations().get(0).getNetworkActionSet().size()); @@ -99,17 +102,19 @@ void testNetworkActionCombinations() { // test list RaoParameters parameters = new RaoParameters(); + parameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = parameters.getExtension(OpenRaoSearchTreeParameters.class); - parameters.getTopoOptimizationParameters().setPredefinedCombinations(List.of( + searchTreeParameters.getTopoOptimizationParameters().setPredefinedCombinations(List.of( List.of("topological-action-1", "topological-action-2"), // OK List.of("topological-action-1", "topological-action-2", "pst-setpoint"), // OK List.of("topological-action-1", "unknown-na-id"), // should be filtered List.of("topological-action-1"), // should be filtered (one action only) new ArrayList<>())); // should be filtered - List naCombinations = NetworkActionParameters.computePredefinedCombinations(crac, parameters.getTopoOptimizationParameters()); + List naCombinations = NetworkActionParameters.computePredefinedCombinations(crac, parameters); - assertEquals(5, parameters.getTopoOptimizationParameters().getPredefinedCombinations().size()); + assertEquals(5, searchTreeParameters.getTopoOptimizationParameters().getPredefinedCombinations().size()); assertEquals(2, naCombinations.size()); assertEquals(2, naCombinations.get(0).getNetworkActionSet().size()); assertEquals(3, naCombinations.get(1).getNetworkActionSet().size()); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java index 060027af85..9f61473681 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParametersTest.java @@ -7,8 +7,9 @@ package com.powsybl.openrao.searchtreerao.commons.parameters; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -20,23 +21,26 @@ */ class TreeParametersTest { RaoParameters raoParameters; + OpenRaoSearchTreeParameters searchTreeParameters; + private static final double DOUBLE_TOLERANCE = 1e-6; @BeforeEach public void setUp() { raoParameters = new RaoParameters(); - raoParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(6); - raoParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(2); - raoParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(6); - raoParameters.getMultithreadingParameters().setPreventiveLeavesInParallel(4); - raoParameters.getMultithreadingParameters().setCurativeLeavesInParallel(2); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.DISABLED); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + searchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.DISABLED); + searchTreeParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(6); + searchTreeParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(2); + searchTreeParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(6); + searchTreeParameters.getMultithreadingParameters().setAvailableCPUs(4); } @Test void testPreventive() { // test with min objective - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); TreeParameters treeParameters = TreeParameters.buildForPreventivePerimeter(raoParameters); assertEquals(TreeParameters.StopCriterion.MIN_OBJECTIVE, treeParameters.stopCriterion()); @@ -45,12 +49,12 @@ void testPreventive() { assertFalse(treeParameters.raRangeShrinking()); // test with secure, and different values of the parameters - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getMultithreadingParameters().setPreventiveLeavesInParallel(8); - raoParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(15); - raoParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(5); - raoParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(15); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); + searchTreeParameters.getMultithreadingParameters().setAvailableCPUs(8); + searchTreeParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(15); + searchTreeParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(5); + searchTreeParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(15); + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); treeParameters = TreeParameters.buildForPreventivePerimeter(raoParameters); assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); @@ -59,77 +63,76 @@ void testPreventive() { assertEquals(15, treeParameters.maximumSearchDepth()); assertTrue(treeParameters.raRangeShrinking()); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); treeParameters = TreeParameters.buildForPreventivePerimeter(raoParameters); assertTrue(treeParameters.raRangeShrinking()); } @Test void testCurativeSecureStopCriterion() { - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); - raoParameters.getMultithreadingParameters().setCurativeLeavesInParallel(16); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); TreeParameters treeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, 100.0); assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); assertEquals(0., treeParameters.targetObjectiveValue(), DOUBLE_TOLERANCE); - assertEquals(16, treeParameters.leavesInParallel()); + assertEquals(1, treeParameters.leavesInParallel()); assertEquals(6, treeParameters.maximumSearchDepth()); assertTrue(treeParameters.raRangeShrinking()); } @Test void testCurativePreventiveObjectiveStopCriterion() { - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); - raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(35); - raoParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(0); - raoParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(0); - raoParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(0); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); + searchTreeParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(35); + searchTreeParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(0); + searchTreeParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(0); + searchTreeParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(0); + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); TreeParameters treeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, 100.0); assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); assertEquals(65, treeParameters.targetObjectiveValue(), DOUBLE_TOLERANCE); - assertEquals(2, treeParameters.leavesInParallel()); + assertEquals(1, treeParameters.leavesInParallel()); assertEquals(0, treeParameters.maximumSearchDepth()); assertTrue(treeParameters.raRangeShrinking()); } @Test void testCurativePreventiveObjectiveAndSecureStopCriterion() { - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); - raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(35); + searchTreeParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(35); // limited by secure TreeParameters treeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, 100.0); assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); assertEquals(0, treeParameters.targetObjectiveValue(), DOUBLE_TOLERANCE); - assertEquals(2, treeParameters.leavesInParallel()); + assertEquals(1, treeParameters.leavesInParallel()); assertEquals(6, treeParameters.maximumSearchDepth()); // limited by preventive_objective + minObjImprovement treeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, 30.0); assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); assertEquals(-5, treeParameters.targetObjectiveValue(), DOUBLE_TOLERANCE); - assertEquals(2, treeParameters.leavesInParallel()); + assertEquals(1, treeParameters.leavesInParallel()); assertEquals(6, treeParameters.maximumSearchDepth()); // limited by preventive_objective + minObjImprovement treeParameters = TreeParameters.buildForCurativePerimeter(raoParameters, -50.0); assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); assertEquals(-85, treeParameters.targetObjectiveValue(), DOUBLE_TOLERANCE); - assertEquals(2, treeParameters.leavesInParallel()); + assertEquals(1, treeParameters.leavesInParallel()); assertEquals(6, treeParameters.maximumSearchDepth()); } @Test void testSecondPreventive() { // test with min objective - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.DISABLED); + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.DISABLED); TreeParameters treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); assertEquals(TreeParameters.StopCriterion.MIN_OBJECTIVE, treeParameters.stopCriterion()); @@ -138,9 +141,9 @@ void testSecondPreventive() { assertFalse(treeParameters.raRangeShrinking()); // test with secure - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO); treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); @@ -150,9 +153,9 @@ void testSecondPreventive() { assertFalse(treeParameters.raRangeShrinking()); // other combinations - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); - raoParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); + searchTreeParameters.getRangeActionsOptimizationParameters().setRaRangeShrinking(SearchTreeRaoRangeActionsOptimizationParameters.RaRangeShrinking.ENABLED); treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); @@ -161,12 +164,12 @@ void testSecondPreventive() { assertTrue(treeParameters.raRangeShrinking()); // still another combination - raoParameters.getObjectiveFunctionParameters().setPreventiveStopCriterion(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW); raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); - raoParameters.getMultithreadingParameters().setPreventiveLeavesInParallel(8); - raoParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(15); - raoParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(5); - raoParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(15); + searchTreeParameters.getMultithreadingParameters().setAvailableCPUs(8); + searchTreeParameters.getTopoOptimizationParameters().setMaxPreventiveSearchTreeDepth(15); + searchTreeParameters.getTopoOptimizationParameters().setMaxAutoSearchTreeDepth(5); + searchTreeParameters.getTopoOptimizationParameters().setMaxCurativeSearchTreeDepth(15); treeParameters = TreeParameters.buildForSecondPreventivePerimeter(raoParameters); assertEquals(TreeParameters.StopCriterion.AT_TARGET_OBJECTIVE_VALUE, treeParameters.stopCriterion()); 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 658bab04fa..6efee155d4 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; @@ -16,7 +17,7 @@ import com.powsybl.openrao.data.crac.impl.utils.NetworkImportsUtil; import com.powsybl.openrao.data.raoresult.api.ComputationStatus; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.SensitivityComputer; import com.powsybl.openrao.searchtreerao.commons.adapter.BranchResultAdapter; import com.powsybl.openrao.searchtreerao.commons.adapter.SensitivityResultAdapter; @@ -100,14 +101,15 @@ public void setUp() { when(input.optimizationPerimeter()).thenReturn(optimizationPerimeter); parameters = Mockito.mock(IteratingLinearOptimizerParameters.class); - RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters = Mockito.mock(RangeActionsOptimizationParameters.LinearOptimizationSolver.class); - when(solverParameters.getSolver()).thenReturn(RangeActionsOptimizationParameters.Solver.CBC); + SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters = Mockito.mock(SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver.class); + when(solverParameters.getSolver()).thenReturn(SearchTreeRaoRangeActionsOptimizationParameters.Solver.CBC); when(parameters.getSolverParameters()).thenReturn(solverParameters); when(parameters.getMaxNumberOfIterations()).thenReturn(5); - 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); + SearchTreeRaoRangeActionsOptimizationParameters rangeActionParameters = Mockito.mock(SearchTreeRaoRangeActionsOptimizationParameters.class); + when(rangeActionParameters.getPstModel()).thenReturn(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); + when(parameters.getRangeActionParametersExtension()).thenReturn(rangeActionParameters); + 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 3fcc6e2c46..b4eee279e8 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,12 +7,15 @@ 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; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoMnecParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.MnecParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.CurativeOptimizationPerimeter; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.commons.parameters.RangeActionLimitationParameters; @@ -39,8 +42,9 @@ class LinearProblemBuilderTest { private LinearProblemBuilder linearProblemBuilder; private IteratingLinearOptimizerInput inputs; private IteratingLinearOptimizerParameters parameters; - private RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters; - private RangeActionsOptimizationParameters rangeActionParameters; + private SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters; + private com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters rangeActionParameters; + private SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension; private OptimizationPerimeter optimizationPerimeter; @BeforeEach @@ -49,17 +53,23 @@ public void setup() { inputs = Mockito.mock(IteratingLinearOptimizerInput.class); parameters = Mockito.mock(IteratingLinearOptimizerParameters.class); - solverParameters = Mockito.mock(RangeActionsOptimizationParameters.LinearOptimizationSolver.class); - when(solverParameters.getSolver()).thenReturn(RangeActionsOptimizationParameters.Solver.SCIP); + solverParameters = Mockito.mock(SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver.class); + when(solverParameters.getSolver()).thenReturn(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP); when(parameters.getSolverParameters()).thenReturn(solverParameters); - rangeActionParameters = Mockito.mock(RangeActionsOptimizationParameters.class); + rangeActionParameters = Mockito.mock(com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters.class); when(parameters.getRangeActionParameters()).thenReturn(rangeActionParameters); - RelativeMarginsParametersExtension relativeMarginParameters = Mockito.mock(RelativeMarginsParametersExtension.class); + rangeActionParametersExtension = Mockito.mock(SearchTreeRaoRangeActionsOptimizationParameters.class); + when(parameters.getRangeActionParametersExtension()).thenReturn(rangeActionParametersExtension); + SearchTreeRaoRelativeMarginsParameters relativeMarginParameters = Mockito.mock(SearchTreeRaoRelativeMarginsParameters.class); when(parameters.getMaxMinRelativeMarginParameters()).thenReturn(relativeMarginParameters); - MnecParametersExtension mnecParameters = Mockito.mock(MnecParametersExtension.class); + MnecParameters mnecParameters = Mockito.mock(MnecParameters.class); when(parameters.getMnecParameters()).thenReturn(mnecParameters); - LoopFlowParametersExtension loopFlowParameters = Mockito.mock(LoopFlowParametersExtension.class); + SearchTreeRaoMnecParameters mnecParametersExtension = Mockito.mock(SearchTreeRaoMnecParameters.class); + when(parameters.getMnecParametersExtension()).thenReturn(mnecParametersExtension); + LoopFlowParameters loopFlowParameters = Mockito.mock(LoopFlowParameters.class); when(parameters.getLoopFlowParameters()).thenReturn(loopFlowParameters); + SearchTreeRaoLoopFlowParameters loopFlowParametersExtension = Mockito.mock(SearchTreeRaoLoopFlowParameters.class); + when(parameters.getLoopFlowParametersExtension()).thenReturn(loopFlowParametersExtension); optimizationPerimeter = Mockito.mock(CurativeOptimizationPerimeter.class); when(inputs.optimizationPerimeter()).thenReturn(optimizationPerimeter); @@ -68,8 +78,9 @@ 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(rangeActionParametersExtension.getPstModel()).thenReturn(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); + when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); LinearProblem linearProblem = linearProblemBuilder.buildFromInputsAndParameters(inputs, parameters); assertNotNull(linearProblem); @@ -82,8 +93,9 @@ 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(rangeActionParametersExtension.getPstModel()).thenReturn(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); LinearProblem linearProblem = linearProblemBuilder.buildFromInputsAndParameters(inputs, parameters); assertNotNull(linearProblem); @@ -98,8 +110,9 @@ 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(rangeActionParametersExtension.getPstModel()).thenReturn(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); + when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); + when(parameters.getObjectiveFunctionUnit()).thenReturn(Unit.MEGAWATT); LinearProblem linearProblem = linearProblemBuilder.buildFromInputsAndParameters(inputs, parameters); assertNotNull(linearProblem); @@ -112,8 +125,11 @@ void testBuildMaxRelativeMarginContinuous() { @Test void testBuildMaxMarginContinuousMnecLoopflowUnoptimized() { - when(rangeActionParameters.getPstModel()).thenReturn(RangeActionsOptimizationParameters.PstModel.CONTINUOUS); - when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); + when(rangeActionParametersExtension.getPstModel()).thenReturn(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); + 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)); @@ -132,8 +148,9 @@ void testBuildMaxMarginContinuousMnecLoopflowUnoptimized() { @Test void testBuildMaxMarginContinuousRaLimitation() { - when(rangeActionParameters.getPstModel()).thenReturn(RangeActionsOptimizationParameters.PstModel.CONTINUOUS); - when(parameters.getObjectiveFunction()).thenReturn(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT); + when(rangeActionParametersExtension.getPstModel()).thenReturn(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); + 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/LinearProblemTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/LinearProblemTest.java index 40ece9cb58..644bd09c8c 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/LinearProblemTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/LinearProblemTest.java @@ -12,7 +12,7 @@ import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.api.rangeaction.PstRangeAction; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblem; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblemBuilder; import org.junit.jupiter.api.BeforeEach; @@ -48,7 +48,7 @@ class LinearProblemTest { @BeforeEach public void setUp() { - linearProblem = new LinearProblemBuilder().withSolver(RangeActionsOptimizationParameters.Solver.SCIP).build(); + linearProblem = new LinearProblemBuilder().withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP).build(); rangeAction = Mockito.mock(PstRangeAction.class); cnec = Mockito.mock(FlowCnec.class); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/ContinuousRangeActionGroupFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/ContinuousRangeActionGroupFillerTest.java index 3e68afc908..6a12df6b43 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/ContinuousRangeActionGroupFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/ContinuousRangeActionGroupFillerTest.java @@ -10,8 +10,8 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.openrao.data.crac.api.rangeaction.PstRangeAction; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPConstraint; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPVariable; @@ -57,14 +57,15 @@ void testFillAndUpdateMethods() throws IOException { rangeActions.put(state, Set.of(pstRa1, pstRa2)); Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(new RaoParameters()); - MarginCoreProblemFiller coreProblemFiller = new MarginCoreProblemFiller( optimizationPerimeter, initialRangeActionSetpointResult, - rangeActionParameters, + (new RaoParameters()).getRangeActionsOptimizationParameters(), + null, Unit.MEGAWATT, - false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS, null); + false, + SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS, + null); ContinuousRangeActionGroupFiller continuousRangeActionGroupFiller = new ContinuousRangeActionGroupFiller( rangeActions, null); @@ -72,7 +73,7 @@ void testFillAndUpdateMethods() throws IOException { LinearProblem linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(continuousRangeActionGroupFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .build(); // fill problem diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/CostCoreProblemFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/CostCoreProblemFillerTest.java index e3f27c389e..fc22eee70f 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/CostCoreProblemFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/CostCoreProblemFillerTest.java @@ -16,6 +16,8 @@ import com.powsybl.openrao.data.raoresult.api.ComputationStatus; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblem; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblemBuilder; @@ -66,21 +68,21 @@ public void setUp() throws IOException { private void buildLinearProblem() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .withInitialRangeActionActivationResult(getInitialRangeActionActivationResult()) .build(); linearProblem.fill(flowResult, sensitivityResult); } private void initializeForPreventive(double pstSensitivityThreshold, double hvdcSensitivityThreshold, double injectionSensitivityThreshold) { - initialize(Set.of(cnec1), pstSensitivityThreshold, hvdcSensitivityThreshold, injectionSensitivityThreshold, crac.getPreventiveState(), false, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initialize(Set.of(cnec1), pstSensitivityThreshold, hvdcSensitivityThreshold, injectionSensitivityThreshold, crac.getPreventiveState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); } - private void initializeForGlobal(RangeActionsOptimizationParameters.PstModel pstModel) { + private void initializeForGlobal(SearchTreeRaoRangeActionsOptimizationParameters.PstModel pstModel) { initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, crac.getPreventiveState(), false, pstModel); } - private void initialize(Set cnecs, double pstSensitivityThreshold, double hvdcSensitivityThreshold, double injectionSensitivityThreshold, State mainState, boolean raRangeShrinking, RangeActionsOptimizationParameters.PstModel pstModel) { + private void initialize(Set cnecs, double pstSensitivityThreshold, double hvdcSensitivityThreshold, double injectionSensitivityThreshold, State mainState, boolean raRangeShrinking, SearchTreeRaoRangeActionsOptimizationParameters.PstModel pstModel) { OptimizationPerimeter optimizationPerimeter = Mockito.mock(OptimizationPerimeter.class); Mockito.when(optimizationPerimeter.getFlowCnecs()).thenReturn(cnecs); Mockito.when(optimizationPerimeter.getMainOptimizationState()).thenReturn(mainState); @@ -90,16 +92,22 @@ private void initialize(Set cnecs, double pstSensitivityThreshold, dou Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); RaoParameters raoParameters = new RaoParameters(); - raoParameters.getRangeActionsOptimizationParameters().setPstSensitivityThreshold(pstSensitivityThreshold); - raoParameters.getRangeActionsOptimizationParameters().setHvdcSensitivityThreshold(hvdcSensitivityThreshold); - raoParameters.getRangeActionsOptimizationParameters().setInjectionRaSensitivityThreshold(injectionSensitivityThreshold); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); + OpenRaoSearchTreeParameters searchTreeParameters = new OpenRaoSearchTreeParameters(); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, searchTreeParameters); + searchTreeParameters.getRangeActionsOptimizationParameters().setPstSensitivityThreshold(pstSensitivityThreshold); + searchTreeParameters.getRangeActionsOptimizationParameters().setHvdcSensitivityThreshold(hvdcSensitivityThreshold); + searchTreeParameters.getRangeActionsOptimizationParameters().setInjectionRaSensitivityThreshold(injectionSensitivityThreshold); + RangeActionsOptimizationParameters rangeActionParameters = raoParameters.getRangeActionsOptimizationParameters(); coreProblemFiller = new CostCoreProblemFiller( optimizationPerimeter, initialRangeActionSetpointResult, rangeActionParameters, - Unit.MEGAWATT, raRangeShrinking, pstModel, null); + searchTreeParameters.getRangeActionsOptimizationParameters(), + Unit.MEGAWATT, + raRangeShrinking, + pstModel, + null); buildLinearProblem(); } @@ -271,7 +279,7 @@ void fillTestOnPreventiveFiltered() { @Test void fillTestOnCurative() { - initialize(Set.of(cnec2), 1e-6, 1e-6, 1e-6, cnec2.getState(), false, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initialize(Set.of(cnec2), 1e-6, 1e-6, 1e-6, cnec2.getState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); State state = cnec2.getState(); // check range action setpoint variable @@ -354,13 +362,13 @@ void fillTestOnCurative() { @Test void testContinuousPstMode() { - OpenRaoException exception = assertThrows(OpenRaoException.class, () -> initializeForGlobal(RangeActionsOptimizationParameters.PstModel.CONTINUOUS)); + OpenRaoException exception = assertThrows(OpenRaoException.class, () -> initializeForGlobal(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS)); assertEquals("Costly remedial action optimization is only available for the APPROXIMATED_INTEGERS mode of PST range actions.", exception.getMessage()); } @Test void fillTestOnGlobal() { - initializeForGlobal(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initializeForGlobal(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); State prevState = cnec1.getState(); State curState = cnec2.getState(); @@ -557,7 +565,7 @@ void updateTestOnPreventive() { @Test void updateTestOnPreventiveWithRaRangeShrinking() { - initialize(Set.of(cnec1), 1e-6, 1e-6, 1e-6, crac.getPreventiveState(), true, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initialize(Set.of(cnec1), 1e-6, 1e-6, 1e-6, crac.getPreventiveState(), true, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); State state = cnec1.getState(); Exception e = assertThrows(OpenRaoException.class, () -> linearProblem.getRangeActionRelativeSetpointConstraint(pstRangeAction, state, LinearProblem.RaRangeShrinking.TRUE, Optional.empty())); @@ -592,7 +600,7 @@ void updateTestOnPreventiveWithRaRangeShrinking() { @Test void updateTestOnCurativeWithRaRangeShrinking() { - initialize(Set.of(cnec2), 1e-6, 1e-6, 1e-6, cnec2.getState(), true, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initialize(Set.of(cnec2), 1e-6, 1e-6, 1e-6, cnec2.getState(), true, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); State state = cnec2.getState(); // update the problem with new data updateLinearProblem(); @@ -647,7 +655,7 @@ void testSensitivityFilter1() { // (sensi = 2) < 2.5 should be filtered when(flowResult.getMargin(cnec1, Unit.MEGAWATT)).thenReturn(-1.0); - initialize(Set.of(cnec1), 2.5, 2.5, 2.5, crac.getPreventiveState(), false, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initialize(Set.of(cnec1), 2.5, 2.5, 2.5, crac.getPreventiveState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); flowConstraint = linearProblem.getFlowConstraint(cnec1, TwoSides.ONE, Optional.empty()); rangeActionSetpoint = linearProblem.getRangeActionSetpointVariable(pstRangeAction, cnec1.getState(), Optional.empty()); assertEquals(0, flowConstraint.getCoefficient(rangeActionSetpoint), DOUBLE_TOLERANCE); @@ -664,7 +672,7 @@ void testSensitivityFilter2() { // (sensi = 2) > 1/.5 should not be filtered when(flowResult.getMargin(cnec1, TwoSides.ONE, Unit.MEGAWATT)).thenReturn(-1.0); - initialize(Set.of(cnec1), 1.5, 1.5, 1.5, crac.getPreventiveState(), false, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initialize(Set.of(cnec1), 1.5, 1.5, 1.5, crac.getPreventiveState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); flowConstraint = linearProblem.getFlowConstraint(cnec1, TwoSides.ONE, Optional.empty()); rangeActionSetpoint = linearProblem.getRangeActionSetpointVariable(pstRangeAction, cnec1.getState(), Optional.empty()); assertEquals(-2, flowConstraint.getCoefficient(rangeActionSetpoint), DOUBLE_TOLERANCE); @@ -678,7 +686,7 @@ void testFilterCnecWithSensiFailure() { // only cnec2's flow variables & constraints must be added to MIP when(sensitivityResult.getSensitivityStatus(cnec1.getState())).thenReturn(ComputationStatus.FAILURE); when(sensitivityResult.getSensitivityStatus(cnec2.getState())).thenReturn(ComputationStatus.DEFAULT); - initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); OpenRaoMPVariable setPointVariable = linearProblem.getRangeActionSetpointVariable(pstRangeAction, cnec2.getState(), Optional.empty()); @@ -711,7 +719,7 @@ void testFilterCnecWithSensiFailureAndUpdateWithoutChange() { // only cnec2's flow variables & constraints must be added to MIP when(sensitivityResult.getSensitivityStatus(cnec1.getState())).thenReturn(ComputationStatus.FAILURE); when(sensitivityResult.getSensitivityStatus(cnec2.getState())).thenReturn(ComputationStatus.DEFAULT); - initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); updateLinearProblem(); @@ -746,7 +754,7 @@ void testFilterCnecWithSensiFailureAndUpdateWithChange() { // only cnec2's flow variables & constraints must be added to MIP when(sensitivityResult.getSensitivityStatus(cnec1.getState())).thenReturn(ComputationStatus.FAILURE); when(sensitivityResult.getSensitivityStatus(cnec2.getState())).thenReturn(ComputationStatus.DEFAULT); - initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); + initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS); // invert sensitivity failure statuses & update // only cnec1's flow variables & constraints must be added to MIP diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstGroupFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstGroupFillerTest.java index b979e34a50..e01a233c5a 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstGroupFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstGroupFillerTest.java @@ -11,6 +11,8 @@ import com.powsybl.openrao.data.crac.api.rangeaction.PstRangeAction; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.PstModel; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.Solver; import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPConstraint; @@ -59,14 +61,17 @@ void testFillAndUpdateMethods() throws IOException { rangeActions.put(state, Set.of(pstRa1, pstRa2)); Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(new RaoParameters()); + RangeActionsOptimizationParameters rangeActionParameters = (new RaoParameters()).getRangeActionsOptimizationParameters(); MarginCoreProblemFiller coreProblemFiller = new MarginCoreProblemFiller( optimizationPerimeter, initialRangeActionSetpointResult, - rangeActionParameters, + rangeActionParameters, + null, Unit.MEGAWATT, - false, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS, null); + false, + PstModel.APPROXIMATED_INTEGERS, + null); Map> pstRangeActions = new HashMap<>(); pstRangeActions.put(state, Set.of(pstRa1, pstRa2)); @@ -85,7 +90,7 @@ void testFillAndUpdateMethods() throws IOException { .withProblemFiller(coreProblemFiller) .withProblemFiller(discretePstTapFiller) .withProblemFiller(discretePstGroupFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .withInitialRangeActionActivationResult(getInitialRangeActionActivationResult()) .build(); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstTapFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstTapFillerTest.java index a5417e4cb8..7374c4469e 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstTapFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/DiscretePstTapFillerTest.java @@ -12,6 +12,8 @@ import com.powsybl.openrao.data.crac.api.rangeaction.PstRangeAction; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.PstModel; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.Solver; import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblem; @@ -81,14 +83,17 @@ void setUpAndFill(boolean costOptimization) throws IOException { Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); Mockito.when(optimizationPerimeter.getMainOptimizationState()).thenReturn(preventiveState); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(new RaoParameters()); + RangeActionsOptimizationParameters rangeActionParameters = (new RaoParameters()).getRangeActionsOptimizationParameters(); MarginCoreProblemFiller coreProblemFiller = new MarginCoreProblemFiller( optimizationPerimeter, initialRangeActionSetpointResult, rangeActionParameters, + null, Unit.MEGAWATT, - false, RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS, null); + false, + PstModel.APPROXIMATED_INTEGERS, + null); Map> pstRangeActions = new HashMap<>(); pstRangeActions.put(preventiveState, Set.of(pstRangeAction)); @@ -97,13 +102,13 @@ void setUpAndFill(boolean costOptimization) throws IOException { optimizationPerimeter, pstRangeActions, initialRangeActionSetpointResult, - new RangeActionsOptimizationParameters(), + rangeActionParameters, true, null); linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(discretePstTapFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .withInitialRangeActionActivationResult(getInitialRangeActionActivationResult()) .build(); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MarginCoreProblemFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MarginCoreProblemFillerTest.java index 1417ebc167..1a39d95dff 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MarginCoreProblemFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MarginCoreProblemFillerTest.java @@ -13,8 +13,9 @@ import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.data.raoresult.api.ComputationStatus; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblem; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblemBuilder; @@ -66,21 +67,21 @@ public void setUp() throws IOException { private void buildLinearProblem() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .withInitialRangeActionActivationResult(getInitialRangeActionActivationResult()) .build(); linearProblem.fill(flowResult, sensitivityResult); } private void initializeForPreventive(double pstSensitivityThreshold, double hvdcSensitivityThreshold, double injectionSensitivityThreshold) { - initialize(Set.of(cnec1), pstSensitivityThreshold, hvdcSensitivityThreshold, injectionSensitivityThreshold, crac.getPreventiveState(), false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + initialize(Set.of(cnec1), pstSensitivityThreshold, hvdcSensitivityThreshold, injectionSensitivityThreshold, crac.getPreventiveState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); } - private void initializeForGlobal(RangeActionsOptimizationParameters.PstModel pstModel) { + private void initializeForGlobal(SearchTreeRaoRangeActionsOptimizationParameters.PstModel pstModel) { initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, crac.getPreventiveState(), false, pstModel); } - private void initialize(Set cnecs, double pstSensitivityThreshold, double hvdcSensitivityThreshold, double injectionSensitivityThreshold, State mainState, boolean raRangeShrinking, RangeActionsOptimizationParameters.PstModel pstModel) { + private void initialize(Set cnecs, double pstSensitivityThreshold, double hvdcSensitivityThreshold, double injectionSensitivityThreshold, State mainState, boolean raRangeShrinking, SearchTreeRaoRangeActionsOptimizationParameters.PstModel pstModel) { OptimizationPerimeter optimizationPerimeter = Mockito.mock(OptimizationPerimeter.class); Mockito.when(optimizationPerimeter.getFlowCnecs()).thenReturn(cnecs); Mockito.when(optimizationPerimeter.getMainOptimizationState()).thenReturn(mainState); @@ -90,16 +91,21 @@ private void initialize(Set cnecs, double pstSensitivityThreshold, dou Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); RaoParameters raoParameters = new RaoParameters(); - raoParameters.getRangeActionsOptimizationParameters().setPstSensitivityThreshold(pstSensitivityThreshold); - raoParameters.getRangeActionsOptimizationParameters().setHvdcSensitivityThreshold(hvdcSensitivityThreshold); - raoParameters.getRangeActionsOptimizationParameters().setInjectionRaSensitivityThreshold(injectionSensitivityThreshold); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters searchTreeParameters = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); + searchTreeParameters.getRangeActionsOptimizationParameters().setPstSensitivityThreshold(pstSensitivityThreshold); + searchTreeParameters.getRangeActionsOptimizationParameters().setHvdcSensitivityThreshold(hvdcSensitivityThreshold); + searchTreeParameters.getRangeActionsOptimizationParameters().setInjectionRaSensitivityThreshold(injectionSensitivityThreshold); coreProblemFiller = new MarginCoreProblemFiller( optimizationPerimeter, initialRangeActionSetpointResult, - rangeActionParameters, - Unit.MEGAWATT, raRangeShrinking, pstModel, null); + raoParameters.getRangeActionsOptimizationParameters(), + searchTreeParameters.getRangeActionsOptimizationParameters(), + Unit.MEGAWATT, + raRangeShrinking, + pstModel, + null); buildLinearProblem(); } @@ -263,7 +269,7 @@ void fillTestOnPreventiveFiltered() { @Test void fillTestOnCurative() { - initialize(Set.of(cnec2), 1e-6, 1e-6, 1e-6, cnec2.getState(), false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + initialize(Set.of(cnec2), 1e-6, 1e-6, 1e-6, cnec2.getState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); State state = cnec2.getState(); // check range action setpoint variable @@ -341,13 +347,13 @@ void fillTestOnCurative() { } @ParameterizedTest - @EnumSource(value = RangeActionsOptimizationParameters.PstModel.class) - void fillTestOnGlobal(RangeActionsOptimizationParameters.PstModel pstModel) { + @EnumSource(value = SearchTreeRaoRangeActionsOptimizationParameters.PstModel.class) + void fillTestOnGlobal(SearchTreeRaoRangeActionsOptimizationParameters.PstModel pstModel) { initializeForGlobal(pstModel); State prevState = cnec1.getState(); State curState = cnec2.getState(); - if (pstModel.equals(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS)) { + if (pstModel.equals(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS)) { // check relative setpoint constraint for PRA_PST_BE has not been created in curative. Exception e = assertThrows(OpenRaoException.class, () -> linearProblem.getRangeActionRelativeSetpointConstraint(pstRangeAction, curState, LinearProblem.RaRangeShrinking.FALSE, Optional.empty())); assertEquals("Constraint PRA_PST_BE_N-1 NL1-NL3 - curative_relative_setpoint_constraint has not been created yet", e.getMessage()); @@ -473,7 +479,7 @@ void fillTestOnGlobal(RangeActionsOptimizationParameters.PstModel pstModel) { // - 2 per range action (set-point and absolute variation constraints) // - 0 or 1 for curative range action (relative variation constraint) assertEquals(10, linearProblem.numVariables()); - if (pstModel.equals(RangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS)) { + if (pstModel.equals(SearchTreeRaoRangeActionsOptimizationParameters.PstModel.APPROXIMATED_INTEGERS)) { assertEquals(6, linearProblem.numConstraints()); } else { assertEquals(7, linearProblem.numConstraints()); @@ -544,7 +550,7 @@ void updateTestOnPreventive() { @Test void updateTestOnPreventiveWithRaRangeShrinking() { - initialize(Set.of(cnec1), 1e-6, 1e-6, 1e-6, crac.getPreventiveState(), true, RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + initialize(Set.of(cnec1), 1e-6, 1e-6, 1e-6, crac.getPreventiveState(), true, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); State state = cnec1.getState(); Exception e = assertThrows(OpenRaoException.class, () -> linearProblem.getRangeActionRelativeSetpointConstraint(pstRangeAction, state, LinearProblem.RaRangeShrinking.TRUE, Optional.empty())); @@ -579,7 +585,7 @@ void updateTestOnPreventiveWithRaRangeShrinking() { @Test void updateTestOnCurativeWithRaRangeShrinking() { - initialize(Set.of(cnec2), 1e-6, 1e-6, 1e-6, cnec2.getState(), true, RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + initialize(Set.of(cnec2), 1e-6, 1e-6, 1e-6, cnec2.getState(), true, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); State state = cnec2.getState(); // update the problem with new data updateLinearProblem(); @@ -634,7 +640,7 @@ void testSensitivityFilter1() { // (sensi = 2) < 2.5 should be filtered when(flowResult.getMargin(cnec1, Unit.MEGAWATT)).thenReturn(-1.0); - initialize(Set.of(cnec1), 2.5, 2.5, 2.5, crac.getPreventiveState(), false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + initialize(Set.of(cnec1), 2.5, 2.5, 2.5, crac.getPreventiveState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); flowConstraint = linearProblem.getFlowConstraint(cnec1, TwoSides.ONE, Optional.empty()); rangeActionSetpoint = linearProblem.getRangeActionSetpointVariable(pstRangeAction, cnec1.getState(), Optional.empty()); assertEquals(0, flowConstraint.getCoefficient(rangeActionSetpoint), DOUBLE_TOLERANCE); @@ -651,7 +657,7 @@ void testSensitivityFilter2() { // (sensi = 2) > 1/.5 should not be filtered when(flowResult.getMargin(cnec1, TwoSides.ONE, Unit.MEGAWATT)).thenReturn(-1.0); - initialize(Set.of(cnec1), 1.5, 1.5, 1.5, crac.getPreventiveState(), false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + initialize(Set.of(cnec1), 1.5, 1.5, 1.5, crac.getPreventiveState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); flowConstraint = linearProblem.getFlowConstraint(cnec1, TwoSides.ONE, Optional.empty()); rangeActionSetpoint = linearProblem.getRangeActionSetpointVariable(pstRangeAction, cnec1.getState(), Optional.empty()); assertEquals(-2, flowConstraint.getCoefficient(rangeActionSetpoint), DOUBLE_TOLERANCE); @@ -665,7 +671,7 @@ void testFilterCnecWithSensiFailure() { // only cnec2's flow variables & constraints must be added to MIP when(sensitivityResult.getSensitivityStatus(cnec1.getState())).thenReturn(ComputationStatus.FAILURE); when(sensitivityResult.getSensitivityStatus(cnec2.getState())).thenReturn(ComputationStatus.DEFAULT); - initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); OpenRaoMPVariable setPointVariable = linearProblem.getRangeActionSetpointVariable(pstRangeAction, cnec2.getState(), Optional.empty()); @@ -698,7 +704,7 @@ void testFilterCnecWithSensiFailureAndUpdateWithoutChange() { // only cnec2's flow variables & constraints must be added to MIP when(sensitivityResult.getSensitivityStatus(cnec1.getState())).thenReturn(ComputationStatus.FAILURE); when(sensitivityResult.getSensitivityStatus(cnec2.getState())).thenReturn(ComputationStatus.DEFAULT); - initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); updateLinearProblem(); @@ -733,7 +739,7 @@ void testFilterCnecWithSensiFailureAndUpdateWithChange() { // only cnec2's flow variables & constraints must be added to MIP when(sensitivityResult.getSensitivityStatus(cnec1.getState())).thenReturn(ComputationStatus.FAILURE); when(sensitivityResult.getSensitivityStatus(cnec2.getState())).thenReturn(ComputationStatus.DEFAULT); - initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS); + initialize(Set.of(cnec1, cnec2), 1e-6, 1e-6, 1e-6, cnec1.getState(), false, SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS); // invert sensitivity failure statuses & update // only cnec1's flow variables & constraints must be added to MIP diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxLoopFlowFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxLoopFlowFillerTest.java index ad7a60c892..3b38b78b3e 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxLoopFlowFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxLoopFlowFillerTest.java @@ -16,7 +16,9 @@ import com.powsybl.openrao.data.crac.loopflowextension.LoopFlowThresholdAdder; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoLoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; import com.powsybl.openrao.raoapi.parameters.extensions.PtdfApproximation; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPConstraint; @@ -48,7 +50,8 @@ class MaxLoopFlowFillerTest extends AbstractFillerTest { private LinearProblem linearProblem; private MarginCoreProblemFiller coreProblemFiller; private MaxLoopFlowFiller maxLoopFlowFiller; - private LoopFlowParametersExtension loopFlowParameters; + private LoopFlowParameters loopFlowParameters; + private SearchTreeRaoLoopFlowParameters loopFlowParametersExtension; private FlowCnec cnecOn2sides; @BeforeEach @@ -74,14 +77,17 @@ public void setUp() throws IOException { rangeActions.put(state, Set.of(pstRangeAction)); Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(new RaoParameters()); + RangeActionsOptimizationParameters rangeActionParameters = (new RaoParameters()).getRangeActionsOptimizationParameters(); coreProblemFiller = new MarginCoreProblemFiller( optimizationPerimeter, initialRangeActionSetpointResult, - rangeActionParameters, + rangeActionParameters, + null, Unit.MEGAWATT, - false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS, - null); + false, + SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS, + null + ); cnec1.newExtension(LoopFlowThresholdAdder.class).withValue(100.).withUnit(Unit.MEGAWATT).add(); } @@ -89,10 +95,12 @@ private void createMaxLoopFlowFiller(double initialLoopFlowValue) { FlowResult initialFlowResult = Mockito.mock(FlowResult.class); when(initialFlowResult.getLoopFlow(cnec1, TwoSides.ONE, Unit.MEGAWATT)).thenReturn(initialLoopFlowValue); maxLoopFlowFiller = new MaxLoopFlowFiller( - Set.of(cnec1), - initialFlowResult, - loopFlowParameters, - null); + Set.of(cnec1), + initialFlowResult, + loopFlowParameters, + loopFlowParametersExtension, + null + ); } private void setCommercialFlowValue(double commercialFlowValue) { @@ -103,7 +111,7 @@ private void buildLinearProblem() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(maxLoopFlowFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .withInitialRangeActionActivationResult(getInitialRangeActionActivationResult()) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -115,11 +123,12 @@ private void updateLinearProblem() { @Test void testFill1() { - loopFlowParameters = new LoopFlowParametersExtension(); - loopFlowParameters.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); + loopFlowParameters = new LoopFlowParameters(); + loopFlowParametersExtension = new SearchTreeRaoLoopFlowParameters(); + loopFlowParametersExtension.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); loopFlowParameters.setAcceptableIncrease(13); - loopFlowParameters.setViolationCost(10); - loopFlowParameters.setConstraintAdjustmentCoefficient(5); + loopFlowParametersExtension.setViolationCost(10); + loopFlowParametersExtension.setConstraintAdjustmentCoefficient(5); createMaxLoopFlowFiller(0); setCommercialFlowValue(49); @@ -145,11 +154,12 @@ void testFill1() { @Test void testFill2() { - loopFlowParameters = new LoopFlowParametersExtension(); - loopFlowParameters.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); + loopFlowParameters = new LoopFlowParameters(); + loopFlowParametersExtension = new SearchTreeRaoLoopFlowParameters(); + loopFlowParametersExtension.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); loopFlowParameters.setAcceptableIncrease(30); - loopFlowParameters.setViolationCost(10); - loopFlowParameters.setConstraintAdjustmentCoefficient(5); + loopFlowParametersExtension.setViolationCost(10); + loopFlowParametersExtension.setConstraintAdjustmentCoefficient(5); createMaxLoopFlowFiller(80); setCommercialFlowValue(49); @@ -172,11 +182,12 @@ void testFill2() { @Test void testShouldUpdate() { - loopFlowParameters = new LoopFlowParametersExtension(); - loopFlowParameters.setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO_AND_PST); + loopFlowParameters = new LoopFlowParameters(); + loopFlowParametersExtension = new SearchTreeRaoLoopFlowParameters(); + loopFlowParametersExtension.setPtdfApproximation(PtdfApproximation.UPDATE_PTDF_WITH_TOPO_AND_PST); loopFlowParameters.setAcceptableIncrease(0); - loopFlowParameters.setViolationCost(10); - loopFlowParameters.setConstraintAdjustmentCoefficient(5); + loopFlowParametersExtension.setViolationCost(10); + loopFlowParametersExtension.setConstraintAdjustmentCoefficient(5); createMaxLoopFlowFiller(0); setCommercialFlowValue(49); @@ -200,11 +211,12 @@ void testShouldUpdate() { @Test void testFill2Sides() { - loopFlowParameters = new LoopFlowParametersExtension(); - loopFlowParameters.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); + loopFlowParameters = new LoopFlowParameters(); + loopFlowParametersExtension = new SearchTreeRaoLoopFlowParameters(); + loopFlowParametersExtension.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); loopFlowParameters.setAcceptableIncrease(13); - loopFlowParameters.setViolationCost(10); - loopFlowParameters.setConstraintAdjustmentCoefficient(5); + loopFlowParametersExtension.setViolationCost(10); + loopFlowParametersExtension.setConstraintAdjustmentCoefficient(5); FlowResult initialFlowResult = Mockito.mock(FlowResult.class); when(initialFlowResult.getLoopFlow(cnecOn2sides, TwoSides.ONE, Unit.MEGAWATT)).thenReturn(0.); @@ -213,7 +225,9 @@ void testFill2Sides() { Set.of(cnecOn2sides), initialFlowResult, loopFlowParameters, - null); + loopFlowParametersExtension, + null + ); when(flowResult.getCommercialFlow(cnecOn2sides, TwoSides.ONE, Unit.MEGAWATT)).thenReturn(49.); when(flowResult.getCommercialFlow(cnecOn2sides, TwoSides.TWO, Unit.MEGAWATT)).thenReturn(69.); @@ -255,11 +269,12 @@ void testFill2Sides() { @Test void testFilterCnecWithNoInitialFlow() { - loopFlowParameters = new LoopFlowParametersExtension(); - loopFlowParameters.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); + loopFlowParameters = new LoopFlowParameters(); + loopFlowParametersExtension = new SearchTreeRaoLoopFlowParameters(); + loopFlowParametersExtension.setPtdfApproximation(PtdfApproximation.FIXED_PTDF); loopFlowParameters.setAcceptableIncrease(13); - loopFlowParameters.setViolationCost(10); - loopFlowParameters.setConstraintAdjustmentCoefficient(5); + loopFlowParametersExtension.setViolationCost(10); + loopFlowParametersExtension.setConstraintAdjustmentCoefficient(5); FlowResult initialFlowResult = Mockito.mock(FlowResult.class); when(initialFlowResult.getLoopFlow(cnec1, TwoSides.ONE, Unit.MEGAWATT)).thenReturn(90.); @@ -268,7 +283,9 @@ void testFilterCnecWithNoInitialFlow() { Set.of(cnec1), initialFlowResult, loopFlowParameters, - null); + loopFlowParametersExtension, + null + ); setCommercialFlowValue(49); buildLinearProblem(); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinMarginFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinMarginFillerTest.java index f9f4ae2404..819b9d01e1 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinMarginFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MaxMinMarginFillerTest.java @@ -11,8 +11,8 @@ import com.powsybl.openrao.data.crac.api.State; import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPConstraint; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPVariable; @@ -57,17 +57,19 @@ public void setUp() throws IOException { Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); RaoParameters raoParameters = new RaoParameters(); - raoParameters.getRangeActionsOptimizationParameters().setPstPenaltyCost(0.01); - raoParameters.getRangeActionsOptimizationParameters().setHvdcPenaltyCost(0.01); - raoParameters.getRangeActionsOptimizationParameters().setInjectionRaPenaltyCost(0.01); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); + raoParameters.getRangeActionsOptimizationParameters().setPstRAMinImpactThreshold(0.01); + raoParameters.getRangeActionsOptimizationParameters().setHvdcRAMinImpactThreshold(0.01); + raoParameters.getRangeActionsOptimizationParameters().setInjectionRAMinImpactThreshold(0.01); coreProblemFiller = new MarginCoreProblemFiller( optimizationPerimeter, initialRangeActionSetpointResult, - rangeActionParameters, + raoParameters.getRangeActionsOptimizationParameters(), + null, Unit.MEGAWATT, - false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS, null); + false, + SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS, + null); } private void createMaxMinMarginFiller(Unit unit) { @@ -78,7 +80,7 @@ private void buildLinearProblem() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(maxMinMarginFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .withInitialRangeActionActivationResult(getInitialRangeActionActivationResult()) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -168,7 +170,7 @@ void fillWithMissingFlowVariables() { createMaxMinMarginFiller(Unit.MEGAWATT); linearProblem = new LinearProblemBuilder() .withProblemFiller(maxMinMarginFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .build(); // AbsoluteRangeActionVariables present, but no the FlowVariables @@ -183,7 +185,7 @@ void fillWithMissingRangeActionVariables() { createMaxMinMarginFiller(Unit.MEGAWATT); linearProblem = new LinearProblemBuilder() .withProblemFiller(maxMinMarginFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .build(); // FlowVariables present , but not the absoluteRangeActionVariables present, 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 e79dbb9a41..21fbac6360 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 @@ -12,10 +12,11 @@ import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; import com.powsybl.openrao.raoapi.parameters.extensions.PtdfApproximation; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPConstraint; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPVariable; @@ -51,7 +52,7 @@ class MaxMinRelativeMarginFillerTest extends AbstractFillerTest { private LinearProblem linearProblem; private MarginCoreProblemFiller coreProblemFiller; private MaxMinRelativeMarginFiller maxMinRelativeMarginFiller; - private RelativeMarginsParametersExtension parameters; + private SearchTreeRaoRelativeMarginsParameters parameters; private RangeActionSetpointResult initialRangeActionSetpointResult; @BeforeEach @@ -69,21 +70,26 @@ public void setUp() throws IOException { Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); RaoParameters raoParameters = new RaoParameters(); - raoParameters.getRangeActionsOptimizationParameters().setPstPenaltyCost(0.01); - raoParameters.getRangeActionsOptimizationParameters().setHvdcPenaltyCost(0.01); - 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); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); - parameters = raoParameters.getExtension(RelativeMarginsParametersExtension.class); + raoParameters.getRangeActionsOptimizationParameters().setPstRAMinImpactThreshold(0.01); + raoParameters.getRangeActionsOptimizationParameters().setHvdcRAMinImpactThreshold(0.01); + raoParameters.getRangeActionsOptimizationParameters().setInjectionRAMinImpactThreshold(0.01); + OpenRaoSearchTreeParameters searchTreeParameters = new OpenRaoSearchTreeParameters(); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, searchTreeParameters); + parameters = new SearchTreeRaoRelativeMarginsParameters(); + searchTreeParameters.setRelativeMarginsParameters(parameters); + parameters.setPtdfSumLowerBound(0.01); + raoParameters.getObjectiveFunctionParameters().setType(ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_MARGIN); + raoParameters.getObjectiveFunctionParameters().setUnit(MEGAWATT); coreProblemFiller = new MarginCoreProblemFiller( optimizationPerimeter, initialRangeActionSetpointResult, - rangeActionParameters, + raoParameters.getRangeActionsOptimizationParameters(), + null, MEGAWATT, - false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS, null); + false, + SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS, + null); } private void createMaxMinRelativeMarginFiller(Unit unit, double cnecInitialAbsolutePtdfSum) { @@ -101,7 +107,7 @@ private void buildLinearProblem() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(maxMinRelativeMarginFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .withInitialRangeActionActivationResult(getInitialRangeActionActivationResult()) .build(); linearProblem.fill(flowResult, sensitivityResult); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MnecFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MnecFillerTest.java index 8c421889d5..a168192c13 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MnecFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/MnecFillerTest.java @@ -16,9 +16,11 @@ import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.data.raoresult.api.ComputationStatus; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoMnecParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.PstModel; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.Solver; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; +import com.powsybl.openrao.raoapi.parameters.MnecParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.*; import com.powsybl.openrao.searchtreerao.result.api.FlowResult; @@ -99,39 +101,45 @@ public void setUp() throws IOException { when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); RaoParameters raoParameters = new RaoParameters(); - raoParameters.getRangeActionsOptimizationParameters().setPstPenaltyCost(0.01); - raoParameters.getRangeActionsOptimizationParameters().setHvdcPenaltyCost(0.01); - raoParameters.getRangeActionsOptimizationParameters().setInjectionRaPenaltyCost(0.01); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); + raoParameters.getRangeActionsOptimizationParameters().setPstRAMinImpactThreshold(0.01); + raoParameters.getRangeActionsOptimizationParameters().setHvdcRAMinImpactThreshold(0.01); + raoParameters.getRangeActionsOptimizationParameters().setInjectionRAMinImpactThreshold(0.01); coreProblemFiller = new MarginCoreProblemFiller( - optimizationPerimeter, - initialRangeActionSetpointResult, - rangeActionParameters, - Unit.MEGAWATT, - false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS, null); + optimizationPerimeter, + initialRangeActionSetpointResult, + raoParameters.getRangeActionsOptimizationParameters(), + null, + Unit.MEGAWATT, + false, + PstModel.CONTINUOUS, + null); } private void fillProblemWithFiller(Unit unit) { - MnecParametersExtension parameters = new MnecParametersExtension(); + MnecParameters parameters = new MnecParameters(); + SearchTreeRaoMnecParameters parametersExtension = new SearchTreeRaoMnecParameters(); parameters.setAcceptableMarginDecrease(50); - parameters.setViolationCost(10); - parameters.setConstraintAdjustmentCoefficient(3.5); + parametersExtension.setViolationCost(10); + parametersExtension.setConstraintAdjustmentCoefficient(3.5); FlowResult flowResult = Mockito.mock(FlowResult.class); when(flowResult.getFlow(mnec1, TwoSides.TWO, Unit.MEGAWATT)).thenReturn(900.); when(flowResult.getFlow(mnec2, TwoSides.ONE, Unit.MEGAWATT)).thenReturn(-200.); when(flowResult.getFlow(mnec3, TwoSides.ONE, Unit.MEGAWATT)).thenReturn(-200.); when(flowResult.getFlow(mnec3, TwoSides.TWO, Unit.MEGAWATT)).thenReturn(-200.); MnecFiller mnecFiller = new MnecFiller( - flowResult, - Set.of(mnec1, mnec2, mnec3), - unit, - parameters, null); + flowResult, + Set.of(mnec1, mnec2, mnec3), + unit, + parametersExtension.getViolationCost(), + parameters.getAcceptableMarginDecrease(), + parametersExtension.getConstraintAdjustmentCoefficient(), + null); linearProblem = new LinearProblemBuilder() - .withProblemFiller(coreProblemFiller) - .withProblemFiller(mnecFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) - .build(); + .withProblemFiller(coreProblemFiller) + .withProblemFiller(mnecFiller) + .withSolver(Solver.SCIP) + .build(); linearProblem.fill(flowResult, sensitivityResult); } @@ -213,10 +221,11 @@ void testAddMnecPenaltyCostA() { @Test void testFilterCnecWithNoInitialFlow() { - MnecParametersExtension parameters = new MnecParametersExtension(); + MnecParameters parameters = new MnecParameters(); + SearchTreeRaoMnecParameters parametersExtension = new SearchTreeRaoMnecParameters(); parameters.setAcceptableMarginDecrease(50); - parameters.setViolationCost(10); - parameters.setConstraintAdjustmentCoefficient(3.5); + parametersExtension.setViolationCost(10); + parametersExtension.setConstraintAdjustmentCoefficient(3.5); FlowResult flowResult = Mockito.mock(FlowResult.class); when(flowResult.getFlow(mnec1, TwoSides.TWO, Unit.MEGAWATT)).thenReturn(900.); when(flowResult.getFlow(mnec2, TwoSides.ONE, Unit.MEGAWATT)).thenReturn(-200.); @@ -227,11 +236,14 @@ void testFilterCnecWithNoInitialFlow() { flowResult, Set.of(mnec1, mnec2, mnec3), Unit.MEGAWATT, - parameters, null); + parametersExtension.getViolationCost(), + parameters.getAcceptableMarginDecrease(), + parametersExtension.getConstraintAdjustmentCoefficient(), + null); linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(mnecFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/PowerGradientConstraintFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/PowerGradientConstraintFillerTest.java index 645925821e..dc19938377 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/PowerGradientConstraintFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/PowerGradientConstraintFillerTest.java @@ -20,6 +20,7 @@ import com.powsybl.openrao.raoapi.RaoInput; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.PreventiveOptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.LinearProblem; @@ -48,7 +49,7 @@ * @author Roxane Chen {@literal , Double> map = new HashMap<>(); crac.getRangeActions(crac.getPreventiveState(), UsageMethod.AVAILABLE).forEach(action -> map.put(action, 0.0)); RangeActionSetpointResult rangeActionSetpointResult = new RangeActionSetpointResultImpl(map); @@ -112,9 +113,10 @@ private void createCoreProblemFillers() { optimizationPerimeter, rangeActionSetpointResult, rangeActionParameters, + null, Unit.MEGAWATT, false, - RangeActionsOptimizationParameters.PstModel.CONTINUOUS, + SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS, entry.getKey() ); linearProblemBuilder.withProblemFiller(coreProblemFiller); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/RaUsageLimitsFillerTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/RaUsageLimitsFillerTest.java index ff9b0c8781..8a747ce476 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/RaUsageLimitsFillerTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/RaUsageLimitsFillerTest.java @@ -16,6 +16,8 @@ import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.PstModel; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters.Solver; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.commons.parameters.RangeActionLimitationParameters; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.*; @@ -105,14 +107,17 @@ public void setup() throws IOException { rangeActionsPerState.put(state, rangeActions); Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActionsPerState); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(new RaoParameters()); + RangeActionsOptimizationParameters rangeActionParameters = (new RaoParameters()).getRangeActionsOptimizationParameters(); coreProblemFiller = new MarginCoreProblemFiller( optimizationPerimeter, prePerimeterRangeActionSetpointResult, - rangeActionParameters, + rangeActionParameters, + null, Unit.MEGAWATT, - false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS, null); + false, + PstModel.CONTINUOUS, + null); } @Test @@ -127,7 +132,7 @@ void testSkipFiller() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -150,7 +155,7 @@ void testVariationVariableAndConstraints() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -183,7 +188,7 @@ void testVariationVariableAndConstraintsApproxPsts() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -216,7 +221,7 @@ void testSkipConstraints1() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -249,7 +254,7 @@ void testSkipConstraints2() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -271,7 +276,7 @@ void testMaxRa() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -298,7 +303,7 @@ void testSkipLargeMaxRa1() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -321,7 +326,7 @@ void testSkipLargeMaxRa2() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -351,7 +356,7 @@ void testMaxTso() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -384,7 +389,7 @@ void testSkipLargeMaxTso1() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -406,7 +411,7 @@ void testSkipLargeMaxTso2() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -428,7 +433,7 @@ void testMaxTsoWithExclusion() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -456,7 +461,7 @@ void testMaxRaPerTso() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -497,7 +502,7 @@ void testMaxPstPerTso() { linearProblem = new LinearProblemBuilder() .withProblemFiller(coreProblemFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); @@ -554,7 +559,7 @@ void testMaxElementaryActionsPerTsoConstraint() { .withProblemFiller(coreProblemFiller) .withProblemFiller(discretePstTapFiller) .withProblemFiller(raUsageLimitsFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(Solver.SCIP) .withInitialRangeActionActivationResult(prePerimeterRangeActionActivationResult) .build(); diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/UnoptimizedCnecFillerMarginDecreaseRuleTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/UnoptimizedCnecFillerMarginDecreaseRuleTest.java index 9a73c94cfa..5be71119f7 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/UnoptimizedCnecFillerMarginDecreaseRuleTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/fillers/UnoptimizedCnecFillerMarginDecreaseRuleTest.java @@ -13,9 +13,9 @@ import com.powsybl.openrao.data.crac.api.cnec.FlowCnec; import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.crac.api.rangeaction.RangeAction; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.OptimizationPerimeter; import com.powsybl.openrao.searchtreerao.commons.parameters.UnoptimizedCnecParameters; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.linearproblem.OpenRaoMPConstraint; @@ -77,17 +77,19 @@ public void setUp() throws IOException { Mockito.when(optimizationPerimeter.getRangeActionsPerState()).thenReturn(rangeActions); RaoParameters raoParameters = new RaoParameters(); - raoParameters.getRangeActionsOptimizationParameters().setPstPenaltyCost(0.01); - raoParameters.getRangeActionsOptimizationParameters().setHvdcPenaltyCost(0.01); - raoParameters.getRangeActionsOptimizationParameters().setInjectionRaPenaltyCost(0.01); - RangeActionsOptimizationParameters rangeActionParameters = RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters); + raoParameters.getRangeActionsOptimizationParameters().setPstRAMinImpactThreshold(0.01); + raoParameters.getRangeActionsOptimizationParameters().setHvdcRAMinImpactThreshold(0.01); + raoParameters.getRangeActionsOptimizationParameters().setInjectionRAMinImpactThreshold(0.01); coreProblemFiller = new MarginCoreProblemFiller( optimizationPerimeter, initialRangeActionSetpointResult, - rangeActionParameters, + raoParameters.getRangeActionsOptimizationParameters(), + null, MEGAWATT, - false, RangeActionsOptimizationParameters.PstModel.CONTINUOUS, null); + false, + SearchTreeRaoRangeActionsOptimizationParameters.PstModel.CONTINUOUS, + null); } private void buildLinearProblemWithMaxMinMargin() { @@ -113,13 +115,13 @@ private void buildLinearProblemWithMaxMinMargin(boolean initialFlowsAreNan) { .withProblemFiller(coreProblemFiller) .withProblemFiller(maxMinMarginFiller) .withProblemFiller(unoptimizedCnecFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); } private void buildLinearProblemWithMaxMinRelativeMargin() { - RelativeMarginsParametersExtension maxMinRelativeMarginParameters = new RelativeMarginsParametersExtension(); + SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters = new SearchTreeRaoRelativeMarginsParameters(); UnoptimizedCnecParameters unoptimizedCnecParameters = new UnoptimizedCnecParameters(Set.of("NL")); FlowResult initialFlowResult = Mockito.mock(FlowResult.class); @@ -146,7 +148,7 @@ private void buildLinearProblemWithMaxMinRelativeMargin() { .withProblemFiller(coreProblemFiller) .withProblemFiller(maxMinRelativeMarginFiller) .withProblemFiller(unoptimizedCnecFiller) - .withSolver(RangeActionsOptimizationParameters.Solver.SCIP) + .withSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP) .build(); linearProblem.fill(flowResult, sensitivityResult); } diff --git a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/OpenRaoMPSolverTest.java b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/OpenRaoMPSolverTest.java index b2dc02b827..1b0bf7118a 100644 --- a/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/OpenRaoMPSolverTest.java +++ b/ra-optimisation/search-tree-rao/src/test/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/OpenRaoMPSolverTest.java @@ -10,7 +10,7 @@ import com.google.ortools.linearsolver.MPSolver; import com.google.ortools.linearsolver.MPVariable; import com.powsybl.openrao.commons.OpenRaoException; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.result.api.LinearProblemStatus; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -28,18 +28,18 @@ class OpenRaoMPSolverTest { @BeforeEach void setUp() { - openRaoMPSolver = new OpenRaoMPSolver("test", RangeActionsOptimizationParameters.Solver.SCIP); + openRaoMPSolver = new OpenRaoMPSolver("test", SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP); mpSolver = openRaoMPSolver.getMpSolver(); } @Test void basicTest() { assertNotNull(openRaoMPSolver.getObjective()); - assertEquals(RangeActionsOptimizationParameters.Solver.SCIP, openRaoMPSolver.getSolver()); + assertEquals(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP, openRaoMPSolver.getSolver()); assertEquals(MPSolver.OptimizationProblemType.SCIP_MIXED_INTEGER_PROGRAMMING, openRaoMPSolver.getMpSolver().problemType()); - openRaoMPSolver = new OpenRaoMPSolver("rao_test_prob", RangeActionsOptimizationParameters.Solver.CBC); - assertEquals(RangeActionsOptimizationParameters.Solver.CBC, openRaoMPSolver.getSolver()); + openRaoMPSolver = new OpenRaoMPSolver("rao_test_prob", SearchTreeRaoRangeActionsOptimizationParameters.Solver.CBC); + assertEquals(SearchTreeRaoRangeActionsOptimizationParameters.Solver.CBC, openRaoMPSolver.getSolver()); assertEquals(MPSolver.OptimizationProblemType.CBC_MIXED_INTEGER_PROGRAMMING, openRaoMPSolver.getMpSolver().problemType()); } @@ -285,16 +285,16 @@ void testSolve() { openRaoMPSolver.resetModel(); assertNotNull(openRaoMPSolver.getObjective()); checkObjectiveSense(false); - assertEquals(RangeActionsOptimizationParameters.Solver.SCIP, openRaoMPSolver.getSolver()); + assertEquals(SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP, openRaoMPSolver.getSolver()); assertEquals(MPSolver.OptimizationProblemType.SCIP_MIXED_INTEGER_PROGRAMMING, openRaoMPSolver.getMpSolver().problemType()); } @Test void testInfinity() { - OpenRaoMPSolver solver = new OpenRaoMPSolver("solver", RangeActionsOptimizationParameters.Solver.CBC); + OpenRaoMPSolver solver = new OpenRaoMPSolver("solver", SearchTreeRaoRangeActionsOptimizationParameters.Solver.CBC); assertEquals(Double.POSITIVE_INFINITY, solver.infinity()); - solver = new OpenRaoMPSolver("solver", RangeActionsOptimizationParameters.Solver.SCIP); + solver = new OpenRaoMPSolver("solver", SearchTreeRaoRangeActionsOptimizationParameters.Solver.SCIP); assertEquals(1e23, solver.infinity()); // can't test XPRESS because we need the link to the library 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 28759c0b35..c81f9def37 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..5e41bd27ba 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; @@ -14,9 +15,11 @@ import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.raoapi.parameters.LoopFlowParameters; +import com.powsybl.openrao.raoapi.parameters.MnecParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRelativeMarginsParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.parameters.*; import com.powsybl.openrao.searchtreerao.result.api.OptimizationResult; import com.powsybl.openrao.searchtreerao.result.api.PrePerimeterResult; @@ -49,42 +52,50 @@ public void setup() { @Test void testWithConstantParametersOverAllRao() { RaoParameters raoParameters = new RaoParameters(); + raoParameters.addExtension(OpenRaoSearchTreeParameters.class, new OpenRaoSearchTreeParameters()); + OpenRaoSearchTreeParameters raoParametersExtension = raoParameters.getExtension(OpenRaoSearchTreeParameters.class); Crac crac = Mockito.mock(Crac.class); builder.withConstantParametersOverAllRao(raoParameters, crac); SearchTreeParameters searchTreeParameters = builder.build(); assertNotNull(searchTreeParameters); assertEquals(raoParameters.getObjectiveFunctionParameters().getType(), searchTreeParameters.getObjectiveFunction()); - assertEquals(NetworkActionParameters.buildFromRaoParameters(raoParameters.getTopoOptimizationParameters(), crac), searchTreeParameters.getNetworkActionParameters()); + assertEquals(NetworkActionParameters.buildFromRaoParameters(raoParameters, crac), searchTreeParameters.getNetworkActionParameters()); assertEquals(crac.getRaUsageLimitsPerInstant(), searchTreeParameters.getRaLimitationParameters()); - assertEquals(RangeActionsOptimizationParameters.buildFromRaoParameters(raoParameters), searchTreeParameters.getRangeActionParameters()); - assertEquals(raoParameters.getExtension(MnecParametersExtension.class), searchTreeParameters.getMnecParameters()); - assertEquals(raoParameters.getExtension(RelativeMarginsParametersExtension.class), searchTreeParameters.getMaxMinRelativeMarginParameters()); - assertEquals(raoParameters.getExtension(LoopFlowParametersExtension.class), searchTreeParameters.getLoopFlowParameters()); - assertEquals(raoParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver(), searchTreeParameters.getSolverParameters()); - assertEquals(raoParameters.getRangeActionsOptimizationParameters().getMaxMipIterations(), searchTreeParameters.getMaxNumberOfIterations()); + assertEquals(raoParameters.getRangeActionsOptimizationParameters(), searchTreeParameters.getRangeActionParameters()); + assertEquals(raoParameters.getMnecParameters().orElse(null), searchTreeParameters.getMnecParameters()); + assertEquals(raoParameters.getLoopFlowParameters().orElse(null), searchTreeParameters.getLoopFlowParameters()); + assertEquals(raoParametersExtension.getMnecParameters().orElse(null), searchTreeParameters.getMnecParametersExtension()); + assertEquals(raoParametersExtension.getRelativeMarginsParameters().orElse(null), searchTreeParameters.getMaxMinRelativeMarginParameters()); + assertEquals(raoParametersExtension.getLoopFlowParameters().orElse(null), searchTreeParameters.getLoopFlowParametersExtension()); + assertEquals(raoParametersExtension.getRangeActionsOptimizationParameters().getLinearOptimizationSolver(), searchTreeParameters.getSolverParameters()); + assertEquals(raoParametersExtension.getRangeActionsOptimizationParameters().getMaxMipIterations(), searchTreeParameters.getMaxNumberOfIterations()); } @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<>(); RangeActionsOptimizationParameters rangeActionParameters = Mockito.mock(RangeActionsOptimizationParameters.class); - MnecParametersExtension mnecParameters = Mockito.mock(MnecParametersExtension.class); - RelativeMarginsParametersExtension maxMinRelativeMarginParameters = Mockito.mock(RelativeMarginsParametersExtension.class); - LoopFlowParametersExtension loopFlowParameters = Mockito.mock(LoopFlowParametersExtension.class); + SearchTreeRaoRangeActionsOptimizationParameters rangeActionParametersExtension = Mockito.mock(SearchTreeRaoRangeActionsOptimizationParameters.class); + MnecParameters mnecParameters = Mockito.mock(MnecParameters.class); + SearchTreeRaoRelativeMarginsParameters maxMinRelativeMarginParameters = Mockito.mock(SearchTreeRaoRelativeMarginsParameters.class); + LoopFlowParameters loopFlowParameters = Mockito.mock(LoopFlowParameters.class); UnoptimizedCnecParameters unoptimizedCnecParameters = Mockito.mock(UnoptimizedCnecParameters.class); - RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters = Mockito.mock(RangeActionsOptimizationParameters.LinearOptimizationSolver.class); + SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters = Mockito.mock(SearchTreeRaoRangeActionsOptimizationParameters.LinearOptimizationSolver.class); int maxNumberOfIterations = 3; SearchTreeParameters searchTreeParameters = builder .with0bjectiveFunction(objectiveFunction) + .with0bjectiveFunctionUnit(objectiveFunctionUnit) .withTreeParameters(treeParameters) .withNetworkActionParameters(networkActionParameters) .withGlobalRemedialActionLimitationParameters(raLimitationParameters) .withRangeActionParameters(rangeActionParameters) + .withRangeActionParametersExtension(rangeActionParametersExtension) .withMnecParameters(mnecParameters) .withMaxMinRelativeMarginParameters(maxMinRelativeMarginParameters) .withLoopFlowParameters(loopFlowParameters) 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 394677ee18..ad50a60b53 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,105 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.001, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.001 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 100000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..bf3a91edab 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,106 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 100000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } diff --git a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_dc_minObjective.json b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_dc_minObjective.json index c866a4eec3..7c1eef20ba 100644 --- a/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_dc_minObjective.json +++ b/ra-optimisation/search-tree-rao/src/test/resources/parameters/RaoParameters_dc_minObjective.json @@ -1,132 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MIN_COST_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MIN_COST", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..3520d870ea 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,105 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 100000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 1, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 1, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..274aa15e68 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,105 +1,112 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "auto-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 100000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } diff --git a/tests/src/test/java/com/powsybl/openrao/tests/steps/CommonTestData.java b/tests/src/test/java/com/powsybl/openrao/tests/steps/CommonTestData.java index 3d8f488d4f..c20d41ee8b 100644 --- a/tests/src/test/java/com/powsybl/openrao/tests/steps/CommonTestData.java +++ b/tests/src/test/java/com/powsybl/openrao/tests/steps/CommonTestData.java @@ -21,8 +21,9 @@ import com.powsybl.openrao.monitoring.results.MonitoringResult; import com.powsybl.openrao.monitoring.results.RaoResultWithAngleMonitoring; import com.powsybl.openrao.raoapi.json.JsonRaoParameters; -import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.OpenRaoSearchTreeParameters; +import com.powsybl.openrao.raoapi.parameters.extensions.SearchTreeRaoRangeActionsOptimizationParameters; import com.powsybl.openrao.tests.utils.CoreCcPreprocessor; import com.powsybl.openrao.tests.utils.Helpers; import com.powsybl.openrao.virtualhubs.VirtualHubsConfiguration; @@ -291,7 +292,8 @@ public static void loadData(String timestamp) throws IOException { raoParameters = buildDefaultConfig(); } if (overrideLinearSolver != null) { - raoParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver().setSolver(RangeActionsOptimizationParameters.Solver.valueOf(overrideLinearSolver.toUpperCase())); + raoParameters.getExtension(OpenRaoSearchTreeParameters.class).getRangeActionsOptimizationParameters().getLinearOptimizationSolver() + .setSolver(SearchTreeRaoRangeActionsOptimizationParameters.Solver.valueOf(overrideLinearSolver.toUpperCase())); } // Loopflow GLSK diff --git a/tests/src/test/java/com/powsybl/openrao/tests/steps/SearchTreeRaoSteps.java b/tests/src/test/java/com/powsybl/openrao/tests/steps/SearchTreeRaoSteps.java index a2d2af8bec..a38542769d 100644 --- a/tests/src/test/java/com/powsybl/openrao/tests/steps/SearchTreeRaoSteps.java +++ b/tests/src/test/java/com/powsybl/openrao/tests/steps/SearchTreeRaoSteps.java @@ -30,6 +30,7 @@ import com.powsybl.openrao.loopflowcomputation.LoopFlowComputationImpl; import com.powsybl.openrao.loopflowcomputation.LoopFlowResult; import com.powsybl.openrao.raoapi.parameters.RaoParameters; +import com.powsybl.sensitivity.SensitivityAnalysisParameters; import com.powsybl.sensitivity.SensitivityVariableSet; import com.powsybl.openrao.tests.utils.RaoUtils; import io.cucumber.java.en.Then; @@ -44,6 +45,7 @@ import java.util.Set; import java.util.stream.Collectors; +import static com.powsybl.openrao.raoapi.parameters.extensions.LoadFlowAndSensitivityParameters.getSensitivityWithLoadFlowParameters; import static org.junit.jupiter.api.Assertions.*; /** @@ -645,12 +647,13 @@ private void launchLoopflowComputation(String timestamp, String sensitivityProvi network = CommonTestData.getNetwork(); crac = CommonTestData.getCrac(); RaoParameters raoParameters = CommonTestData.getRaoParameters(); - ReferenceProgram referenceProgram = CommonTestData.getReferenceProgram() != null ? CommonTestData.getReferenceProgram() : ReferenceProgramBuilder.buildReferenceProgram(network, loadFlowProvider, raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters()); + SensitivityAnalysisParameters sensitivityAnalysisParameters = getSensitivityWithLoadFlowParameters(raoParameters); + ReferenceProgram referenceProgram = CommonTestData.getReferenceProgram() != null ? CommonTestData.getReferenceProgram() : ReferenceProgramBuilder.buildReferenceProgram(network, loadFlowProvider, sensitivityAnalysisParameters.getLoadFlowParameters()); ZonalData glsks = CommonTestData.getLoopflowGlsks(); // run loopFlowComputation LoopFlowComputation loopFlowComputation = new LoopFlowComputationImpl(glsks, referenceProgram); - this.loopFlowResult = loopFlowComputation.calculateLoopFlows(network, sensitivityProvider, raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters(), crac.getFlowCnecs(), crac.getOutageInstant()); + this.loopFlowResult = loopFlowComputation.calculateLoopFlows(network, sensitivityProvider, sensitivityAnalysisParameters, crac.getFlowCnecs(), crac.getOutageInstant()); } catch (IOException e) { throw new UncheckedIOException(e); 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..8e2c54e291 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 @@ -14,8 +14,6 @@ import com.powsybl.openrao.data.raoresult.api.RaoResult; import com.powsybl.openrao.data.raoresult.io.cne.swe.SweCneExporter; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; -import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; @@ -76,14 +74,14 @@ 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)) { + if (raoParameters.getLoopFlowParameters().isPresent()) { properties.setProperty("rao-result.export.core-cne.with-loop-flows", "true"); } - if (raoParameters.hasExtension(MnecParametersExtension.class)) { - properties.setProperty("rao-result.export.core-cne.mnec-acceptable-margin-diminution", String.valueOf(raoParameters.getExtension(MnecParametersExtension.class).getAcceptableMarginDecrease())); + if (raoParameters.getMnecParameters().isPresent()) { + properties.setProperty("rao-result.export.core-cne.mnec-acceptable-margin-diminution", String.valueOf(raoParameters.getMnecParameters().get().getAcceptableMarginDecrease())); } } diff --git a/tests/src/test/java/com/powsybl/openrao/tests/utils/RaoUtils.java b/tests/src/test/java/com/powsybl/openrao/tests/utils/RaoUtils.java index b88d6c89b2..1c08f31fbb 100644 --- a/tests/src/test/java/com/powsybl/openrao/tests/utils/RaoUtils.java +++ b/tests/src/test/java/com/powsybl/openrao/tests/utils/RaoUtils.java @@ -18,14 +18,12 @@ import com.powsybl.openrao.raoapi.Rao; import com.powsybl.openrao.raoapi.RaoInput; import com.powsybl.openrao.raoapi.parameters.RaoParameters; -import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.sensitivity.SensitivityVariableSet; import com.powsybl.openrao.tests.steps.CommonTestData; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.util.Objects; import java.util.Optional; import java.util.Properties; @@ -65,7 +63,7 @@ public static RaoResult runRao(String contingencyId, InstantKind instantKind, St RaoParameters raoParameters = CommonTestData.getRaoParameters(); ZonalData glsks = CommonTestData.getLoopflowGlsks(); // Rao with loop-flows - if (Objects.nonNull(raoParameters.getExtension(LoopFlowParametersExtension.class)) && glsks != null) { + if (raoParameters.getLoopFlowParameters().isPresent() && glsks != null) { double effectiveLfPercentage = loopflowAsPmaxPercentage == null ? 0.0 : loopflowAsPmaxPercentage; buildLoopFlowExtensions(CommonTestData.getCrac(), CommonTestData.getNetwork(), effectiveLfPercentage); } 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..b9e2a6dc21 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_default.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_default.json @@ -1,131 +1,139 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "ra-range-shrinking" : "DISABLED", + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", + "maxActivePowerMismatch" : 0.01, + "maxReactivePowerMismatch" : 0.01, + "maxVoltageMismatch" : 1.0E-4, + "maxAngleMismatch" : 1.0E-5, + "maxRatioMismatch" : 1.0E-5, + "maxSusceptanceMismatch" : 1.0E-4, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "maxOuterLoopIterations" : 20, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minNominalVoltageTargetVoltageCheck" : 20.0, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3, + "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", + "alwaysUpdateNetwork" : false, + "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, + "reportedFeatures" : [ ], + "slackBusCountryFilter" : [ ], + "actionableSwitchesIds" : [ ], + "asymmetrical" : false, + "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", + "outerLoopNames" : null, + "useActiveLimits" : true, + "lineSearchStateVectorScalingMaxIteration" : 10, + "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, + "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, + "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, + "linePerUnitMode" : "IMPEDANCE", + "useLoadModel" : false, + "dcApproximationType" : "IGNORE_R", + "simulateAutomationSystems" : false + } + } } } + }, + "multi-threading" : { + "available-cpus" : 4 } } } 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..ffe7ea7750 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..0f150a4963 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..6da3974080 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 20, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 20, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..9116be80d4 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..4be2f98df8 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..bd197415ee 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", - "constraint-adjustment-coefficient" : 0.5, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", + "constraint-adjustment-coefficient" : 0.5, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..f600553aee 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,84 +1,92 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "extensions" : { - "open-load-flow-parameters" : { - "slackDistributionFailureBehavior" : "THROW" + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "extensions" : { + "open-load-flow-parameters" : { + "slackDistributionFailureBehavior" : "THROW" + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 } } - }, - "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - } } } \ No newline at end of file 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..86d49fc17d 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 20, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 20, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..4764f122d1 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..d454a109ab 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..a039bce6c3 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json @@ -1,111 +1,119 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 20, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 5000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 20, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 5000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 } } - }, - "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - } } } \ No newline at end of file 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..92111b3ac1 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,86 +1,96 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 20, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "FIXED_PTDF", - "constraint-adjustment-coefficient" : 0.0, - "violation-cost" : 0.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 20, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P_MAX", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "FIXED_PTDF", + "constraint-adjustment-coefficient" : 0.0, + "violation-cost" : 0.0 + } } } } \ No newline at end of file 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..293c55e11a 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,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{FR}-{BE}", "{FR}-{DE}", "{BE}-{NL}", "{NL}-{DE}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{FR}-{BE}", "{FR}-{DE}", "{BE}-{NL}", "{NL}-{DE}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..f6019bea79 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json @@ -1,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{10YFR-RTE------C}-{10YBE----------2}", "{10YFR-RTE------C}-{10YCB-GERMANY--8}", "{10YBE----------2}-{10YNL----------L}", "{10YNL----------L}-{10YCB-GERMANY--8}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{10YFR-RTE------C}-{10YBE----------2}", "{10YFR-RTE------C}-{10YCB-GERMANY--8}", "{10YBE----------2}-{10YNL----------L}", "{10YNL----------L}-{10YCB-GERMANY--8}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..3874e1f232 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json @@ -1,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{HOMEMADE_EI_CODE}-{10YBE----------2}", "{HOMEMADE_EI_CODE}-{10YCB-GERMANY--8}", "{10YBE----------2}-{10YNL----------L}", "{10YNL----------L}-{10YCB-GERMANY--8}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{HOMEMADE_EI_CODE}-{10YBE----------2}", "{HOMEMADE_EI_CODE}-{10YCB-GERMANY--8}", "{10YBE----------2}-{10YNL----------L}", "{10YNL----------L}-{10YCB-GERMANY--8}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..077a3e0cfa 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json @@ -1,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{22Y201903144---9}-{22Y201903145---4}", "{22Y201903144---9}-{BE}", "{22Y201903145---4}-{DE}", "{BE}-{NL}", "{DE}-{NL}", "{BE}-{FR}", "{DE}-{FR}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{22Y201903144---9}-{22Y201903145---4}", "{22Y201903144---9}-{BE}", "{22Y201903145---4}-{DE}", "{BE}-{NL}", "{DE}-{NL}", "{BE}-{FR}", "{DE}-{FR}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..77978a958c 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json @@ -1,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{BE}-{22Y201903144---9}-{DE}+{22Y201903145---4}", "{BE}-{NL}", "{DE}-{NL}", "{BE}-{FR}", "{DE}-{FR}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{BE}-{22Y201903144---9}-{DE}+{22Y201903145---4}", "{BE}-{NL}", "{DE}-{NL}", "{BE}-{FR}", "{DE}-{FR}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..ba264268ed 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 180.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 180.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..ade2bf53b9 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 20.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 20.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..c3226aef7e 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : -99999.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : -99999.0, - "violation-cost" : 100.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 100.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..6f52045ee7 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json @@ -1,104 +1,112 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 10.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 10.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "THROW", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "THROW", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..9c7033d7c0 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json @@ -1,104 +1,112 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 10.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 10.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "THROW", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "THROW", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..42dfc903ad 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json @@ -1,104 +1,112 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 10.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 10.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "THROW", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "THROW", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..e13b39dd50 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 0.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 0.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 5.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 5.0 + } } } } \ No newline at end of file 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..58ef24d8ce 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 0.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 0.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 5.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 5.0 + } } } } \ No newline at end of file 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..31decfd58f 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 300.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : true }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 300.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..7b7b3fb13f 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 500.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 500.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..9185d90e55 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 628.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 10.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 10.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 628.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..885cf7fde5 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json @@ -1,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 10.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 10.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 5.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 5.0 + } } } } \ No newline at end of file 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..041f585612 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json @@ -1,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "FIXED_PTDF", - "constraint-adjustment-coefficient" : 5.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "FIXED_PTDF", + "constraint-adjustment-coefficient" : 5.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..38587722d7 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..794493bf71 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 10.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 10.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..3b3c2720d6 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 12.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 12.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..2b1893d75a 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,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..7d6b79bd1c 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..a9f687dcca 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 10.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 10.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..3e63d3a846 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 0.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 0.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 5.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 5.0 + } } } } \ No newline at end of file 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..5e7179ccce 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,104 +1,112 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 4 } } } 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..f5bed932b6 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,103 +1,111 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 4 } } } 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..a2be72b13b 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,104 +1,112 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 4 } } } 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..bbfb6e68fc 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json @@ -1,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 1, - "max-auto-search-tree-depth" : 1, - "max-curative-search-tree-depth" : 1, - "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4", "close_fr1_fr5" ] ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 1, + "max-auto-search-tree-depth" : 1, + "max-curative-search-tree-depth" : 1, + "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4", "close_fr1_fr5" ] ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..f3c8620171 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json @@ -1,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 1, - "max-auto-search-tree-depth" : 1, - "max-curative-search-tree-depth" : 1, - "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4", "close_fr1_fr5" ], [ "open_fr1_fr3", "open_be1__be4", "close_fr1_fr5" ] ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 1, + "max-auto-search-tree-depth" : 1, + "max-curative-search-tree-depth" : 1, + "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4", "close_fr1_fr5" ], [ "open_fr1_fr3", "open_be1__be4", "close_fr1_fr5" ] ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..a5efb01ce8 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json @@ -1,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4", "close_fr1_fr5" ] ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4", "close_fr1_fr5" ] ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..c6fd1ab07c 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json @@ -1,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4" ] ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4" ] ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..77188430f6 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json @@ -1,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4", "open_fr1_fr2" ] ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4", "open_fr1_fr2" ] ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..87b107b185 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json @@ -1,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ [ "close_fr1_fr5", "open_fr1_fr2" ] ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition": "DISABLED", - "re-optimize-curative-range-actions": false, - "hint-from-first-preventive-rao": false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ [ "close_fr1_fr5", "open_fr1_fr2" ] ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..2987a7864f 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json @@ -1,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 1, - "max-auto-search-tree-depth" : 1, - "max-curative-search-tree-depth" : 1, - "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4" ] ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 1, + "max-auto-search-tree-depth" : 1, + "max-curative-search-tree-depth" : 1, + "predefined-combinations" : [ [ "open_fr1_fr3", "open_be1_be4" ] ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..41a5eaaf29 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json @@ -1,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : false, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..41a5eaaf29 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json @@ -1,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : false, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..647b1c1fae 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json @@ -1,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 5.0, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 5.0, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : false, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : false, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..bec2abb42d 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json @@ -1,103 +1,111 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 10.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 10.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..bec2abb42d 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json @@ -1,103 +1,111 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 10.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 10.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } diff --git a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us7-2.json b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us7-2.json index f6435f0428..472040e639 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us7-2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us7-2.json @@ -1,7 +1,13 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-min-obj-improvement" : 10000.0 + "type" : "MAX_MIN_MARGIN" + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + } + } } } \ No newline at end of file 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..c65dd2fe53 100644 --- a/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json +++ b/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json @@ -1,103 +1,111 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "SCIP", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : "THREADS 1 MAXNODE 100000 MAXTIME 300" - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 2, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 4, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : true + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "DC_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : true, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "THROW", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 100, - "newtonRaphsonConvEpsPerEq" : 0.001, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.5, - "maxPlausibleTargetVoltage" : 1.5, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "SCIP", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : "THREADS 1 MAXNODE 100000 MAXTIME 300" + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 2, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : true + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "DC_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : true, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "THROW", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 100, + "newtonRaphsonConvEpsPerEq" : 0.001, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.5, + "maxPlausibleTargetVoltage" : 1.5, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 4 } } } 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..6c3aa28425 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..85b54f7575 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,105 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "COST_INCREASE", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 100000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "COST_INCREASE", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..2bb3f346af 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,105 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "COST_INCREASE", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 100000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "COST_INCREASE", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..afe993238b 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,105 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 2, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 100000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "voltageRemoteControl" : true, - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 2, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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 62b6132faf..5c620f6c4d 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "COST_INCREASE", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : true }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "COST_INCREASE", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..07b57c4536 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : true }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..6556776e63 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,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : true }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..566f58ff0e 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,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : true }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..b12099f189 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,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : true }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..0d264450f9 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,84 +1,94 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_RELATIVE_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : true }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "relative-margins-parameters" : { + "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "relative-margins-parameters" : { - "ptdf-boundaries" : [ "{FR}-{DE}", "{FR}-{BE}", "{BE}-{NL}", "{BE}-{DE}", "{DE}-{NL}" ], - "ptdf-sum-lower-bound" : 0.01 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "relative-margins-parameters" : { + "ptdf-sum-lower-bound" : 0.01 + } } } } \ No newline at end of file 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..4a9368033d 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 0.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 0.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 5.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 5.0 + } } } } \ No newline at end of file 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..4e5c28cf99 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,104 +1,112 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.0, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.0, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.0, + "hvdc-ra-min-impact-threshold" : 0.0, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "UA", "CZ", "ES", "CH", "RS", "ME", "TR", "BA", "RO", "GR", "IT", "DE", "HU", "SI", "MK", "NL", "BE", "HR", "AL", "FR", "AT", "BG", "SK", "PT", "PL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } 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..c3b46c929f 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,105 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "ra-range-shrinking" : "DISABLED", + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 4 } } } 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..53bde154f5 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 50.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : true }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "COST_INCREASE", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", - "constraint-adjustment-coefficient" : 5.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 50.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "COST_INCREASE", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", + "constraint-adjustment-coefficient" : 5.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..6d846058fd 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "COST_INCREASE", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "COST_INCREASE", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..ffe7ea7750 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..3d1ca9f33d 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..4caa165f54 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,111 +1,119 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 20, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 5000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 1, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 20, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 5000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 1, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 } } - }, - "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - } } } \ No newline at end of file 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..bf910be872 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,112 +1,120 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 20, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 1, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 20, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 1, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 } } - }, - "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - } } } \ No newline at end of file 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..d2f3829937 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,111 +1,119 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 20, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 1, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3 + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 20, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 1, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 } } - }, - "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - } } } \ No newline at end of file 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..d4261b8f0f 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 190.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 190.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..a67b335fc0 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 195.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 195.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..18d4f02a0f 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 1, - "max-auto-search-tree-depth" : 1, - "max-curative-search-tree-depth" : 1, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 1, + "max-auto-search-tree-depth" : 1, + "max-curative-search-tree-depth" : 1, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..78629eb24b 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.5, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..6c1753373b 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 10.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 10.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..87c768221e 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 0.5, - "violation-cost" : 1000.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 0.5, + "violation-cost" : 1000.0 + } } } } \ No newline at end of file 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..291db4ed71 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ "BE", "NL" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 5.0, - "violation-cost" : 100.0, - "countries" : [ "BE", "NL" ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 5.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..6f2c6c4006 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ "NL" ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 5.0, - "violation-cost" : 100.0, - "countries" : [ "NL" ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 5.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..a192dd1e63 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 40.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 40.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 5.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 5.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..ed6087c82e 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "FIXED_PTDF", - "constraint-adjustment-coefficient" : 5.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "FIXED_PTDF", + "constraint-adjustment-coefficient" : 5.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..6381240cd6 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 5.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 5.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..8b42238912 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 10.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 10.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..e82247ec70 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "FIXED_PTDF", - "constraint-adjustment-coefficient" : 5.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "FIXED_PTDF", + "constraint-adjustment-coefficient" : 5.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..4bc24c32ff 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", - "constraint-adjustment-coefficient" : 5.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO", + "constraint-adjustment-coefficient" : 5.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..5c4a43b49a 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_LOAD", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_LOAD", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..93ebc2fa87 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_LOAD", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_LOAD", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..70dbb3a943 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_LOAD", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_LOAD", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..e7d29e7823 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..0b919714f6 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..bb245dfa22 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..f28c45fc2c 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 1 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 1 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..1a2e059305 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 1 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 1 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..d50d45f694 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "A" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : true, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : true, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..b46e169362 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..9c7b7ceee2 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,79 +1,87 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 2, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 0.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 2 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file 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..aa558380a9 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 3.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 3.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file 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..bbb7a51adb 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,87 +1,97 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 + }, + "loop-flow-parameters" : { + "acceptable-increase" : 0.0, + "countries" : [ ] }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 - }, - "loop-flow-parameters" : { - "acceptable-increase" : 0.0, - "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", - "constraint-adjustment-coefficient" : 3.0, - "violation-cost" : 100.0, - "countries" : [ ] + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + }, + "loop-flow-parameters" : { + "ptdf-approximation" : "UPDATE_PTDF_WITH_TOPO_AND_PST", + "constraint-adjustment-coefficient" : 3.0, + "violation-cost" : 100.0 + } } } } \ No newline at end of file diff --git a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective.json b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective.json index c866a4eec3..7c1eef20ba 100644 --- a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective.json +++ b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective.json @@ -1,132 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MIN_COST_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MIN_COST", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } diff --git a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json index 83b62f4078..00d088ec7b 100644 --- a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json +++ b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst.json @@ -1,131 +1,139 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MIN_COST_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MIN_COST", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "ra-range-shrinking" : "DISABLED", + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", + "maxActivePowerMismatch" : 0.01, + "maxReactivePowerMismatch" : 0.01, + "maxVoltageMismatch" : 1.0E-4, + "maxAngleMismatch" : 1.0E-5, + "maxRatioMismatch" : 1.0E-5, + "maxSusceptanceMismatch" : 1.0E-4, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "maxOuterLoopIterations" : 20, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minNominalVoltageTargetVoltageCheck" : 20.0, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3, + "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", + "alwaysUpdateNetwork" : false, + "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, + "reportedFeatures" : [ ], + "slackBusCountryFilter" : [ ], + "actionableSwitchesIds" : [ ], + "asymmetrical" : false, + "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", + "outerLoopNames" : null, + "useActiveLimits" : true, + "lineSearchStateVectorScalingMaxIteration" : 10, + "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, + "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, + "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, + "linePerUnitMode" : "IMPEDANCE", + "useLoadModel" : false, + "dcApproximationType" : "IGNORE_R", + "simulateAutomationSystems" : false + } + } } } + }, + "multi-threading" : { + "available-cpus" : 4 } } } diff --git a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json index ab1b1a5777..b6f3f8661f 100644 --- a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json +++ b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_discretePst_2P.json @@ -1,131 +1,139 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MIN_COST_IN_MEGAWATT", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MIN_COST", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", - "re-optimize-curative-range-actions" : true, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "ra-range-shrinking" : "DISABLED", + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "POSSIBLE_CURATIVE_IMPROVEMENT", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", + "maxActivePowerMismatch" : 0.01, + "maxReactivePowerMismatch" : 0.01, + "maxVoltageMismatch" : 1.0E-4, + "maxAngleMismatch" : 1.0E-5, + "maxRatioMismatch" : 1.0E-5, + "maxSusceptanceMismatch" : 1.0E-4, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "maxOuterLoopIterations" : 20, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minNominalVoltageTargetVoltageCheck" : 20.0, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3, + "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", + "alwaysUpdateNetwork" : false, + "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, + "reportedFeatures" : [ ], + "slackBusCountryFilter" : [ ], + "actionableSwitchesIds" : [ ], + "asymmetrical" : false, + "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", + "outerLoopNames" : null, + "useActiveLimits" : true, + "lineSearchStateVectorScalingMaxIteration" : 10, + "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, + "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, + "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, + "linePerUnitMode" : "IMPEDANCE", + "useLoadModel" : false, + "dcApproximationType" : "IGNORE_R", + "simulateAutomationSystems" : false + } + } } } + }, + "multi-threading" : { + "available-cpus" : 4 } } } diff --git a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_maxDepth1.json b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_maxDepth1.json index 066e1ec5a6..cd0a819737 100644 --- a/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_maxDepth1.json +++ b/tests/src/test/resources/files/configurations/epic92/RaoParameters_dc_minObjective_maxDepth1.json @@ -1,132 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MIN_COST_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MIN_COST", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 1, - "max-auto-search-tree-depth" : 1, - "max-curative-search-tree-depth" : 1, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 1, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } diff --git a/tests/src/test/resources/files/configurations/epic92/RaoParameters_margin_dc_minObjective.json b/tests/src/test/resources/files/configurations/epic92/RaoParameters_margin_dc_minObjective.json index c198b2c11d..dfabc9a747 100644 --- a/tests/src/test/resources/files/configurations/epic92/RaoParameters_margin_dc_minObjective.json +++ b/tests/src/test/resources/files/configurations/epic92/RaoParameters_margin_dc_minObjective.json @@ -1,132 +1,113 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "MW", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 5, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "ra-range-shrinking" : "DISABLED", - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 0.001, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 5, - "max-auto-search-tree-depth" : 5, - "max-curative-search-tree-depth" : 5, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 0.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 0 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 2, - "preventive-leaves-in-parallel" : 4, - "curative-leaves-in-parallel" : 2 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : true, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : false, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : false, - "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true, - "dcPowerFactor" : 1.0, - "extensions" : { - "open-load-flow-parameters" : { - "slackBusSelectionMode" : "MOST_MESHED", - "slackBusesIds" : [ ], - "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", - "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", - "loadPowerFactorConstant" : false, - "plausibleActivePowerLimit" : 10000.0, - "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", - "maxActivePowerMismatch" : 0.01, - "maxReactivePowerMismatch" : 0.01, - "maxVoltageMismatch" : 1.0E-4, - "maxAngleMismatch" : 1.0E-5, - "maxRatioMismatch" : 1.0E-5, - "maxSusceptanceMismatch" : 1.0E-4, - "slackBusPMaxMismatch" : 1.0, - "voltagePerReactivePowerControl" : false, - "maxNewtonRaphsonIterations" : 30, - "maxOuterLoopIterations" : 20, - "newtonRaphsonConvEpsPerEq" : 1.0E-4, - "voltageInitModeOverride" : "NONE", - "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", - "minPlausibleTargetVoltage" : 0.8, - "maxPlausibleTargetVoltage" : 1.2, - "minNominalVoltageTargetVoltageCheck" : 20.0, - "minRealisticVoltage" : 0.5, - "maxRealisticVoltage" : 1.5, - "lowImpedanceThreshold" : 1.0E-8, - "reactiveRangeCheckMode" : "MAX", - "networkCacheEnabled" : false, - "svcVoltageMonitoring" : true, - "stateVectorScalingMode" : "NONE", - "maxSlackBusCount" : 1, - "debugDir" : null, - "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, - "secondaryVoltageControl" : false, - "reactiveLimitsMaxPqPvSwitch" : 3, - "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", - "alwaysUpdateNetwork" : false, - "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, - "reportedFeatures" : [ ], - "slackBusCountryFilter" : [ ], - "actionableSwitchesIds" : [ ], - "asymmetrical" : false, - "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", - "outerLoopNames" : null, - "useActiveLimits" : true, - "lineSearchStateVectorScalingMaxIteration" : 10, - "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, - "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, - "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, - "linePerUnitMode" : "IMPEDANCE", - "useLoadModel" : false, - "dcApproximationType" : "IGNORE_R", - "simulateAutomationSystems" : false + "extensions" : { + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 100000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "PL", "NL", "IT", "ES", "BA", "MK", "AT", "ME", "FR", "UA", "AL", "TR", "SK", "CH", "GR", "PT", "BE", "CZ", "HR", "SI", "RO", "RS", "DE", "BG", "HU" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "voltageRemoteControl" : true, + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3 + } + } } } + }, + "multi-threading" : { + "available-cpus" : 1 } } } diff --git a/tests/src/test/resources/files/configurations/epic93/RaoParameters_minCost_megawatt_dc.json b/tests/src/test/resources/files/configurations/epic93/RaoParameters_minCost_megawatt_dc.json index a772715845..00d088ec7b 100644 --- a/tests/src/test/resources/files/configurations/epic93/RaoParameters_minCost_megawatt_dc.json +++ b/tests/src/test/resources/files/configurations/epic93/RaoParameters_minCost_megawatt_dc.json @@ -1,79 +1,140 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MIN_COST_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MIN_COST", + "unit" : "MW" }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 0.01, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "APPROXIMATED_INTEGERS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 0.01, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 0.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : true, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } - }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 5, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "APPROXIMATED_INTEGERS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "ra-range-shrinking" : "DISABLED", + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 0.001, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 5, + "max-auto-search-tree-depth" : 5, + "max-curative-search-tree-depth" : 5, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 0 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : true, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : true, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : false, + "writeSlackBus" : true, + "dc" : true, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : false, + "countriesToBalance" : [ "GR", "BE", "SK", "TR", "CH", "RS", "PL", "UA", "BG", "ES", "ME", "CZ", "HR", "AL", "RO", "HU", "AT", "FR", "PT", "DE", "MK", "BA", "SI", "IT", "NL" ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true, + "dcPowerFactor" : 1.0, + "extensions" : { + "open-load-flow-parameters" : { + "slackBusSelectionMode" : "MOST_MESHED", + "slackBusesIds" : [ ], + "slackDistributionFailureBehavior" : "LEAVE_ON_SLACK_BUS", + "lowImpedanceBranchMode" : "REPLACE_BY_ZERO_IMPEDANCE_LINE", + "loadPowerFactorConstant" : false, + "plausibleActivePowerLimit" : 10000.0, + "newtonRaphsonStoppingCriteriaType" : "UNIFORM_CRITERIA", + "maxActivePowerMismatch" : 0.01, + "maxReactivePowerMismatch" : 0.01, + "maxVoltageMismatch" : 1.0E-4, + "maxAngleMismatch" : 1.0E-5, + "maxRatioMismatch" : 1.0E-5, + "maxSusceptanceMismatch" : 1.0E-4, + "slackBusPMaxMismatch" : 1.0, + "voltagePerReactivePowerControl" : false, + "maxNewtonRaphsonIterations" : 30, + "maxOuterLoopIterations" : 20, + "newtonRaphsonConvEpsPerEq" : 1.0E-4, + "voltageInitModeOverride" : "NONE", + "transformerVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "shuntVoltageControlMode" : "WITH_GENERATOR_VOLTAGE_CONTROL", + "minPlausibleTargetVoltage" : 0.8, + "maxPlausibleTargetVoltage" : 1.2, + "minNominalVoltageTargetVoltageCheck" : 20.0, + "minRealisticVoltage" : 0.5, + "maxRealisticVoltage" : 1.5, + "lowImpedanceThreshold" : 1.0E-8, + "reactiveRangeCheckMode" : "MAX", + "networkCacheEnabled" : false, + "svcVoltageMonitoring" : true, + "stateVectorScalingMode" : "NONE", + "maxSlackBusCount" : 1, + "debugDir" : null, + "incrementalTransformerRatioTapControlOuterLoopMaxTapShift" : 3, + "secondaryVoltageControl" : false, + "reactiveLimitsMaxPqPvSwitch" : 3, + "phaseShifterControlMode" : "CONTINUOUS_WITH_DISCRETISATION", + "alwaysUpdateNetwork" : false, + "mostMeshedSlackBusSelectorMaxNominalVoltagePercentile" : 95.0, + "reportedFeatures" : [ ], + "slackBusCountryFilter" : [ ], + "actionableSwitchesIds" : [ ], + "asymmetrical" : false, + "reactivePowerDispatchMode" : "Q_EQUAL_PROPORTION", + "outerLoopNames" : null, + "useActiveLimits" : true, + "lineSearchStateVectorScalingMaxIteration" : 10, + "lineSearchStateVectorScalingStepFold" : 1.3333333333333333, + "maxVoltageChangeStateVectorScalingMaxDv" : 0.1, + "maxVoltageChangeStateVectorScalingMaxDphi" : 0.17453292519943295, + "linePerUnitMode" : "IMPEDANCE", + "useLoadModel" : false, + "dcApproximationType" : "IGNORE_R", + "simulateAutomationSystems" : false + } + } + } + } + }, + "multi-threading" : { + "available-cpus" : 4 + } } } } \ No newline at end of file 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..fafce790ca 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,80 +1,88 @@ { - "version" : "2.5", + "version" : "3.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 10000.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_MARGIN", + "unit" : "A", "enforce-curative-security" : false }, "range-actions-optimization" : { - "max-mip-iterations" : 10, - "pst-penalty-cost" : 50.0, - "pst-sensitivity-threshold" : 1.0E-6, - "pst-model" : "CONTINUOUS", - "hvdc-penalty-cost" : 0.001, - "hvdc-sensitivity-threshold" : 1.0E-6, - "injection-ra-penalty-cost" : 0.001, - "injection-ra-sensitivity-threshold" : 1.0E-6, - "linear-optimization-solver" : { - "solver" : "CBC", - "relative-mip-gap" : 1.0E-4, - "solver-specific-parameters" : null - } + "pst-ra-min-impact-threshold" : 50.0, + "hvdc-ra-min-impact-threshold" : 0.001, + "injection-ra-min-impact-threshold" : 0.001 }, "topological-actions-optimization" : { - "max-preventive-search-tree-depth" : 2147483647, - "max-auto-search-tree-depth" : 2147483647, - "max-curative-search-tree-depth" : 2147483647, - "predefined-combinations" : [ ], "relative-minimum-impact-threshold" : 0.0, - "absolute-minimum-impact-threshold" : 1.0, - "skip-actions-far-from-most-limiting-element" : false, - "max-number-of-boundaries-for-skipping-actions" : 2 - }, - "multi-threading" : { - "contingency-scenarios-in-parallel" : 1, - "preventive-leaves-in-parallel" : 1, - "curative-leaves-in-parallel" : 1 - }, - "second-preventive-rao" : { - "execution-condition" : "DISABLED", - "re-optimize-curative-range-actions" : false, - "hint-from-first-preventive-rao" : false + "absolute-minimum-impact-threshold" : 1.0 }, "not-optimized-cnecs" : { "do-not-optimize-curative-cnecs-for-tsos-without-cras" : false }, - "load-flow-and-sensitivity-computation" : { - "load-flow-provider" : "OpenLoadFlow", - "sensitivity-provider" : "OpenLoadFlow", - "sensitivity-failure-overcost" : 10000.0, - "sensitivity-parameters" : { - "version" : "1.0", - "load-flow-parameters" : { - "version" : "1.9", - "voltageInitMode" : "UNIFORM_VALUES", - "transformerVoltageControlOn" : false, - "phaseShifterRegulationOn" : false, - "useReactiveLimits" : true, - "twtSplitShuntAdmittance" : false, - "shuntCompensatorVoltageControlOn" : false, - "readSlackBus" : true, - "writeSlackBus" : true, - "dc" : false, - "distributedSlack" : true, - "balanceType" : "PROPORTIONAL_TO_GENERATION_P", - "dcUseTransformerRatio" : true, - "countriesToBalance" : [ ], - "connectedComponentMode" : "MAIN", - "hvdcAcEmulation" : true - } - } + "mnec-parameters" : { + "acceptable-margin-decrease" : 50.0 }, "extensions" : { - "mnec-parameters" : { - "acceptable-margin-decrease" : 50.0, - "violation-cost" : 10.0, - "constraint-adjustment-coefficient" : 0.0 + "open-rao-search-tree-parameters" : { + "objective-function" : { + "curative-min-obj-improvement" : 10000.0 + }, + "range-actions-optimization" : { + "max-mip-iterations" : 10, + "pst-sensitivity-threshold" : 1.0E-6, + "pst-model" : "CONTINUOUS", + "hvdc-sensitivity-threshold" : 1.0E-6, + "injection-ra-sensitivity-threshold" : 1.0E-6, + "linear-optimization-solver" : { + "solver" : "CBC", + "relative-mip-gap" : 1.0E-4, + "solver-specific-parameters" : null + } + }, + "topological-actions-optimization" : { + "max-preventive-search-tree-depth" : 2147483647, + "max-auto-search-tree-depth" : 2147483647, + "max-curative-search-tree-depth" : 2147483647, + "predefined-combinations" : [ ], + "skip-actions-far-from-most-limiting-element" : false, + "max-number-of-boundaries-for-skipping-actions" : 2 + }, + "second-preventive-rao" : { + "execution-condition" : "DISABLED", + "re-optimize-curative-range-actions" : false, + "hint-from-first-preventive-rao" : false + }, + "load-flow-and-sensitivity-computation" : { + "load-flow-provider" : "OpenLoadFlow", + "sensitivity-provider" : "OpenLoadFlow", + "sensitivity-failure-overcost" : 10000.0, + "sensitivity-parameters" : { + "version" : "1.0", + "load-flow-parameters" : { + "version" : "1.9", + "voltageInitMode" : "UNIFORM_VALUES", + "transformerVoltageControlOn" : false, + "phaseShifterRegulationOn" : false, + "useReactiveLimits" : true, + "twtSplitShuntAdmittance" : false, + "shuntCompensatorVoltageControlOn" : false, + "readSlackBus" : true, + "writeSlackBus" : true, + "dc" : false, + "distributedSlack" : true, + "balanceType" : "PROPORTIONAL_TO_GENERATION_P", + "dcUseTransformerRatio" : true, + "countriesToBalance" : [ ], + "connectedComponentMode" : "MAIN", + "hvdcAcEmulation" : true + } + } + }, + "multi-threading" : { + "available-cpus" : 1 + }, + "mnec-parameters" : { + "violation-cost" : 10.0, + "constraint-adjustment-coefficient" : 0.0 + } } } } \ No newline at end of file