final SortedSet<MarkovAttributeSet> round_asets = new TreeSet<MarkovAttributeSet>();
final Map<MarkovAttributeSet, AbstractClusterer> round_clusterers = new HashMap<MarkovAttributeSet, AbstractClusterer>();
// The best AttributeSet + Clusterer we've seen thus far
MarkovAttributeSet best_aset = null;
AbstractClusterer best_clusterer = null;
boolean found_new_best = true;
int round = 0;
while (round++ < this.num_rounds && found_new_best) {
round_asets.clear();
round_clusterers.clear();
if (debug.val) {
Map<String, Object> m0 = new ListOrderedMap<String, Object>();
m0.put("Round #", String.format("%02d", round));
m0.put("Number of Partitions", this.all_partitions.size());
m0.put("Number of Attributes", all_attributes.size());
m0.put("Best Set", best_aset);
m0.put("Best Cost", (best_aset != null ? best_aset.getCost() : null));
Map<String, Object> m1 = new ListOrderedMap<String, Object>();
for (SplitType stype : SplitType.values()) {
String key = String.format("# of %s Instances", stype.name());
String val = String.format("%-8s [%.02f]", this.split_counts[stype.ordinal()], stype.percentage);
m1.put(key, val);
} // FOR
LOG.debug("\n" + StringUtil.formatMaps(":", true, true, false, false, true, true, m0, m1));
}
final Iterable<Set<Attribute>> it = UniqueCombinationIterator.factory(all_attributes, round);
final List<Set<Attribute>> sets = (List<Set<Attribute>>)CollectionUtil.addAll(new ArrayList<Set<Attribute>>(), it);
final int num_sets = sets.size();
final CountDownLatch latch = new CountDownLatch(num_sets);
final AtomicInteger aset_ctr = new AtomicInteger(0);
for (final Set<Attribute> s : sets) {
Runnable r = new Runnable() {
@Override
public void run() {
MarkovAttributeSet aset = new MarkovAttributeSet(s);
AbstractClusterer clusterer = null;
// if (aset_ctr.get() <= 0) {
if (trace.val) LOG.trace("Constructing AttributeSet: " + aset);
try {
clusterer = FeatureClusterer.this.calculateAttributeSetCost(aset);
} catch (Exception ex) {