Skip to content

Commit

Permalink
Merge branch 'main' into remove_assertion_error
Browse files Browse the repository at this point in the history
  • Loading branch information
colinepiloquet authored Feb 22, 2023
2 parents 7735cc1 + 3bd713f commit c0b199b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,14 @@ private void replaceHvdcLineByLoad(HvdcLine hvdcLine, VoltageLevel vl, Terminal
}

private void replaceHvdcLineByGenerator(HvdcLine hvdcLine, VoltageLevel vl, Terminal terminal) {
double maxP = hvdcLine.getMaxP();
GeneratorAdder genAdder = vl.newGenerator()
.setId(hvdcLine.getId())
.setName(hvdcLine.getOptionalName().orElse(null))
.setEnergySource(EnergySource.OTHER)
.setVoltageRegulatorOn(false)
.setMaxP(checkP(terminal))
.setMinP(0)
.setMaxP(maxP)
.setMinP(-maxP)
.setTargetP(checkP(terminal))
.setTargetQ(checkQ(terminal));
fillNodeOrBus(genAdder, terminal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ void testHvdcReplacement() {
assertEquals(1, observerVsc.getHvdcLineReplacedCount());
assertEquals(1, observerVsc.getHvdcLineRemovedCount());
assertEquals(1, networkVsc.getGeneratorCount());
Generator gen = networkVsc.getGenerator("L");
assertEquals(300, gen.getMaxP());
assertEquals(-300, gen.getMinP());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.powsybl.security.results.PostContingencyResult;
import com.powsybl.security.results.PreContingencyResult;

import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.*;

/**
* @author Mathieu Bague <mathieu.bague at rte-france.com>
Expand Down

0 comments on commit c0b199b

Please sign in to comment.