!7 cmodule LearnActiveTab > DynSingleFunctionWithPrintLog { LPair scaledImages; void doIt { LPair data = gatherMarkedThingInImages(listImageFiles( aiImageAlbumDir() ), "Active tab"); pnlStruct(data); int gridSize = 4; scaledImages = new L; for (Pair p : data) { BufferedImage img = loadImage2(p.a); RGBImage rgb = RGBImage(scaleImageWithFactor(1.0/gridSize, img)); add(scaledImages, pair(rgb, scaleRect(p.b, 1.0/gridSize))); } RandomAndVary_Record rav = new(CloseToColorPredicate, color := new RandomAndVary_RGBInt, maxDistance := new RandomAndVary_Double); CloseToColorPredicate e = pairA(racerOptimize(rav, f score, minRuntimeUnless100 := 10.0)); print(e); showImage(renderColorPredicateOnTestImages(e, pairsA(scaledImages)); } double score(CloseToColorPredicate e) { ret scoreColorPredicateByRect(e, scaledImages); } }