Skip to content

for limit reduction, duration criteria should depend on next limit's duration #1191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2019, RTE (http://www.rte-france.com)
/*
* Copyright (c) 2019-2025, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
Expand Down Expand Up @@ -297,7 +297,10 @@ public double[] getLimitReductions(TwoSides side, LimitReductionManager limitRed
int i = 1; // temporary limit's reductions will be stored starting from index 1
for (LoadingLimits.TemporaryLimit temporaryLimit : limits.getTemporaryLimits()) {
if (terminalLimitReduction.acceptableDuration().contains(temporaryLimit.getAcceptableDuration())) {
limitReductions[i] = terminalLimitReduction.reduction();
limitReductions[i] = Math.min(limitReductions[i], terminalLimitReduction.reduction());
// The reduction applies also to the next limit

limitReductions[i - 1] = Math.min(limitReductions[i - 1], terminalLimitReduction.reduction());
}
i++;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2019, RTE (http://www.rte-france.com)
/*
* Copyright (c) 2019-2025, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
Expand Down Expand Up @@ -440,8 +440,8 @@ void testSeveralLimitReductionsForTheSameLimit() {
assertEquals(4, reductions.length);
assertEquals(0.5, reductions[0], 0.001); // PATL
assertEquals(0.8, reductions[1], 0.001); // TATL 600s
assertEquals(0.9, reductions[2], 0.001); // TATL 60s
// `terminalLimitReduction4` is declared after `terminalLimitReduction2`, so its value is used
assertEquals(0.87, reductions[2], 0.001); // TATL 60s // But the next tempo's reduction is stronger (than 0.9) so it is applied
// `terminalLimitReduction4` is stronger than`terminalLimitReduction2`, so its value is used
assertEquals(0.87, reductions[3], 0.001); // TATL 0s

limitReductionManager = new LimitReductionManager();
Expand All @@ -453,9 +453,9 @@ void testSeveralLimitReductionsForTheSameLimit() {
assertEquals(4, reductions.length);
assertEquals(0.5, reductions[0], 0.001); // PATL
assertEquals(0.8, reductions[1], 0.001); // TATL 600s
assertEquals(0.9, reductions[2], 0.001); // TATL 60s
// `terminalLimitReduction4` is now declared before `terminalLimitReduction2`, its value is overlapped by the one of `terminalLimitReduction2`
assertEquals(0.9, reductions[3], 0.001); // TATL 0s
assertEquals(0.87, reductions[2], 0.001); // TATL 60s
// `The limit reduction declaration order has no influcence. The strongest reduction is applied.
assertEquals(0.87, reductions[3], 0.001); // TATL 0s
}

@Test
Expand Down