Skip to content

Commit

Permalink
removal of references to fields q0 and p0
Browse files Browse the repository at this point in the history
Signed-off-by: anas-drissi <[email protected]>
  • Loading branch information
jonenst committed Nov 2, 2022
1 parent 7496573 commit 4eb617b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public double getMaxP() {
public Battery setMaxP(double maxP) {
var resource = checkResource();
ValidationUtil.checkMaxP(this, maxP);
ValidationUtil.checkActivePowerLimits(this, getMinP(), maxP, getP0());
ValidationUtil.checkActivePowerLimits(this, getMinP(), maxP, getTargetP());
double oldValue = resource.getAttributes().getMaxP();
resource.getAttributes().setMaxP(maxP);
updateResource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ private static Network createNetwokWithMultipleEquipments(TopologyKind topologyK
invalidNode = initAdder(adder, topologyKind, invalidNode);
Battery battery = ((BatteryAdder) adder)
.setId("battery")
.setP0(50)
.setQ0(10)
.setTargetP(50)
.setTargetQ(10)
.setMinP(40)
.setMaxP(70)
.add();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ public static Network create(NetworkFactory networkFactory) {
Battery battery = vl1.newBattery()
.setId("battery")
.setNode(4)
.setP0(50)
.setQ0(10)
.setTargetP(50)
.setTargetQ(10)
.setMinP(40)
.setMaxP(70)
.add();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -923,27 +923,27 @@ public void batteryTest() {
.setId("battery")
.setConnectableBus("b1")
.setBus("b1")
.setP0(50)
.setQ0(10)
.setTargetP(50)
.setTargetQ(10)
.setMinP(40)
.setMaxP(70)
.add();

verify(mockedListener, times(1)).onCreation(battery);

assertTrue(battery.isFictitious());
assertEquals(50, battery.getP0(), 0.1);
assertEquals(10, battery.getQ0(), 0.1);
assertEquals(50, battery.getTargetP(), 0.1);
assertEquals(10, battery.getTargetQ(), 0.1);
assertEquals(40, battery.getMinP(), 0.1);
assertEquals(70, battery.getMaxP(), 0.1);

battery.setFictitious(false);
battery.setP0(65);
battery.setQ0(20);
battery.setTargetP(65);
battery.setTargetQ(20);

assertFalse(battery.isFictitious());
assertEquals(65, battery.getP0(), 0.1);
assertEquals(20, battery.getQ0(), 0.1);
assertEquals(65, battery.getTargetP(), 0.1);
assertEquals(20, battery.getTargetQ(), 0.1);

verify(mockedListener, times(1)).onUpdate(battery, "targetP", INITIAL_VARIANT_ID, 50d, 65d);
verify(mockedListener, times(1)).onUpdate(battery, "targetQ", INITIAL_VARIANT_ID, 10d, 20d);
Expand Down

0 comments on commit 4eb617b

Please sign in to comment.