Skip to content

Commit

Permalink
Repair not cucumber tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pauline Jean-Marie <[email protected]>
  • Loading branch information
Pauline Jean-Marie committed Sep 17, 2024
1 parent 6518aa2 commit f23e570
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,10 @@ void testThreeCurativeInstantsWithSecondCurativeHavingNoCnecAndNoRa() {
.newThreshold().withSide(TwoSides.ONE).withMax(2500.).withUnit(Unit.AMPERE).add()
.withOptimized().add();
crac.newFlowCnec().withId("c1-cur1").withInstant("curative1").withContingency("co1").withNetworkElement("FFR1AA1 FFR4AA1 1").withNominalVoltage(400.)
.newThreshold().withSide(TwoSides.ONE).withMax(2400.).withUnit(Unit.AMPERE).add()
.newThreshold().withSide(TwoSides.ONE).withMax(2100.).withUnit(Unit.AMPERE).add()
.withOptimized().add();
crac.newFlowCnec().withId("c1-cur3").withInstant("curative3").withContingency("co1").withNetworkElement("FFR1AA1 FFR4AA1 1").withNominalVoltage(400.)
.newThreshold().withSide(TwoSides.ONE).withMax(1700.).withUnit(Unit.AMPERE).add()
.newThreshold().withSide(TwoSides.ONE).withMax(1500.).withUnit(Unit.AMPERE).add()
.withOptimized().add();

NetworkAction pstPrev = crac.newNetworkAction().withId("pst_fr@10-prev")
Expand Down Expand Up @@ -740,31 +740,31 @@ void testThreeCurativeInstantsWithSecondCurativeHavingNoCnecAndNoRa() {
assertEquals(20.3, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);

cnec = crac.getFlowCnec("c1-out");
assertEquals(2371.88, raoResult.getFlow(null, cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(2129.22, raoResult.getFlow(crac.getInstant(InstantKind.PREVENTIVE), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(2371.88, raoResult.getFlow(null, cnec, TwoSides.ONE, Unit.AMPERE), 1.); // when dealing with post-contingency CNECs, a null instant refers to the outage instant
assertEquals(2129.22, raoResult.getFlow(crac.getInstant(InstantKind.PREVENTIVE), cnec, TwoSides.ONE, Unit.AMPERE), 1.); // why different from above?
assertEquals(128.12, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(370.78, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);

cnec = crac.getFlowCnec("c1-cur1");
assertEquals(2371.88, raoResult.getFlow(null, cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(2129.22, raoResult.getFlow(crac.getInstant(InstantKind.PREVENTIVE), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(1549.18, raoResult.getFlow(crac.getInstant("curative1"), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(28.12, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(270.78, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(850.82, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);
assertEquals(-271.88, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(-29.22, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(550.82, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);

cnec = crac.getFlowCnec("c1-cur3");
assertEquals(2371.88, raoResult.getFlow(null, cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(2129.22, raoResult.getFlow(crac.getInstant(InstantKind.PREVENTIVE), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(1549.18, raoResult.getFlow(crac.getInstant("curative1"), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(432.73, raoResult.getFlow(crac.getInstant("curative3"), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(-671.88, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(-429.22, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(150.82, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);
assertEquals(1267.27, raoResult.getMargin(crac.getInstant("curative3"), cnec, Unit.AMPERE), 1.);
assertEquals(-871.88, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(-629.22, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(-49.18, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);
assertEquals(1067.27, raoResult.getMargin(crac.getInstant("curative3"), cnec, Unit.AMPERE), 1.);

assertEquals(671.88, raoResult.getFunctionalCost(null), 1.);
assertEquals(429.22, raoResult.getFunctionalCost(crac.getInstant(InstantKind.PREVENTIVE)), 1.);
assertEquals(871.88, raoResult.getFunctionalCost(null), 1.);
assertEquals(629.22, raoResult.getFunctionalCost(crac.getInstant(InstantKind.PREVENTIVE)), 1.);
assertEquals(-20.30, raoResult.getFunctionalCost(crac.getInstant("curative1")), 1.);
assertEquals(-20.30, raoResult.getFunctionalCost(crac.getInstant("curative3")), 1.);
}
Expand All @@ -790,13 +790,13 @@ void testThreeCurativeInstants() {
.newThreshold().withSide(TwoSides.ONE).withMax(2500.).withUnit(Unit.AMPERE).add()
.withOptimized().add();
crac.newFlowCnec().withId("c1-cur1").withInstant("curative1").withContingency("co1").withNetworkElement("FFR1AA1 FFR4AA1 1").withNominalVoltage(400.)
.newThreshold().withSide(TwoSides.ONE).withMax(2400.).withUnit(Unit.AMPERE).add()
.newThreshold().withSide(TwoSides.ONE).withMax(2100.).withUnit(Unit.AMPERE).add()
.withOptimized().add();
crac.newFlowCnec().withId("c1-cur2").withInstant("curative2").withContingency("co1").withNetworkElement("FFR1AA1 FFR4AA1 1").withNominalVoltage(400.)
.newThreshold().withSide(TwoSides.ONE).withMax(2300.).withUnit(Unit.AMPERE).add()
.newThreshold().withSide(TwoSides.ONE).withMax(1500.).withUnit(Unit.AMPERE).add()
.withOptimized().add();
crac.newFlowCnec().withId("c1-cur3").withInstant("curative3").withContingency("co1").withNetworkElement("FFR1AA1 FFR4AA1 1").withNominalVoltage(400.)
.newThreshold().withSide(TwoSides.ONE).withMax(1700.).withUnit(Unit.AMPERE).add()
.newThreshold().withSide(TwoSides.ONE).withMax(1000.).withUnit(Unit.AMPERE).add()
.withOptimized().add();

NetworkAction pstPrev = crac.newNetworkAction().withId("pst_fr@10-prev")
Expand Down Expand Up @@ -844,34 +844,34 @@ void testThreeCurativeInstants() {
assertEquals(2371.88, raoResult.getFlow(null, cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(2129.22, raoResult.getFlow(crac.getInstant(InstantKind.PREVENTIVE), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(1549.18, raoResult.getFlow(crac.getInstant("curative1"), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(28.12, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(270.78, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(850.82, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);
assertEquals(-271.88, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(-29.22, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(550.82, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);

cnec = crac.getFlowCnec("c1-cur2");
assertEquals(2371.88, raoResult.getFlow(null, cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(2129.22, raoResult.getFlow(crac.getInstant(InstantKind.PREVENTIVE), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(1549.18, raoResult.getFlow(crac.getInstant("curative1"), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(990.32, raoResult.getFlow(crac.getInstant("curative2"), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(-71.88, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(170.78, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(750.82, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);
assertEquals(1309.68, raoResult.getMargin(crac.getInstant("curative2"), cnec, Unit.AMPERE), 1.);
assertEquals(-871.88, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(-629.22, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(-49.18, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);
assertEquals(509.68, raoResult.getMargin(crac.getInstant("curative2"), cnec, Unit.AMPERE), 1.);

cnec = crac.getFlowCnec("c1-cur3");
assertEquals(2371.88, raoResult.getFlow(null, cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(2129.22, raoResult.getFlow(crac.getInstant(InstantKind.PREVENTIVE), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(1549.18, raoResult.getFlow(crac.getInstant("curative1"), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(990.32, raoResult.getFlow(crac.getInstant("curative2"), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(432.73, raoResult.getFlow(crac.getInstant("curative3"), cnec, TwoSides.ONE, Unit.AMPERE), 1.);
assertEquals(-671.88, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(-429.22, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(150.82, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);
assertEquals(709.68, raoResult.getMargin(crac.getInstant("curative2"), cnec, Unit.AMPERE), 1.);
assertEquals(1267.27, raoResult.getMargin(crac.getInstant("curative3"), cnec, Unit.AMPERE), 1.);

assertEquals(671.88, raoResult.getFunctionalCost(null), 1.);
assertEquals(429.22, raoResult.getFunctionalCost(crac.getInstant(InstantKind.PREVENTIVE)), 1.);
assertEquals(-1371.88, raoResult.getMargin(null, cnec, Unit.AMPERE), 1.);
assertEquals(-1129.22, raoResult.getMargin(crac.getInstant(InstantKind.PREVENTIVE), cnec, Unit.AMPERE), 1.);
assertEquals(-549.18, raoResult.getMargin(crac.getInstant("curative1"), cnec, Unit.AMPERE), 1.);
assertEquals(9.68, raoResult.getMargin(crac.getInstant("curative2"), cnec, Unit.AMPERE), 1.);
assertEquals(567.27, raoResult.getMargin(crac.getInstant("curative3"), cnec, Unit.AMPERE), 1.);

assertEquals(1371.88, raoResult.getFunctionalCost(null), 1.);
assertEquals(1129.22, raoResult.getFunctionalCost(crac.getInstant(InstantKind.PREVENTIVE)), 1.);
assertEquals(-20.30, raoResult.getFunctionalCost(crac.getInstant("curative1")), 1.);
assertEquals(-20.30, raoResult.getFunctionalCost(crac.getInstant("curative2")), 1.);
assertEquals(-20.30, raoResult.getFunctionalCost(crac.getInstant("curative3")), 1.);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
"nominalV" : [ 400.0 ],
"thresholds" : [ {
"unit" : "ampere",
"min" : -1000.0,
"max" : 1000.0,
"min" : -1700.0,
"max" : 1700.0,
"side" : "left"
} ]
}, {
Expand All @@ -133,8 +133,8 @@
"nominalV" : [ 400.0 ],
"thresholds" : [ {
"unit" : "ampere",
"min" : -600.0,
"max" : 600.0,
"min" : -1000.0,
"max" : 1000.0,
"side" : "left"
} ]
} ],
Expand Down

0 comments on commit f23e570

Please sign in to comment.