Skip to content

Commit 152e696

Browse files
committed
added a few more comments
Signed-off-by: Philippe Edwards <philippe.edwards@rte-france.com>
1 parent ab839de commit 152e696

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ private static RaoResult generateMockRaoResult(RaoInput individualRaoInput, RaoR
252252
return raoResult;
253253
}
254254

255+
256+
// TODO: delete this, it is just used for manual testing purposes if we want to run the MIP part only without running the independent RAOs
255257
private static RaoResult generateMockRaoResult(RaoInput individualRaoInput, RaoParameters raoParameters, TemporalData<Set<String>> consideredCnecs) {
256258
FastRaoResultImpl raoResult = Mockito.mock(FastRaoResultImpl.class);
257259
Crac crac = individualRaoInput.getCrac();
@@ -277,6 +279,7 @@ private static RaoResult generateMockRaoResult(RaoInput individualRaoInput, RaoP
277279
}
278280

279281
private static void applyPreventiveTopologicalActionsOnNetwork(TemporalData<RaoInput> raoInputs, TemporalData<RaoResult> topologicalOptimizationResults) {
282+
// duplicate the initial scenario to keep it clean
280283
raoInputs.getDataPerTimestamp().values().forEach(raoInput -> {
281284
raoInput.getNetwork().getVariantManager().cloneVariant("InitialScenario", "PostTopoScenario");
282285
raoInput.getNetwork().getVariantManager().setWorkingVariant("PostTopoScenario");
@@ -303,6 +306,7 @@ private static TemporalData<PrePerimeterResult> runAllInitialPrePerimeterSensiti
303306
private static TemporalData<PrePerimeterResult> applyActionsAndRunFullLoadflow(TemporalData<RaoInput> raoInputs, TemporalData<AppliedRemedialActions> curativeRemedialActions, LinearOptimizationResult filteredResult ,TemporalData<PrePerimeterResult> initialResults, RaoParameters raoParameters) {
304307
TemporalData<PrePerimeterResult> prePerimeterResults = new TemporalDataImpl<>();
305308
raoInputs.getDataPerTimestamp().forEach((timestamp, raoInput) -> {
309+
// duplicate the postTopoScenario variant and switch to the new clone
306310
raoInput.getNetwork().getVariantManager().cloneVariant("PostTopoScenario", "PostPreventiveScenario", true);
307311
raoInput.getNetwork().getVariantManager().setWorkingVariant("PostPreventiveScenario");
308312
State preventiveState = raoInput.getCrac().getPreventiveState();
@@ -312,6 +316,7 @@ private static TemporalData<PrePerimeterResult> applyActionsAndRunFullLoadflow(T
312316
curativeRemedialActions.getData(timestamp).orElseThrow(),
313317
initialResults.getData(timestamp).orElseThrow(),
314318
raoParameters));
319+
// switch back to the postTopoScenario to avoid keeping applied range actions when entering the MIP
315320
raoInput.getNetwork().getVariantManager().setWorkingVariant("PostTopoScenario");
316321
});
317322
return prePerimeterResults;

0 commit comments

Comments
 (0)