Jump to content

Functional coverage tree: Difference between revisions

m
Improved output format.
(New post.)
m (Improved output format.)
Line 800:
final double overallCoverage = cleaning.getCoverage();
System.out.println("OVERALL COVERAGE = " + String.format("%.6f", overallCoverage) + System.lineSeparator());
System.out.println("NAME HIERARCHY | WEIGHT | COVERAGE |" );
System.out.println("--------------------------------|--------|----------|");
cleaning.display();
System.out.println();
Line 861 ⟶ 862:
private void display(int aLevel) {
final String initial = " ".repeat(4 * aLevel) + name;
final String padding = " ".repeat(32NAME_FIELD_WIDTH - initial.length());
System.out.print(initial + padding + "|");
System.out.print(" " + String.format("%3d", weight) + " |");
Line 876 ⟶ 877:
private FCNode parent;
private List<FCNode> children = new ArrayList<FCNode>();
private static final int NAME_FIELD_WIDTH = 32;
}
Line 884 ⟶ 887:
 
NAME HIERARCHY | WEIGHT | COVERAGE |
--------------------------------|--------|----------|
Cleaning | 1 | 0.409167 |
House_1 | 40 | 0.331250 |
908

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.