From c9ddf9ae9523a8ad3cbbd56c3677b945f4f86d92 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 28 Apr 2025 11:14:39 +0200 Subject: fix function nonOverlapping() --- .../dk/biks/bachelorizer/Combi.java | 31 +--------------------- 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'src') diff --git a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Combi.java b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Combi.java index e985384..2095867 100644 --- a/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Combi.java +++ b/src/dk.biks.bachelorizer/dk/biks/bachelorizer/Combi.java @@ -149,7 +149,6 @@ public final class Combi { for (Vertex current : vip) { if (done.contains(current)) { -System.out.println("skipped: "+current.toString()); continue; } @@ -158,42 +157,14 @@ System.out.println("skipped: "+current.toString()); if (x == current) return false; Integer weight = g.getWeight(current, x); -System.out.printf("weight from %s to %s: %d%n", current, x, weight); - return weight != null && weight > 0; + return weight == null && !done.contains(x); }).collect(Collectors.toSet()); -/* - // add set of current and any unconnected modules - Set isolated = all_set; - isolated.removeIf(x -> { - if (x == current) - return false; - Integer weight = g.getWeight(current, x); -System.out.printf("weight from %s to %s: %d%n", current, x, weight); - return weight != null && weight > 0; - }); -*/ - // add as set and omit from future iterations sets.add(isolated); done.addAll(isolated); -System.out.println("isolated:"); -for (Vertex v: isolated) { -System.out.println("\t"+v.toString()); -} - -//for (Vertex v: done) { -//System.out.println("done: "+v.toString()); -//} } -for(Set s: sets) { -System.out.println("set: "+s.size()); -for (Vertex v: s) { -System.out.println(" "+v.toString()); -} -} - return sets; } } -- cgit v1.2.3