Skip to content

Commit

Permalink
add losses id prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Caio Luke <caioluke97@gmail.com>
  • Loading branch information
caioluke committed May 30, 2024
1 parent 6ada95b commit 91f7065
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
class LossesCompensator {
private final double epsilon;
private Integer networkHash;
public static final String LOSSES_ID_PREFIX = "LOSSES ";

LossesCompensator(double epsilon) {
this.epsilon = epsilon;
Expand All @@ -34,7 +35,7 @@ class LossesCompensator {
}

static String getLossesId(String id) {
return String.format("LOSSES %s", id);
return LOSSES_ID_PREFIX + id;
}

public void run(Network network) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,7 @@ void testObserverWithEnableLossesCompensation() {
flowComputer.run(xnecProvider, network);

// there are no losses in acNodalInjection
String lossesId = LossesCompensator.getLossesId("");
report.acNodalInjections.forBaseCase().forEach((inj, p) -> assertFalse(inj.startsWith(lossesId)));
report.acNodalInjections.forBaseCase().forEach((inj, p) -> assertFalse(inj.startsWith(LossesCompensator.LOSSES_ID_PREFIX)));
}

private void assertEventsFired(Collection<Event> firedEvents, Event... expectedEvents) {
Expand Down

0 comments on commit 91f7065

Please sign in to comment.