diff --git a/python-util/rao_parameter_modification.py b/python-util/rao_parameter_modification.py index c26b2cd13c..c4cc75c52e 100644 --- a/python-util/rao_parameter_modification.py +++ b/python-util/rao_parameter_modification.py @@ -6,26 +6,101 @@ import os import json +import re +from json import JSONDecodeError -root_directory = os.getcwd() +# import yaml + +current_directory = os.getcwd() def rao_parameters_file(file_path): - if file_path.endswith(".json") or file_path.endswith(".yml"): + if "target" not in file_path and file_path.endswith(".json"): #or file_path.endswith(".yml"): with open(os.path.join(dirpath, filename), 'r') as file: for line in file: if "objective-function" in line: return True return False +def read_data(file_path) -> dict: + if file_path.endswith(".json"): + with open(file_path, 'r') as file: + try: + return json.load(file) + 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)["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): + if file_path.endswith(".json"): + with open(file_path, 'r') as file: + lines = file.readlines() + lines_to_write = [] + inside_obj_fun_to_replace = False + for line in lines: + if "objective-function" in line and "objective-function" in new_data: + leading_whitespace = extract_leading_whitespace(line) + inside_obj_fun_to_replace = True + if inside_obj_fun_to_replace and "}" in line: + obj_fun_str = '"objective-function" : ' + json.dumps(new_data["objective-function"], indent=2, separators=(',', ' : ')) + ',\n' + 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) + #if file_path.endswith(".yml"): + # with open(file_path, 'r') as file: + # all_data = yaml.safe_load(file) + # all_data["rao-parameters"] = datagit diff - + # with open(file_path, 'w') as file: + # yaml.dump(all_data, file, default_flow_style=False) + +def new_rao_param(data: dict, file_path: str) -> dict: + try: + old_obj_fun = data["objective-function"] + new_obj_fun = {} + if "preventive-stop-criterion" not in old_obj_fun or old_obj_fun["preventive-stop-criterion"] == "SECURE": + new_obj_fun["type"] = "SECURE_FLOW" + new_obj_fun["enforce-curative-security"] = old_obj_fun["optimize-curative-if-preventive-unsecure"] + elif old_obj_fun["type"] in ("MAX_MIN_MARGIN_IN_MEGAWATT", "MAX_MIN_MARGIN_IN_AMPERE"): + new_obj_fun["type"] = "MAX_MIN_FLOW_MARGIN" + elif old_obj_fun["type"] in ("MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE"): + new_obj_fun["type"] = "MAX_MIN_RELATIVE_FLOW_MARGIN" + if "curative-stop-criterion" in old_obj_fun: + if "SECURE" in old_obj_fun["curative-stop-criterion"]: + new_obj_fun["enforce-curative-security"] = True + else: + new_obj_fun["enforce-curative-security"] = False + if "curative-min-obj-improvement" in old_obj_fun: + new_obj_fun["curative-min-obj-improvement"] = old_obj_fun["curative-min-obj-improvement"] + except KeyError as ke: + raise KeyError("in file " + file_path) from ke + data["objective-function"] = 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): - if file_path.endswith(".json"): - with open(file_path, 'r') as file: - data = json.load(file) - lines = [line for line in lines if "forbid-cost-increase" not in line] - 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 = read_data(file_path) + new_rao_params = new_rao_param(data, file_path) + write_data(new_rao_params, file_path) 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..80e62f7571 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/json/JsonObjectiveFunctionParameters.java @@ -27,10 +27,8 @@ 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.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(OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE, parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()); jsonGenerator.writeEndObject(); } @@ -40,19 +38,13 @@ 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_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: 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())); @@ -67,21 +59,4 @@ private static ObjectiveFunctionParameters.ObjectiveFunctionType stringToObjecti throw new OpenRaoException(String.format("Unknown objective function type value: %s", string)); } } - - private static ObjectiveFunctionParameters.PreventiveStopCriterion stringToPreventiveStopCriterion(String string) { - try { - return ObjectiveFunctionParameters.PreventiveStopCriterion.valueOf(string); - } catch (IllegalArgumentException e) { - throw new OpenRaoException(String.format("Unknown preventive stop criterion: %s", string)); - } - } - - 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..3940ebb792 100644 --- a/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ObjectiveFunctionParameters.java +++ b/ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/parameters/ObjectiveFunctionParameters.java @@ -7,7 +7,6 @@ package com.powsybl.openrao.raoapi.parameters; -import com.powsybl.openrao.commons.Unit; import com.powsybl.commons.config.PlatformConfig; import java.util.Objects; @@ -21,50 +20,19 @@ */ public class ObjectiveFunctionParameters { // Default values - private static final ObjectiveFunctionType DEFAULT_OBJECTIVE_FUNCTION = ObjectiveFunctionType.MAX_MIN_MARGIN_IN_MEGAWATT; + private static final ObjectiveFunctionType DEFAULT_OBJECTIVE_FUNCTION = ObjectiveFunctionType.SECURE_FLOW; 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 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 = ENFORCE_CURATIVE_SECURITY; // Enum public enum ObjectiveFunctionType { - MAX_MIN_MARGIN_IN_MEGAWATT(Unit.MEGAWATT), - MAX_MIN_MARGIN_IN_AMPERE(Unit.AMPERE), - MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT(Unit.MEGAWATT), - MAX_MIN_RELATIVE_MARGIN_IN_AMPERE(Unit.AMPERE); - - private final Unit unit; - - ObjectiveFunctionType(Unit unit) { - this.unit = unit; - } - - public Unit getUnit() { - return unit; - } - - public boolean relativePositiveMargins() { - return this.equals(MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT) || this.equals(MAX_MIN_RELATIVE_MARGIN_IN_AMPERE); - } - } - - public enum PreventiveStopCriterion { - MIN_OBJECTIVE, - 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 + SECURE_FLOW, + MAX_MIN_FLOW_MARGIN, + MAX_MIN_RELATIVE_FLOW_MARGIN } // Getters and setters @@ -76,32 +44,16 @@ public void setType(ObjectiveFunctionType type) { this.type = type; } - public void setPreventiveStopCriterion(PreventiveStopCriterion preventiveStopCriterion) { - this.preventiveStopCriterion = preventiveStopCriterion; - } - public double getCurativeMinObjImprovement() { return curativeMinObjImprovement; } - 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) { @@ -112,11 +64,7 @@ public static ObjectiveFunctionParameters load(PlatformConfig platformConfig) { 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.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(OPTIMIZE_CURATIVE_IF_PREVENTIVE_UNSECURE, 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 b8d2da9409..9e0879acb1 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 @@ -56,7 +56,7 @@ void roundTrip() throws IOException { 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); 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 24a54847fd..7ff96c4fd3 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 @@ -53,7 +53,7 @@ void checkObjectiveFunctionConfig() { assertEquals(123, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); - assertTrue(objectiveFunctionParameters.getOptimizeCurativeIfPreventiveUnsecure()); + assertTrue(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 714779a535..1e45841949 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 @@ -128,7 +128,7 @@ void testConfigWithoutExtensions() throws IOException { assertEquals(3, objectiveFunctionParameters.getCurativeMinObjImprovement(), DOUBLE_TOLERANCE); assertEquals(ObjectiveFunctionParameters.PreventiveStopCriterion.MIN_OBJECTIVE, objectiveFunctionParameters.getPreventiveStopCriterion()); assertEquals(ObjectiveFunctionParameters.CurativeStopCriterion.PREVENTIVE_OBJECTIVE, objectiveFunctionParameters.getCurativeStopCriterion()); - assertTrue(objectiveFunctionParameters.getOptimizeCurativeIfPreventiveUnsecure()); + assertTrue(objectiveFunctionParameters.getEnforceCurativeSecurity()); RangeActionsOptimizationParameters rangeActionsOptimizationParameters = parameters.getRangeActionsOptimizationParameters(); assertEquals(2, 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 7ae383fc8d..c85fce480b 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersSet_v2.json @@ -1,11 +1,9 @@ { "version" : "2.4", "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 + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 983.0 }, "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 index 02bd813f6b..76b6554b25 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithCurStopCriterionError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithCurStopCriterionError_v2.json @@ -1,9 +1,8 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "WRONG", - "curative-stop-criterion" : "MIN_OBJECTIVE", + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { 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 a1780fc6f3..ae722bcef7 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithExtension_v2.json @@ -1,11 +1,9 @@ { "version" : "2.4", "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 + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 bf9edb2d07..872e00e40c 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithLoopFlowError_v2.json @@ -1,9 +1,8 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, "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 42e00049a7..1de3d82b6a 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithPrevStopCriterionError_v2.json @@ -1,9 +1,8 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "WRONG", + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, "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 db2a6c9323..95fc3822d4 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParametersWithWrongField_v2.json @@ -1,9 +1,8 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, "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 03b5c11b7c..1204810068 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,11 +1,9 @@ { "version" : "2.4", "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 + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 3.0 }, "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 095628d551..55d5158e40 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,11 +1,9 @@ { "version" : "2.4", "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 + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 0b9e01fcbd..fc7a8e6712 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,11 +1,9 @@ { "version" : "2.4", "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 + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 3.0 }, "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 5b769bb9e9..d02a29dc98 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,11 +1,9 @@ { "version" : "2.4", "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 + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 3.0 }, "range-actions-optimization" : { "max-mip-iterations" : 2, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_default_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_default_v2.json index 95ab535aa0..d65ae9da9f 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,8 +1,7 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW" }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_oldVersion.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_oldVersion.json index 9f5110c69c..bc929fc88d 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_oldVersion.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_oldVersion.json @@ -1,9 +1,8 @@ { "version" : "2.0", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE", + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { diff --git a/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json b/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json index b2b3294954..e66fd42202 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_update_v2.json @@ -1,8 +1,7 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "preventive-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN" }, "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 d81c5150c3..3f598d49f2 100644 --- a/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json +++ b/ra-optimisation/rao-api/src/test/resources/RaoParameters_v2.json @@ -1,11 +1,9 @@ { "version" : "2.4", "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 + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { "max-mip-iterations" : 10, 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 15c9bb01c6..77b8c6a9ee 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulator.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/castor/algorithm/AutomatonSimulator.java @@ -80,7 +80,7 @@ public final class AutomatonSimulator { public AutomatonSimulator(Crac crac, RaoParameters raoParameters, ToolProvider toolProvider, FlowResult initialFlowResult, RangeActionSetpointResult prePerimeterRangeActionSetpointResult, PrePerimeterResult prePerimeterSensitivityOutput, Set operatorsNotSharingCras, int numberLoggedElementsDuringRao) { this.crac = crac; this.raoParameters = raoParameters; - this.flowUnit = raoParameters.getObjectiveFunctionParameters().getType().getUnit(); + this.flowUnit = RaoUtil.getObjectiveFunctionUnit(raoParameters); this.toolProvider = toolProvider; this.initialFlowResult = initialFlowResult; this.prePerimeterRangeActionSetpointResult = prePerimeterRangeActionSetpointResult; @@ -97,7 +97,7 @@ public AutomatonSimulator(Crac crac, RaoParameters raoParameters, ToolProvider t AutomatonPerimeterResultImpl simulateAutomatonState(State automatonState, Set curativeStates, Network network, StateTree stateTree, TreeParameters automatonTreeParameters) { TECHNICAL_LOGS.info("Optimizing automaton state {}.", automatonState.getId()); TECHNICAL_LOGS.info("Initial situation:"); - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, prePerimeterSensitivityOutput, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), numberLoggedElementsDuringRao); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, prePerimeterSensitivityOutput, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), RaoUtil.getObjectiveFunctionUnit(raoParameters), numberLoggedElementsDuringRao); PrePerimeterSensitivityAnalysis preAutoPstOptimizationSensitivityAnalysis = getPreAutoPerimeterSensitivityAnalysis(automatonState, curativeStates); @@ -280,7 +280,7 @@ TopoAutomatonSimulationResult simulateTopologicalAutomatons(State automatonState if (automatonRangeActionOptimizationSensitivityAnalysisOutput.getSensitivityStatus(automatonState) == ComputationStatus.FAILURE) { return new TopoAutomatonSimulationResult(automatonRangeActionOptimizationSensitivityAnalysisOutput, appliedNetworkActions); } - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, automatonRangeActionOptimizationSensitivityAnalysisOutput, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), numberLoggedElementsDuringRao); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, automatonRangeActionOptimizationSensitivityAnalysisOutput, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), RaoUtil.getObjectiveFunctionUnit(raoParameters), numberLoggedElementsDuringRao); } return new TopoAutomatonSimulationResult(automatonRangeActionOptimizationSensitivityAnalysisOutput, appliedNetworkActions); @@ -354,7 +354,7 @@ RangeAutomatonSimulationResult simulateRangeAutomatons(State automatonState, Set if (finalPostAutoResult.getSensitivityStatus(automatonState) == ComputationStatus.FAILURE) { return new RangeAutomatonSimulationResult(finalPostAutoResult, activatedRangeActions, rangeActionsWithSetpoint); } - RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, finalPostAutoResult, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), numberLoggedElementsDuringRao); + RaoLogger.logMostLimitingElementsResults(TECHNICAL_LOGS, finalPostAutoResult, Set.of(automatonState), raoParameters.getObjectiveFunctionParameters().getType(), RaoUtil.getObjectiveFunctionUnit(raoParameters), numberLoggedElementsDuringRao); } return new RangeAutomatonSimulationResult(finalPostAutoResult, activatedRangeActions, rangeActionsWithSetpoint); } @@ -528,7 +528,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, prePerimeterRangeActionSetpointResult, 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(), RaoUtil.getObjectiveFunctionUnit(raoParameters), numberLoggedElementsDuringRao); return Pair.of(result, activePowerSetpoints); } @@ -681,7 +681,7 @@ RangeAutomatonSimulationResult shiftRangeActionsUntilFlowCnecsSecure(List run() { BUSINESS_LOGS.info("Preventive perimeter could not be secured; there is no point in optimizing post-contingency perimeters. The RAO will be interrupted here."); mergedRaoResults = new PreventiveAndCurativesRaoResultImpl(raoInput.getCrac().getPreventiveState(), initialOutput, preventiveResult, preCurativeSensitivityAnalysisOutput, raoInput.getCrac()); // log results - RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, preCurativeSensitivityAnalysisOutput, raoParameters.getObjectiveFunctionParameters().getType(), NUMBER_LOGGED_ELEMENTS_END_RAO); + RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, preCurativeSensitivityAnalysisOutput, raoParameters.getObjectiveFunctionParameters().getType(), RaoUtil.getObjectiveFunctionUnit(raoParameters), NUMBER_LOGGED_ELEMENTS_END_RAO); return postCheckResults(mergedRaoResults, initialOutput, raoParameters.getObjectiveFunctionParameters()); } @@ -189,16 +189,16 @@ public CompletableFuture run() { // Log final results if (logFinalResultsOutsideOfSecondPreventive) { BUSINESS_LOGS.info("Merging preventive and post-contingency RAO results:"); - RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, stateTree.getBasecaseScenario(), preventiveResult, stateTree.getContingencyScenarios(), postContingencyResults, raoParameters.getObjectiveFunctionParameters().getType(), NUMBER_LOGGED_ELEMENTS_END_RAO); + RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, stateTree.getBasecaseScenario(), preventiveResult, stateTree.getContingencyScenarios(), postContingencyResults, raoParameters.getObjectiveFunctionParameters().getType(), RaoUtil.getObjectiveFunctionUnit(raoParameters), NUMBER_LOGGED_ELEMENTS_END_RAO); } return postCheckResults(mergedRaoResults, initialOutput, raoParameters.getObjectiveFunctionParameters()); } private boolean shouldStopOptimisationIfPreventiveUnsecure(double preventiveOptimalCost) { - return raoParameters.getObjectiveFunctionParameters().getPreventiveStopCriterion().equals(ObjectiveFunctionParameters.PreventiveStopCriterion.SECURE) + return raoParameters.getObjectiveFunctionParameters().getType() == ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW && preventiveOptimalCost > 0 - && !raoParameters.getObjectiveFunctionParameters().getOptimizeCurativeIfPreventiveUnsecure(); + && !raoParameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity(); } /** @@ -244,7 +244,7 @@ private CompletableFuture postCheckResults(RaoResult raoResult, PrePe formatDouble(initialCost), formatDouble(initialFunctionalCost), formatDouble(initialVirtualCost), formatDouble(finalCost), formatDouble(finalFunctionalCost), formatDouble(finalVirtualCost)); // log results - RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, initialResult, objectiveFunctionParameters.getType(), NUMBER_LOGGED_ELEMENTS_END_RAO); + RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, initialResult, objectiveFunctionParameters.getType(), RaoUtil.getObjectiveFunctionUnit(raoParameters), 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/commons/RaoLogger.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoLogger.java index ddd7b1b6c8..cda33a5415 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 @@ -63,6 +63,7 @@ public static void logSensitivityAnalysisResults(String prefix, RaoLogger.logMostLimitingElementsResults(BUSINESS_LOGS, sensitivityAnalysisResult, raoParameters.getObjectiveFunctionParameters().getType(), + RaoUtil.getObjectiveFunctionUnit(raoParameters), numberOfLoggedLimitingElements); } @@ -89,16 +90,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 objectiveFunctionUnit, int numberOfLoggedElements) { + logMostLimitingElementsResults(logger, optimizationResult, optimizationResult, null, objectiveFunction, objectiveFunctionUnit, 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 objectiveFunctionUnit, int numberOfLoggedElements) { + logMostLimitingElementsResults(logger, prePerimeterResult, prePerimeterResult, states, objectiveFunction, objectiveFunctionUnit, 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 objectiveFunctionUnit, int numberOfLoggedElements) { + logMostLimitingElementsResults(logger, prePerimeterResult, prePerimeterResult, null, objectiveFunction, objectiveFunctionUnit, numberOfLoggedElements); } private static void logMostLimitingElementsResults(OpenRaoLogger logger, @@ -106,8 +107,9 @@ private static void logMostLimitingElementsResults(OpenRaoLogger logger, FlowResult flowResult, Set states, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit objectiveFunctionUnit, int numberOfLoggedElements) { - getMostLimitingElementsResults(objectiveFunctionResult, flowResult, states, objectiveFunction, numberOfLoggedElements) + getMostLimitingElementsResults(objectiveFunctionResult, flowResult, states, objectiveFunction, objectiveFunctionUnit, numberOfLoggedElements) .forEach(logger::info); } @@ -115,10 +117,10 @@ 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(); + boolean relativePositiveMargins = objectiveFunction == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN; List sortedCnecs = getMostLimitingElements(objectiveFunctionResult, states, numberOfLoggedElements); @@ -129,7 +131,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 = %.2f %s%s, element %s at state %s, CNEC ID = \"%s\"", i + 1, @@ -146,12 +148,12 @@ 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(); + boolean relativePositiveMargins = objectiveFunction == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN; double marginLeft = relativePositiveMargins ? flowResult.getRelativeMargin(cnec, TwoSides.ONE, unit) : flowResult.getMargin(cnec, TwoSides.ONE, unit); double marginRight = relativePositiveMargins ? flowResult.getRelativeMargin(cnec, TwoSides.TWO, unit) : flowResult.getMargin(cnec, TwoSides.TWO, unit); return marginRight < marginLeft ? TwoSides.TWO : TwoSides.ONE; @@ -163,8 +165,9 @@ public static void logMostLimitingElementsResults(OpenRaoLogger logger, Set contingencyScenarios, Map contingencyOptimizationResults, ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, + Unit objectiveFunctionUnit, int numberOfLoggedElements) { - getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, objectiveFunction, numberOfLoggedElements) + getMostLimitingElementsResults(preventivePerimeter, basecaseOptimResult, contingencyScenarios, contingencyOptimizationResults, objectiveFunction, objectiveFunctionUnit, numberOfLoggedElements) .forEach(logger::info); } @@ -173,10 +176,10 @@ 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(); + boolean relativePositiveMargins = objectiveFunction == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN; Map mostLimitingElementsAndMargins = getMostLimitingElementsAndMargins(basecaseOptimResult, preventivePerimeter.getAllStates(), unit, relativePositiveMargins, numberOfLoggedElements); diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoUtil.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/RaoUtil.java index 7f9ad88987..d5f55c285d 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 @@ -19,6 +19,7 @@ import com.powsybl.openrao.data.cracapi.usagerule.*; import com.powsybl.openrao.data.refprog.referenceprogram.ReferenceProgramBuilder; 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.LoopFlowParametersExtension; @@ -52,12 +53,10 @@ public static void initNetwork(Network network, String networkVariantId) { } public static void checkParameters(RaoParameters raoParameters, RaoInput raoInput) { - if (raoParameters.getObjectiveFunctionParameters().getType().getUnit().equals(Unit.AMPERE) - && raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().isDc()) { - throw new OpenRaoException(format("Objective function %s cannot be calculated with a DC default sensitivity engine", raoParameters.getObjectiveFunctionParameters().getType().toString())); - } - if (raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) { + boolean relativePositiveMargins = raoParameters.getObjectiveFunctionParameters().getType() == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN; + + if (relativePositiveMargins) { if (raoInput.getGlskProvider() == null) { throw new OpenRaoException(format("Objective function %s requires glsks", raoParameters.getObjectiveFunctionParameters().getType())); } @@ -66,9 +65,7 @@ public static void checkParameters(RaoParameters raoParameters, RaoInput raoInpu } } - if ((raoParameters.hasExtension(LoopFlowParametersExtension.class) - || raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) - && (Objects.isNull(raoInput.getReferenceProgram()))) { + if ((raoParameters.hasExtension(LoopFlowParametersExtension.class) || 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())); } @@ -89,6 +86,10 @@ public static void checkParameters(RaoParameters raoParameters, RaoInput raoInpu } } + public static Unit getObjectiveFunctionUnit(RaoParameters raoParameters) { + return raoParameters.getLoadFlowAndSensitivityParameters().getSensitivityWithLoadFlowParameters().getLoadFlowParameters().isDc() ? Unit.MEGAWATT : Unit.AMPERE; + } + public static double getFlowUnitMultiplier(FlowCnec cnec, TwoSides voltageSide, Unit unitFrom, Unit unitTo) { if (unitFrom == unitTo) { return 1; @@ -165,7 +166,7 @@ private static Set getAllUsageMethods(Set usageRules, Re return usageRules.stream() .filter(ur -> ur instanceof OnContingencyState || ur instanceof OnInstant || (ur instanceof OnFlowConstraintInCountry || ur instanceof OnConstraint onConstraint && onConstraint.getCnec() instanceof FlowCnec) - && isAnyMarginNegative(flowResult, remedialAction.getFlowCnecsConstrainingForOneUsageRule(ur, flowCnecs, network), raoParameters.getObjectiveFunctionParameters().getType().getUnit())) + && isAnyMarginNegative(flowResult, remedialAction.getFlowCnecsConstrainingForOneUsageRule(ur, flowCnecs, network), getObjectiveFunctionUnit(raoParameters))) .map(ur -> ur.getUsageMethod(state)) .collect(Collectors.toSet()); } 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 769cc137fb..f17afb8ad1 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 @@ -18,6 +18,7 @@ import com.powsybl.openrao.loopflowcomputation.LoopFlowComputation; import com.powsybl.openrao.loopflowcomputation.LoopFlowComputationImpl; import com.powsybl.openrao.raoapi.RaoInput; +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.RelativeMarginsParametersExtension; @@ -210,7 +211,7 @@ public static ToolProvider buildFromRaoInputAndParameters(RaoInput raoInput, Rao ) ); } - if (raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) { + if (raoParameters.getObjectiveFunctionParameters().getType() == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN) { if (!raoParameters.hasExtension(RelativeMarginsParametersExtension.class)) { throw new OpenRaoException("No relative margins parameters were defined with objective function " + raoParameters.getObjectiveFunctionParameters().getType()); } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java index 21aac1470f..6d2fda272f 100644 --- a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java +++ b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/objectivefunctionevaluator/ObjectiveFunction.java @@ -7,13 +7,16 @@ package com.powsybl.openrao.searchtreerao.commons.objectivefunctionevaluator; +import com.powsybl.openrao.commons.Unit; import com.powsybl.openrao.data.cracapi.Crac; import com.powsybl.openrao.data.cracapi.cnec.Cnec; import com.powsybl.openrao.data.cracapi.cnec.FlowCnec; import com.powsybl.openrao.data.raoresultapi.ComputationStatus; +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.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.result.api.*; import org.apache.commons.lang3.tuple.Pair; @@ -80,13 +83,13 @@ public ObjectiveFunction buildForInitialSensitivityComputation(Set flo RangeActionSetpointResult prePerimeterRangeActionSetpointResult) { // min margin objective function MarginEvaluator marginEvaluator; - if (raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) { + if (raoParameters.getObjectiveFunctionParameters().getType() == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN) { marginEvaluator = new BasicRelativeMarginEvaluator(); } else { marginEvaluator = new BasicMarginEvaluator(); } - this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getType().getUnit(), marginEvaluator)); + this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, RaoUtil.getObjectiveFunctionUnit(raoParameters), marginEvaluator)); // sensitivity failure over-cost should be computed on initial sensitivity result too // (this allows the RAO to prefer RAs that can remove sensitivity failures) @@ -108,27 +111,29 @@ public ObjectiveFunction build(Set flowCnecs, // min margin objective function MarginEvaluator marginEvaluator; - if (raoParameters.getObjectiveFunctionParameters().getType().relativePositiveMargins()) { + if (raoParameters.getObjectiveFunctionParameters().getType() == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN) { marginEvaluator = new BasicRelativeMarginEvaluator(); } else { marginEvaluator = new BasicMarginEvaluator(); } + Unit unit = RaoUtil.getObjectiveFunctionUnit(raoParameters); + // Unoptimized cnecs in operatorsNotToOptimizeInCurative countries if (raoParameters.getNotOptimizedCnecsParameters().getDoNotOptimizeCurativeCnecsForTsosWithoutCras() && !operatorsNotToOptimizeInCurative.isEmpty()) { - this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getType().getUnit(), + this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, unit, new MarginEvaluatorWithMarginDecreaseUnoptimizedCnecs(marginEvaluator, operatorsNotToOptimizeInCurative, prePerimeterFlowResult))); } else { - this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, raoParameters.getObjectiveFunctionParameters().getType().getUnit(), marginEvaluator)); + this.withFunctionalCostEvaluator(new MinMarginEvaluator(flowCnecs, unit, marginEvaluator)); } // mnec virtual cost evaluator if (raoParameters.hasExtension(MnecParametersExtension.class)) { this.withVirtualCostEvaluator(new MnecViolationCostEvaluator( flowCnecs.stream().filter(Cnec::isMonitored).collect(Collectors.toSet()), - raoParameters.getObjectiveFunctionParameters().getType().getUnit(), + unit, initialFlowResult, raoParameters.getExtension(MnecParametersExtension.class) )); diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/commons/parameters/TreeParameters.java index 300af61bb1..4e69deffbe 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,7 +6,6 @@ */ 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.RaoParameters; @@ -30,21 +29,18 @@ public static TreeParameters buildForPreventivePerimeter(RaoParameters parameter 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()); + if (parameters.getObjectiveFunctionParameters().getType() == ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW) { + return new TreeParameters(StopCriterion.AT_TARGET_OBJECTIVE_VALUE, + 0.0, // secure + parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), + parameters.getMultithreadingParameters().getPreventiveLeavesInParallel(), + shouldShrinkRaRange); + } else { + return new TreeParameters(StopCriterion.MIN_OBJECTIVE, + 0.0, // value does not matter + parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), + parameters.getMultithreadingParameters().getPreventiveLeavesInParallel(), + shouldShrinkRaRange); } } @@ -55,25 +51,17 @@ public static TreeParameters buildForAutomatonPerimeter(RaoParameters parameters public static TreeParameters buildForCurativePerimeter(RaoParameters parameters, Double preventiveOptimizedCost) { StopCriterion stopCriterion; double targetObjectiveValue; - switch (parameters.getObjectiveFunctionParameters().getCurativeStopCriterion()) { - case MIN_OBJECTIVE: - stopCriterion = StopCriterion.MIN_OBJECTIVE; - targetObjectiveValue = 0.0; - break; - case SECURE: + if (parameters.getObjectiveFunctionParameters().getType() == ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW) { + stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; + targetObjectiveValue = 0.0; + } else { + if (parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity()) { stopCriterion = StopCriterion.AT_TARGET_OBJECTIVE_VALUE; - targetObjectiveValue = 0.0; - break; - case PREVENTIVE_OBJECTIVE: + targetObjectiveValue = Math.min(preventiveOptimizedCost - parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement(), 0); + } else { 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()); + } } RangeActionsOptimizationParameters.RaRangeShrinking raRangeShrinking = parameters.getRangeActionsOptimizationParameters().getRaRangeShrinking(); boolean shouldShrinkRaRange = raRangeShrinking.equals(RangeActionsOptimizationParameters.RaRangeShrinking.ENABLED_IN_FIRST_PRAO_AND_CRAO) || @@ -87,8 +75,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().getType().equals(ObjectiveFunctionParameters.ObjectiveFunctionType.SECURE_FLOW)) { return new TreeParameters(StopCriterion.AT_TARGET_OBJECTIVE_VALUE, 0.0, // secure parameters.getTopoOptimizationParameters().getMaxPreventiveSearchTreeDepth(), diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblemBuilder.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/algorithms/linearproblem/LinearProblemBuilder.java index 204115bfda..c6b351f640 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,6 +9,7 @@ import com.powsybl.openrao.data.cracapi.State; import com.powsybl.openrao.data.cracapi.rangeaction.PstRangeAction; import com.powsybl.openrao.data.cracapi.rangeaction.RangeAction; +import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.raoapi.parameters.RangeActionsOptimizationParameters; import com.powsybl.openrao.searchtreerao.commons.optimizationperimeters.CurativeOptimizationPerimeter; import com.powsybl.openrao.searchtreerao.linearoptimisation.algorithms.fillers.*; @@ -41,7 +42,7 @@ public LinearProblem buildFromInputsAndParameters(IteratingLinearOptimizerInput .withProblemFiller(buildCoreProblemFiller()); // max.min margin, or max.min relative margin - if (parameters.getObjectiveFunction().relativePositiveMargins()) { + if (parameters.getObjectiveFunction() == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN) { this.withProblemFiller(buildMaxMinRelativeMarginFiller()); } else { this.withProblemFiller(buildMaxMinMarginFiller()); @@ -125,7 +126,7 @@ private ProblemFiller buildMaxMinRelativeMarginFiller() { return new MaxMinRelativeMarginFiller( inputs.getOptimizationPerimeter().getOptimizedFlowCnecs(), inputs.getPreOptimizationFlowResult(), - parameters.getObjectiveFunction().getUnit(), + parameters.getObjectiveFunctionUnit(), parameters.getMaxMinRelativeMarginParameters() ); } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/parameters/IteratingLinearOptimizerParameters.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/linearoptimisation/parameters/IteratingLinearOptimizerParameters.java index 61268601c3..8fd31bd04b 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 @@ -14,6 +14,7 @@ import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.commons.parameters.*; /** @@ -61,16 +62,7 @@ public ObjectiveFunctionParameters.ObjectiveFunctionType getObjectiveFunction() } public Unit getObjectiveFunctionUnit() { - return getObjectiveFunction().getUnit(); - } - - public boolean hasRelativeMargins() { - return getObjectiveFunction().relativePositiveMargins(); - } - - public boolean hasOperatorsNotToOptimize() { - return unoptimizedCnecParameters != null - && !unoptimizedCnecParameters.getOperatorsNotToOptimize().isEmpty(); + return RaoUtil.getObjectiveFunctionUnit(getLoopFlowParameters().getExtendable()); } public boolean isRaoWithLoopFlowLimitation() { @@ -185,7 +177,7 @@ public LinearOptimizerParametersBuilder withRaRangeShrinking(boolean raRangeShri } public IteratingLinearOptimizerParameters build() { - if (objectiveFunction.relativePositiveMargins() && maxMinRelativeMarginParameters == null) { + if (objectiveFunction == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN && maxMinRelativeMarginParameters == null) { throw new OpenRaoException("An objective function with relative margins requires parameters on relative margins."); } diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTree.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/algorithms/SearchTree.java index 3031a3b816..330cc53674 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 @@ -13,6 +13,7 @@ import com.powsybl.openrao.data.cracapi.cnec.FlowCnec; import com.powsybl.iidm.network.TwoSides; import com.powsybl.openrao.data.cracapi.networkaction.NetworkAction; +import com.powsybl.openrao.raoapi.parameters.ObjectiveFunctionParameters; import com.powsybl.openrao.searchtreerao.commons.NetworkActionCombination; import com.powsybl.openrao.searchtreerao.commons.RaoLogger; import com.powsybl.openrao.searchtreerao.commons.SensitivityComputer; @@ -106,21 +107,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, 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, 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, NUMBER_LOGGED_ELEMENTS_DURING_TREE); logVirtualCostInformation(rootLeaf, ""); if (stopCriterionReached(rootLeaf)) { @@ -377,7 +378,7 @@ private SensitivityComputer getSensitivityComputerForEvaluation(boolean isRootLe sensitivityComputerBuilder.withAppliedRemedialActions(getPreviousDepthAppliedRemedialActionsBeforeNewLeafEvaluation(previousDepthOptimalLeaf)); } - if (parameters.getObjectiveFunction().relativePositiveMargins()) { + if (parameters.getObjectiveFunction() == ObjectiveFunctionParameters.ObjectiveFunctionType.MAX_MIN_RELATIVE_FLOW_MARGIN) { if (parameters.getMaxMinRelativeMarginParameters().getPtdfApproximation().shouldUpdatePtdfWithTopologicalChange()) { sensitivityComputerBuilder.withPtdfsResults(input.getToolProvider().getAbsolutePtdfSumsComputation(), input.getOptimizationPerimeter().getFlowCnecs()); } else { @@ -506,7 +507,7 @@ && costSatisfiesStopCriterion(leaf.getCost() - leaf.getVirtualCost(virtualCostNa } List getVirtualCostlyElementsLogs(Leaf leaf, String virtualCostName, String prefix) { - Unit unit = parameters.getObjectiveFunction().getUnit(); + Unit unit = parameters.getObjectiveFunctionUnit(); List logs = new ArrayList<>(); int i = 1; for (FlowCnec flowCnec : leaf.getCostlyElements(virtualCostName, NUMBER_LOGGED_VIRTUAL_COSTLY_ELEMENTS)) { diff --git a/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParameters.java b/ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/searchtree/parameters/SearchTreeParameters.java index fd1ebef0b2..f50f986e65 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.cracapi.Crac; import com.powsybl.openrao.data.cracapi.Instant; import com.powsybl.openrao.data.cracapi.RaUsageLimits; @@ -18,6 +19,7 @@ import com.powsybl.openrao.raoapi.parameters.extensions.LoopFlowParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.MnecParametersExtension; import com.powsybl.openrao.raoapi.parameters.extensions.RelativeMarginsParametersExtension; +import com.powsybl.openrao.searchtreerao.commons.RaoUtil; import com.powsybl.openrao.searchtreerao.commons.parameters.*; import com.powsybl.openrao.searchtreerao.result.api.OptimizationResult; import com.powsybl.openrao.searchtreerao.result.api.PrePerimeterResult; @@ -47,6 +49,7 @@ public class SearchTreeParameters { private final UnoptimizedCnecParameters unoptimizedCnecParameters; private final RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters; private final int maxNumberOfIterations; + private final Unit objectiveFunctionUnit; public SearchTreeParameters(ObjectiveFunctionParameters.ObjectiveFunctionType objectiveFunction, TreeParameters treeParameters, @@ -58,7 +61,8 @@ public SearchTreeParameters(ObjectiveFunctionParameters.ObjectiveFunctionType ob LoopFlowParametersExtension loopFlowParameters, UnoptimizedCnecParameters unoptimizedCnecParameters, RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters, - int maxNumberOfIterations) { + int maxNumberOfIterations, + Unit objectiveFunctionUnit) { this.objectiveFunction = objectiveFunction; this.treeParameters = treeParameters; this.networkActionParameters = networkActionParameters; @@ -70,6 +74,7 @@ public SearchTreeParameters(ObjectiveFunctionParameters.ObjectiveFunctionType ob this.unoptimizedCnecParameters = unoptimizedCnecParameters; this.solverParameters = solverParameters; this.maxNumberOfIterations = maxNumberOfIterations; + this.objectiveFunctionUnit = objectiveFunctionUnit; } public ObjectiveFunctionParameters.ObjectiveFunctionType getObjectiveFunction() { @@ -116,6 +121,10 @@ public int getMaxNumberOfIterations() { return maxNumberOfIterations; } + public Unit getObjectiveFunctionUnit() { + return objectiveFunctionUnit; + } + public void setRaLimitationsForSecondPreventive(RaUsageLimits raUsageLimits, Set> rangeActionSet, Instant preventiveInstant) { if (rangeActionSet.isEmpty()) { return; @@ -246,6 +255,7 @@ public static class SearchTreeParametersBuilder { private UnoptimizedCnecParameters unoptimizedCnecParameters; private RangeActionsOptimizationParameters.LinearOptimizationSolver solverParameters; private int maxNumberOfIterations; + private Unit objectiveFunctionUnit; public SearchTreeParametersBuilder withConstantParametersOverAllRao(RaoParameters raoParameters, Crac crac) { this.objectiveFunction = raoParameters.getObjectiveFunctionParameters().getType(); @@ -257,6 +267,7 @@ public SearchTreeParametersBuilder withConstantParametersOverAllRao(RaoParameter this.loopFlowParameters = raoParameters.getExtension(LoopFlowParametersExtension.class); this.solverParameters = raoParameters.getRangeActionsOptimizationParameters().getLinearOptimizationSolver(); this.maxNumberOfIterations = raoParameters.getRangeActionsOptimizationParameters().getMaxMipIterations(); + this.objectiveFunctionUnit = RaoUtil.getObjectiveFunctionUnit(raoParameters); return this; } @@ -315,6 +326,11 @@ public SearchTreeParametersBuilder withMaxNumberOfIterations(int maxNumberOfIter return this; } + public SearchTreeParametersBuilder withObjectiveFunctionUnit(Unit unit) { + this.objectiveFunctionUnit = unit; + return this; + } + public SearchTreeParameters build() { return new SearchTreeParameters(objectiveFunction, treeParameters, @@ -326,7 +342,8 @@ public SearchTreeParameters build() { loopFlowParameters, unoptimizedCnecParameters, solverParameters, - maxNumberOfIterations); + maxNumberOfIterations, + objectiveFunctionUnit); } } } 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 f3f66c795c..115c53ea2d 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 @@ -976,7 +976,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(); @@ -991,7 +991,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(); @@ -1005,7 +1005,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveMinMarginNegative() throws IOEx RaoInput raoInput = RaoInput.build(network, crac).build(); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(false); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(false); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); @@ -1020,7 +1020,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(); @@ -1035,7 +1035,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(); @@ -1049,7 +1049,7 @@ void curativeOptimizationShouldBeDoneIfPreventiveMinMarginNegativeAndAssociatedP RaoInput raoInput = RaoInput.build(network, crac).build(); RaoParameters raoParameters = JsonRaoParameters.read(getClass().getResourceAsStream("/parameters/RaoParameters_2P_v2.json")); - raoParameters.getObjectiveFunctionParameters().setOptimizeCurativeIfPreventiveUnsecure(true); + raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(true); // Run RAO RaoResult raoResult = new CastorFullOptimization(raoInput, raoParameters, null).run().join(); 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 1d0c4b0d94..91858caa12 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 525605270d..fcff1c2a82 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 20e61a5c1a..9fe1f18457 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { "max-mip-iterations" : 5, 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 9e0ac5a2ef..fff5738686 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_default.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_default.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 8c1c4f85fe..c3c92dd1b7 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 dd116995c9..b3e6b1d61a 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 25d9e75990..f65fb139fa 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 5d433ed786..c3c92dd1b7 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 995c9d0d9d..18c074c9d2 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 665ce88003..d43197f9b9 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 47169ace12..7ecb869aa3 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 bc28de02fa..c6aa22b868 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 afb9659d4e..5b615cae6b 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 35617e2741..84a260c582 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 2227e62a10..801670ebf9 100644 --- a/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json +++ b/tests/src/test/resources/files/configurations/common/RaoParameters_securityAnalysis.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 9a6c30f6d0..c78007a5ce 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 5dcd572aea..089703dff7 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 a3856e0bac..35b2a76afe 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case1.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 ed4ee55ff9..67f52d31ea 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us2case2.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 26ac3fb1a5..0fc4e43b31 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us3case1.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 119c44d4f7..254dd37071 100644 --- a/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json +++ b/tests/src/test/resources/files/configurations/epic10/conf_ep10us4case1.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 0f9e88660d..e35ab84453 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 b2d8e0a5ed..b4b285747a 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 425ee12354..ac801006b3 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 2e9a8109ea..92d5d2f345 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjective.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 ea2940feb6..4f9c1b5855 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveDisabled2P.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 7046571fa2..bae99d5474 100644 --- a/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json +++ b/tests/src/test/resources/files/configurations/epic12/raoParametersSweIDCC_minObjectiveWithGlobal2P.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 cdabf71ae2..6daf71f76f 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 db255b52a2..6daf71f76f 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 02b6465c3f..8783da344b 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 300.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE_AND_SECURE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 300.0 }, "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 8ec6abad32..2074a68216 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 500.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 500.0 }, "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 8ebcc687de..be3f4785bc 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 628.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 628.0 }, "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 4641b8b25b..e2a71bba01 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us6case8.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 66b6419eba..4ac85f3f5d 100644 --- a/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json +++ b/tests/src/test/resources/files/configurations/epic13/RaoParameters_ep13us7case6.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 03365256aa..efd6187012 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 9d7b6651e0..bce279d971 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 70006cf93d..778d11f3cc 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 93768e5243..2e6ad2d1b3 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 56bb151094..c3c92dd1b7 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 7fb5f124fa..be9daf5aea 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 7a4b9d0d07..8f8c609b1d 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 ab5f1dde47..377799428a 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 7a49214f71..eefb25f2b8 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 efdfd4f26d..c938541f3a 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 01c77d7fe7..530d6858eb 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case1.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 7bfa2c2bc0..48bb9fdee9 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case10.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 7925aea5c1..f9448344b1 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case2.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 34229c42dd..1f0853192a 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case5.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 dfde7cd74d..b85b9a6e0b 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case6.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 07f50cea5b..2a6e9889dd 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case7.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 1cee2dce99..a54296d64e 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us13case8.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 c483237292..1e8a6e6f61 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case10.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 c483237292..1e8a6e6f61 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case11.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 962c96b181..8561194111 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case12.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 1e01897d37..9821ad17d4 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case2.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 1e01897d37..9821ad17d4 100644 --- a/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json +++ b/tests/src/test/resources/files/configurations/epic15/RaoParameters_ep15us17case6.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { "max-mip-iterations" : 5, diff --git a/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json b/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json index 834977df2c..8a56c4deac 100644 --- a/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json +++ b/tests/src/test/resources/files/configurations/epic15/raoParametersSweIDCC_withoutPsts.json @@ -1,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 52968c05ba..8102b97601 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 8aba789fae..55c28680a9 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 f5ad64a864..bc2b019d1a 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 5e0fbd16c9..2937f45df1 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 2866e3965d..034d4bdee2 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 d0eef81979..034d4bdee2 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 9d7e080262..b4272d2e49 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 d62cf6397b..6347acdb87 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 cf6f387ec2..b4272d2e49 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 563ca1e990..6347acdb87 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_RELATIVE_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_RELATIVE_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 924871b337..8f8c609b1d 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 7c0c1ef192..d1ee47f5dc 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 2e741066c1..7e09271165 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 f9a1eaa8ef..410a891ba7 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 50.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "PREVENTIVE_OBJECTIVE_AND_SECURE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 50.0 }, "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 8b45f7ba04..d3d6e03035 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 8c1c4f85fe..c3c92dd1b7 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 af719b49f4..8d97d032f1 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 192cc8c01d..e2449fc7c8 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 c32dbc79e7..7d5ad50bb8 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 05f0fab54c..060981bfd4 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 b4452cf8ec..59d3e2814a 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 50c6dc4d1c..c62ef105d4 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 4fd6bdd297..a57b035696 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 705aef00be..347af67e25 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 034a43da40..483df73d68 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 2cd8d88f35..c6c29c3374 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 5b0323f3d9..c51a814325 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 48b5a69737..8b7b30b368 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 ab354df98d..9212d72908 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 e2788dcc60..759e805755 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 0bccbc42df..4e9703002d 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 8f689f1394..d3aa8d806a 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 9fef1d2c6b..4d0b824921 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 02d5780b7f..e943321447 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 f7538691b6..4d2c9ea85a 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 be1690c65f..29c5e94694 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 8db4306490..1f0d36e38a 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 a15531ea49..a1e51696a8 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 5d240725c7..0b55dfdcfa 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 603ceaed12..7ef2381612 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 b449b1c5a6..9a30786910 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 c8e35b7997..497c386127 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 7939a6743f..0ae6590f0b 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 0b3783961e..0acb4c6db8 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 c25ae8d3f3..7e6fd2433d 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "SECURE", - "curative-stop-criterion" : "SECURE" + "type" : "SECURE_FLOW", + "enforce-curative-security" : true, + "curative-min-obj-improvement" : 0.0 }, "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 098ceb9018..c64d2d02bc 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 d61f254914..ed7ba1714f 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_MEGAWATT", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "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 b1d0dcae85..2421a39bb7 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,10 +1,9 @@ { "version" : "2.4", "objective-function" : { - "type" : "MAX_MIN_MARGIN_IN_AMPERE", - "curative-min-obj-improvement" : 0.0, - "preventive-stop-criterion" : "MIN_OBJECTIVE", - "curative-stop-criterion" : "MIN_OBJECTIVE" + "type" : "MAX_MIN_FLOW_MARGIN", + "enforce-curative-security" : false, + "curative-min-obj-improvement" : 0.0 }, "range-actions-optimization" : { "max-mip-iterations" : 10,