static IterableIterator<Audio_TwoWordAnalyzer1> findBest_Audio_TwoWordAnalyzer1(final LPair<S, BWImage> images) { replace A with Audio_TwoWordAnalyzer1. final LS words = uniquify(pairsA(images)); final new Best<A> best; final new AIStrategy_RandomWithVariation<A> strategy; strategy.random = func -> A { random_Audio_TwoWordAnalyzer1(first(words), second(words)) }; // todo: variation strategy.submit = func(final A a) -> double { new Scorer scorer; for (Pair<S, BWImage> img : images) scorer.add(eqic(img.a, a.analyze(img.b))); if (best.put(a, scorer!)) print(scorer + " / " + struct(a)); ret scorer!; }; // rest of function should be same as: ret strategyIterator(best, strategy, optimumValue := 100.0); ret iff(func { if (best.score() == 100) ret endMarker(); A lastBest = best!; strategy.go(); A a = best! == lastBest ? null : best!; lastBest = best!; ret a; }); }