-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Remove LoadsVariation::VariationMode
Add Proportional Scalable loads Config maven.yml Signed-off-by: lisrte <[email protected]>
Showing
18 changed files
with
231 additions
and
85 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
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
55 changes: 55 additions & 0 deletions
55
...main/java/com/powsybl/dynawo/margincalculation/loadsvariation/CalculatedLoadScalable.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,55 @@ | ||
/** | ||
* 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/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.dynawo.margincalculation.loadsvariation; | ||
|
||
import com.powsybl.iidm.modification.scalable.LoadScalable; | ||
import com.powsybl.iidm.network.Load; | ||
|
||
/** | ||
* The scaled P and Q are not set in the given load but kept in properties, contrary to {@link LoadScalable} | ||
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>} | ||
*/ | ||
public class CalculatedLoadScalable extends LoadScalable implements CalculatedPower { | ||
|
||
private Double calculatedP0 = Double.NaN; | ||
private Double calculatedQ0 = Double.NaN; | ||
|
||
CalculatedLoadScalable(String id) { | ||
super(id); | ||
} | ||
|
||
@Override | ||
protected void setP0(Load l, double value) { | ||
calculatedP0 = value; | ||
} | ||
|
||
@Override | ||
protected double getP0(Load l) { | ||
return calculatedP0.isNaN() ? l.getP0() : calculatedP0; | ||
} | ||
|
||
@Override | ||
protected void setQ0(Load l, double value) { | ||
calculatedQ0 = value; | ||
} | ||
|
||
@Override | ||
protected double getQ0(Load l) { | ||
return calculatedQ0.isNaN() ? l.getQ0() : calculatedQ0; | ||
} | ||
|
||
@Override | ||
public Double getCalculatedP0() { | ||
return calculatedP0; | ||
} | ||
|
||
@Override | ||
public Double getCalculatedQ0() { | ||
return calculatedQ0; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...is/src/main/java/com/powsybl/dynawo/margincalculation/loadsvariation/CalculatedPower.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,18 @@ | ||
/** | ||
* Copyright (c) 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/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.dynawo.margincalculation.loadsvariation; | ||
|
||
/** | ||
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>} | ||
*/ | ||
public interface CalculatedPower { | ||
|
||
Double getCalculatedP0(); | ||
|
||
Double getCalculatedQ0(); | ||
} |
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
30 changes: 30 additions & 0 deletions
30
...n/java/com/powsybl/dynawo/margincalculation/loadsvariation/LoadsProportionalScalable.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,30 @@ | ||
/** | ||
* 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/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.dynawo.margincalculation.loadsvariation; | ||
|
||
import com.powsybl.iidm.modification.scalable.ProportionalScalable; | ||
import com.powsybl.iidm.network.Load; | ||
|
||
import java.util.List; | ||
|
||
import static com.powsybl.iidm.modification.scalable.ProportionalScalable.DistributionMode.PROPORTIONAL_TO_P0; | ||
|
||
/** | ||
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>} | ||
*/ | ||
public class LoadsProportionalScalable extends ProportionalScalable { | ||
|
||
public LoadsProportionalScalable(List<Load> loads) { | ||
super(loads, i -> | ||
new CalculatedLoadScalable(i.getId()), PROPORTIONAL_TO_P0, -Double.MAX_VALUE, Double.MAX_VALUE); | ||
} | ||
|
||
public List<CalculatedPower> getLoadScalable() { | ||
return getScalables().stream().map(CalculatedPower.class::cast).toList(); | ||
} | ||
} |
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
Oops, something went wrong.