Rejection details on surface course diagnostics

Valley solver rejections carry the failing measure (required cut, exposed stations, missing head) through the planner diagnostics; the transect probe prints them.
This commit is contained in:
Brian Neumann-Fopiano committed 2026-09-02 00:05:10 -04:00
1 parent 8848167c22
commit 13bce7aa42
9 files changed
+77 -39

No files matched your search

@@ -219,13 +219,23 @@ public final class RiverTransectProbe {
static List<String> rejectionLines(HydrologyTile tile) {
TreeMap<String, Integer> counts = new TreeMap<>();
TreeMap<String, ArrayList<Integer>> details = new TreeMap<>();
for (HydrologyDiagnosticCandidate candidate : tile.diagnosticCandidates()) {
String key = "rejected " + candidate.kind() + " " + candidate.projectedType() + " " + candidate.rejection();
counts.merge(key, 1, Integer::sum);
if (candidate.detail() != 0) {
details.computeIfAbsent(key, (String ignored) -> new ArrayList<>()).add(candidate.detail());
}
}
ArrayList<String> lines = new ArrayList<>(counts.size());
for (Map.Entry<String, Integer> entry : counts.entrySet()) {
lines.add(entry.getKey() + " x" + entry.getValue());
ArrayList<Integer> values = details.get(entry.getKey());
String suffix = "";
if (values != null) {
values.sort(null);
suffix = " detail=" + values.subList(0, Math.min(values.size(), 24));
}
lines.add(entry.getKey() + " x" + entry.getValue() + suffix);
}
return lines;
}