Skip to content

Commit

Permalink
Move implem specific rao parameters into extensions
Browse files Browse the repository at this point in the history
Signed-off-by: Pauline Jean-Marie <pauline.jean-marie@artelys.com>
  • Loading branch information
Pauline Jean-Marie committed Oct 28, 2024
1 parent 90481f3 commit b84b8ce
Show file tree
Hide file tree
Showing 76 changed files with 1,715 additions and 1,389 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,27 @@ private RaoParametersCommons() {
// objective function parameters
public static final String OBJECTIVE_FUNCTION = "objective-function";
public static final String OBJECTIVE_FUNCTION_SECTION = "rao-objective-function";
public static final String ST_OBJECTIVE_FUNCTION_SECTION = "search-tree-objective-function";

public static final String TYPE = "type";
public static final String CURATIVE_MIN_OBJ_IMPROVEMENT = "curative-min-obj-improvement";
public static final String ENFORCE_CURATIVE_SECURITY = "enforce-curative-security";

// range actions optimization parameters
public static final String RANGE_ACTIONS_OPTIMIZATION = "range-actions-optimization";
public static final String RANGE_ACTIONS_OPTIMIZATION_SECTION = "rao-range-actions-optimization";
public static final String ST_RANGE_ACTIONS_OPTIMIZATION_SECTION = "search-tree-range-actions-optimization";

public static final String MAX_MIP_ITERATIONS = "max-mip-iterations";
public static final String PST_PENALTY_COST = "pst-penalty-cost";
public static final String PST_RA_MIN_IMPACT_THRESHOLD = "pst-ra-min-impact-threshold";
public static final String PST_SENSITIVITY_THRESHOLD = "pst-sensitivity-threshold";
public static final String PST_MODEL = "pst-model";
public static final String HVDC_PENALTY_COST = "hvdc-penalty-cost";
public static final String HVDC_RA_MIN_IMPACT_THRESHOLD = "hvdc-ra-min-impact-threshold";
public static final String HVDC_SENSITIVITY_THRESHOLD = "hvdc-sensitivity-threshold";
public static final String INJECTION_RA_PENALTY_COST = "injection-ra-penalty-cost";
public static final String INJECTION_RA_MIN_IMPACT_THRESHOLD = "injection-ra-min-impact-threshold";
public static final String INJECTION_RA_SENSITIVITY_THRESHOLD = "injection-ra-sensitivity-threshold";
public static final String LINEAR_OPTIMIZATION_SOLVER = "linear-optimization-solver";
public static final String LINEAR_OPTIMIZATION_SOLVER_SECTION = "rao-linear-optimization-solver";
public static final String LINEAR_OPTIMIZATION_SOLVER_SECTION = "search-tree-linear-optimization-solver";
public static final String SOLVER = "solver";
public static final String RELATIVE_MIP_GAP = "relative-mip-gap";
public static final String SOLVER_SPECIFIC_PARAMETERS = "solver-specific-parameters";
Expand All @@ -49,6 +53,8 @@ private RaoParametersCommons() {
// topological actions optimization parameters
public static final String TOPOLOGICAL_ACTIONS_OPTIMIZATION = "topological-actions-optimization";
public static final String TOPOLOGICAL_ACTIONS_OPTIMIZATION_SECTION = "rao-topological-actions-optimization";
public static final String ST_TOPOLOGICAL_ACTIONS_OPTIMIZATION_SECTION = "search-tree-topological-actions-optimization";

public static final String MAX_PREVENTIVE_SEARCH_TREE_DEPTH = "max-preventive-search-tree-depth";
public static final String MAX_AUTO_SEARCH_TREE_DEPTH = "max-auto-search-tree-depth";
public static final String MAX_CURATIVE_SEARCH_TREE_DEPTH = "max-curative-search-tree-depth";
Expand All @@ -60,38 +66,24 @@ private RaoParametersCommons() {

// Multi-threading parameters
public static final String MULTI_THREADING = "multi-threading";
public static final String MULTI_THREADING_SECTION = "rao-multi-threading";
public static final String CONTINGENCY_SCENARIOS_IN_PARALLEL = "contingency-scenarios-in-parallel";
public static final String PREVENTIVE_LEAVES_IN_PARALLEL = "preventive-leaves-in-parallel";
public static final String AUTO_LEAVES_IN_PARALLEL = "auto-leaves-in-parallel";
public static final String CURATIVE_LEAVES_IN_PARALLEL = "curative-leaves-in-parallel";
public static final String MULTI_THREADING_SECTION = "search-tree-multi-threading";
public static final String AVAILABLE_CPUS = "available-cpus";

// Second Preventive RAO parameters
public static final String SECOND_PREVENTIVE_RAO = "second-preventive-rao";
public static final String SECOND_PREVENTIVE_RAO_SECTION = "rao-second-preventive-rao";
public static final String SECOND_PREVENTIVE_RAO_SECTION = "search-tree-second-preventive-rao";
public static final String EXECUTION_CONDITION = "execution-condition";
public static final String RE_OPTIMIZE_CURATIVE_RANGE_ACTIONS = "re-optimize-curative-range-actions";
public static final String HINT_FROM_FIRST_PREVENTIVE_RAO = "hint-from-first-preventive-rao";

// RA usage limits per contingency parameters
public static final String RA_USAGE_LIMITS_PER_CONTINGENCY = "ra-usage-limits-per-contingency";
public static final String RA_USAGE_LIMITS_PER_CONTINGENCY_SECTION = "rao-ra-usage-limits-per-contingency";

public static final String MAX_CURATIVE_RA = "max-curative-ra";
public static final String MAX_CURATIVE_TSO = "max-curative-tso";
public static final String MAX_CURATIVE_TOPO_PER_TSO = "max-curative-topo-per-tso";
public static final String MAX_CURATIVE_PST_PER_TSO = "max-curative-pst-per-tso";
public static final String MAX_CURATIVE_RA_PER_TSO = "max-curative-ra-per-tso";

// Not optimized cnecs parameters
public static final String NOT_OPTIMIZED_CNECS = "not-optimized-cnecs";
public static final String NOT_OPTIMIZED_CNECS_SECTION = "rao-not-optimized-cnecs";
public static final String DO_NOT_OPTIMIZE_CURATIVE_CNECS = "do-not-optimize-curative-cnecs-for-tsos-without-cras";

// Not optimized cnecs parameters
// Load flow and sensitivity parameters
public static final String LOAD_FLOW_AND_SENSITIVITY_COMPUTATION = "load-flow-and-sensitivity-computation";
public static final String LOAD_FLOW_AND_SENSITIVITY_COMPUTATION_SECTION = "rao-load-flow-and-sensitivity-computation";

public static final String LOAD_FLOW_AND_SENSITIVITY_COMPUTATION_SECTION = "search-tree-load-flow-and-sensitivity-computation";
public static final String LOAD_FLOW_PROVIDER = "load-flow-provider";
public static final String SENSITIVITY_PROVIDER = "sensitivity-provider";
public static final String SENSITIVITY_FAILURE_OVERCOST = "sensitivity-failure-overcost";
Expand Down Expand Up @@ -119,6 +111,7 @@ private RaoParametersCommons() {
public static final String RELATIVE_MARGINS_SECTION = "rao-relative-margins-parameters";
public static final String PTDF_BOUNDARIES = "ptdf-boundaries";
public static final String PTDF_SUM_LOWER_BOUND = "ptdf-sum-lower-bound";
public static final String SEARCH_TREE_PARAMETERS = "open-rao-search-tree-parameters";

public static PtdfApproximation stringToPtdfApproximation(String string) {
try {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@ static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) thr

static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) throws IOException {
while (!jsonParser.nextToken().isStructEnd()) {
switch (jsonParser.getCurrentName()) {
case DO_NOT_OPTIMIZE_CURATIVE_CNECS:
jsonParser.nextToken();
raoParameters.getNotOptimizedCnecsParameters().setDoNotOptimizeCurativeCnecsForTsosWithoutCras(jsonParser.getBooleanValue());
break;
default:
throw new OpenRaoException(String.format("Cannot deserialize not optimized cnecs parameters: unexpected field in %s (%s)", NOT_OPTIMIZED_CNECS, jsonParser.getCurrentName()));
if (jsonParser.getCurrentName().equals(DO_NOT_OPTIMIZE_CURATIVE_CNECS)) {
jsonParser.nextToken();
raoParameters.getNotOptimizedCnecsParameters().setDoNotOptimizeCurativeCnecsForTsosWithoutCras(jsonParser.getBooleanValue());
} else {
throw new OpenRaoException(String.format("Cannot deserialize not optimized cnecs parameters: unexpected field in %s (%s)", NOT_OPTIMIZED_CNECS, jsonParser.getCurrentName()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ private JsonObjectiveFunctionParameters() {
static void serialize(RaoParameters parameters, JsonGenerator jsonGenerator) throws IOException {
jsonGenerator.writeObjectFieldStart(OBJECTIVE_FUNCTION);
jsonGenerator.writeObjectField(TYPE, parameters.getObjectiveFunctionParameters().getType());
jsonGenerator.writeNumberField(CURATIVE_MIN_OBJ_IMPROVEMENT, parameters.getObjectiveFunctionParameters().getCurativeMinObjImprovement());
jsonGenerator.writeBooleanField(ENFORCE_CURATIVE_SECURITY, parameters.getObjectiveFunctionParameters().getEnforceCurativeSecurity());
jsonGenerator.writeEndObject();
}
Expand All @@ -38,10 +37,6 @@ static void deserialize(JsonParser jsonParser, RaoParameters raoParameters) thro
case TYPE:
raoParameters.getObjectiveFunctionParameters().setType(stringToObjectiveFunction(jsonParser.nextTextValue()));
break;
case CURATIVE_MIN_OBJ_IMPROVEMENT:
jsonParser.nextToken();
raoParameters.getObjectiveFunctionParameters().setCurativeMinObjImprovement(jsonParser.getValueAsDouble());
break;
case ENFORCE_CURATIVE_SECURITY:
jsonParser.nextToken();
raoParameters.getObjectiveFunctionParameters().setEnforceCurativeSecurity(jsonParser.getBooleanValue());
Expand Down
Loading

0 comments on commit b84b8ce

Please sign in to comment.