Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into bump_core_6.3.1
- Loading branch information
Showing
16 changed files
with
981 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...rc/main/java/com/powsybl/openrao/monitoring/anglemonitoring/AbstractRedispatchAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) 2024, 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/. | ||
*/ | ||
|
||
|
||
package com.powsybl.openrao.monitoring.anglemonitoring; | ||
|
||
import com.powsybl.iidm.modification.scalable.Scalable; | ||
import com.powsybl.iidm.network.Network; | ||
|
||
import static com.powsybl.openrao.commons.logs.OpenRaoLoggerProvider.BUSINESS_WARNS; | ||
|
||
/** | ||
* This abstract implementation uses a Scalable to apply redispatching | ||
* | ||
* @author Peter Mitri {@literal <peter.mitri at rte-france.com>} | ||
*/ | ||
public abstract class AbstractRedispatchAction implements RedispatchAction { | ||
protected void apply(Network network, double powerToRedispatch, Scalable scalable) { | ||
double redispatchedPower = scalable.scale(network, powerToRedispatch); | ||
if (Math.abs(redispatchedPower - powerToRedispatch) > 1) { | ||
BUSINESS_WARNS.warn("Redispatching failed: asked={} MW, applied={} MW", powerToRedispatch, redispatchedPower); | ||
} | ||
} | ||
} |
Oops, something went wrong.