Skip to content

Commit

Permalink
NaN threshold values in virtual cost logs (#722)
Browse files Browse the repository at this point in the history
* Only one line fix

* Modified according to review
  • Loading branch information
MartinBelthle authored Jan 19, 2023
1 parent 6117c19 commit 0cce27f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,8 @@ List<String> getVirtualCostlyElementsLogs(Leaf leaf, String virtualCostName, Str
for (FlowCnec flowCnec : leaf.getCostlyElements(virtualCostName, NUMBER_LOGGED_VIRTUAL_COSTLY_ELEMENTS)) {
Side limitingSide = leaf.getMargin(flowCnec, Side.LEFT, unit) < leaf.getMargin(flowCnec, Side.RIGHT, unit) ? Side.LEFT : Side.RIGHT;
double flow = leaf.getFlow(flowCnec, limitingSide, unit);
Double limitingThreshold = flow >= 0 ? flowCnec.getUpperBound(limitingSide, unit).orElse(Double.NaN) : flowCnec.getLowerBound(limitingSide, unit).orElse(Double.NaN);
Double limitingThreshold = flow >= 0 ? flowCnec.getUpperBound(limitingSide, unit).orElse(flowCnec.getLowerBound(limitingSide, unit).orElse(Double.NaN))
: flowCnec.getLowerBound(limitingSide, unit).orElse(flowCnec.getUpperBound(limitingSide, unit).orElse(Double.NaN));
logs.add(String.format(Locale.ENGLISH,
"%s%s, limiting \"%s\" constraint #%02d: flow = %.2f %s, threshold = %.2f %s, margin = %.2f %s, element %s at state %s, CNEC ID = \"%s\", CNEC name = \"%s\"",
prefix,
Expand Down

0 comments on commit 0cce27f

Please sign in to comment.