Skip to content

Commit

Permalink
round capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed May 14, 2024
1 parent 4414149 commit 54ebfc3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import picocli.CommandLine;

import java.io.BufferedReader;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Map;
import java.util.Set;

Expand Down Expand Up @@ -167,7 +169,8 @@ private void applyChanges(Link link, Feature ft) {
modified = true;
}

link.setCapacity(link.getNumberOfLanes() * perLane);
int totalCap = BigDecimal.valueOf(link.getNumberOfLanes() * perLane).setScale(0, RoundingMode.HALF_UP).intValue();
link.setCapacity(totalCap);
}


Expand Down

0 comments on commit 54ebfc3

Please sign in to comment.