diff --git a/src/eva2/server/go/strategies/LTGA.java b/src/eva2/server/go/strategies/LTGA.java index 7e9f70e4..966c69d2 100644 --- a/src/eva2/server/go/strategies/LTGA.java +++ b/src/eva2/server/go/strategies/LTGA.java @@ -161,7 +161,7 @@ public class LTGA implements InterfaceOptimizer, java.io.Serializable, Interface // the final tree Stack> linkageTree = new Stack>(); // the stack to cluster here clusters can be removed - Stack> workingStack = new Stack>(); + Stack> workingTree = new Stack>(); // add the problem variables to the stacks for (int i = 0; i < this.probDim; i++) { Set s1 = new HashSet(); @@ -169,16 +169,16 @@ public class LTGA implements InterfaceOptimizer, java.io.Serializable, Interface s1.add(i); s2.add(i); linkageTree.add(s1); - workingStack.add(s2); + workingTree.add(s2); } // double[] probMass = calculateProbabilityMassFunction(); // until there is only one cluster left - while (workingStack.size() > 1) { - Pair, Set> toCluster = findNearestClusters(workingStack); - // remove the second cluster from the working set - workingStack.remove(toCluster.tail); + while (workingTree.size() > 1) { + Pair, Set> toCluster = findNearestClusters(workingTree); // add all elements from the second cluster to the first one toCluster.head.addAll(toCluster.tail); + // remove the second cluster from the working set + workingTree.remove(toCluster.tail); // add the combined cluster to the linkage tree linkageTree.add(toCluster.head); }