Skip to content

Commit b77d560

Browse files
committed
comments
Signed-off-by: Godelaine de Montmorillon <godelaine.demontmorillon@rte-france.com>
1 parent 8d94caa commit b77d560

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

  • ra-optimisation
    • rao-api/src/main/java/com/powsybl/openrao/raoapi
    • search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/marmot

ra-optimisation/rao-api/src/main/java/com/powsybl/openrao/raoapi/IcsImporter.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ public final class IcsImporter {
2424
private static final int OFFSET = 2;
2525
private static final double COST_UP = 10;
2626
private static final double COST_DOWN = 10;
27-
private static final double ACTIVATION_COST = 50;
27+
private static final String MAX_GRADIENT = "1000";
2828

29-
//TODO:QUALITY CHECK: do PO respect constraints?
29+
// TODO:QUALITY CHECK: do PO respect constraints?
30+
// TODO:QUALITY CHECK: consistency between gsks defined in static file + gsk file
31+
32+
// INFOS
33+
// Gradient constraints are defined for gsks à la maille parade, et pas par générateur : on applique donc le shift key au Pmax/Pmin
3034

3135
private IcsImporter() {
3236
//should only be used statically
@@ -127,9 +131,9 @@ private static void importGskRedispatchingAction(InterTemporalRaoInputWithNetwor
127131
PowerGradient powerGradient = PowerGradient.builder()
128132
.withNetworkElementId(networkElementPerGskElement.get(nodeId))
129133
.withMaxValue(shiftKey * Double.parseDouble(
130-
staticRecord.get("Maximum positive power gradient [MW/h]").isEmpty() ? "1000" : staticRecord.get("Maximum positive power gradient [MW/h]")
134+
staticRecord.get("Maximum positive power gradient [MW/h]").isEmpty() ? MAX_GRADIENT : staticRecord.get("Maximum positive power gradient [MW/h]")
131135
)).withMinValue(-shiftKey * Double.parseDouble(
132-
staticRecord.get("Maximum negative power gradient [MW/h]").isEmpty() ? "1000" : staticRecord.get("Maximum negative power gradient [MW/h]")
136+
staticRecord.get("Maximum negative power gradient [MW/h]").isEmpty() ? MAX_GRADIENT : staticRecord.get("Maximum negative power gradient [MW/h]")
133137
)).build();
134138
interTemporalRaoInput.getPowerGradients().add(powerGradient);
135139
});
@@ -174,9 +178,9 @@ private static void importNodeRedispatchingAction(InterTemporalRaoInputWithNetwo
174178
PowerGradient powerGradient = PowerGradient.builder()
175179
.withNetworkElementId(networkElementId)
176180
.withMaxValue(Double.parseDouble(
177-
staticRecord.get("Maximum positive power gradient [MW/h]").isEmpty() ? "1000" : staticRecord.get("Maximum positive power gradient [MW/h]")
181+
staticRecord.get("Maximum positive power gradient [MW/h]").isEmpty() ? MAX_GRADIENT : staticRecord.get("Maximum positive power gradient [MW/h]")
178182
)).withMinValue(-Double.parseDouble(
179-
staticRecord.get("Maximum negative power gradient [MW/h]").isEmpty() ? "1000" : staticRecord.get("Maximum negative power gradient [MW/h]")
183+
staticRecord.get("Maximum negative power gradient [MW/h]").isEmpty() ? MAX_GRADIENT : staticRecord.get("Maximum negative power gradient [MW/h]")
180184
)).build();
181185
interTemporalRaoInput.getPowerGradients().add(powerGradient);
182186
}
@@ -225,9 +229,9 @@ private static boolean shouldBeImported(CSVRecord staticRecord, Map<String, Map<
225229

226230
private static boolean p0RespectsGradients(CSVRecord staticRecord, CSVRecord p0record, Set<OffsetDateTime> dateTimes) {
227231
double maxGradient = Double.parseDouble(staticRecord.get("Maximum positive power gradient [MW/h]").isEmpty() ?
228-
"1000" : staticRecord.get("Maximum positive power gradient [MW/h]"));
232+
MAX_GRADIENT : staticRecord.get("Maximum positive power gradient [MW/h]"));
229233
double minGradient = -Double.parseDouble(staticRecord.get("Maximum negative power gradient [MW/h]").isEmpty() ?
230-
"1000" : staticRecord.get("Maximum negative power gradient [MW/h]"));
234+
MAX_GRADIENT : staticRecord.get("Maximum negative power gradient [MW/h]"));
231235

232236
Iterator<OffsetDateTime> dateTimeIterator = dateTimes.iterator();
233237
OffsetDateTime currentDateTime = dateTimeIterator.next();

ra-optimisation/search-tree-rao/src/main/java/com/powsybl/openrao/searchtreerao/marmot/Marmot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public CompletableFuture<TemporalData<RaoResult>> run(InterTemporalRaoInputWithN
132132
raoInput.getNetwork().getVariantManager().setWorkingVariant("PreMipScenario");
133133
});
134134

135-
// 3. Run post topo sensitivity analysis on all timestamps ON CONSIDERED CNECS ONLY (which is why we do it every loop)
135+
// Run post topo sensitivity analysis on all timestamps ON CONSIDERED CNECS ONLY (which is why we do it every loop)
136136
OpenRaoLoggerProvider.TECHNICAL_LOGS.info("[MARMOT] Systematic inter-temporal sensitivity analysis [start]");
137137
TemporalData<PrePerimeterResult> postTopoResults = runAllInitialPrePerimeterSensitivityAnalysis(interTemporalRaoInput.getRaoInputs(), curativeRemedialActions, initialResults, consideredCnecs, raoParameters);
138138
OpenRaoLoggerProvider.TECHNICAL_LOGS.info("[MARMOT] Systematic inter-temporal sensitivity analysis [end]");

0 commit comments

Comments
 (0)