static Cl> runProbabilisticBinaryMaximumSearch_withFoundInStep(IF1 f, DoubleRange searchRange, double featureSize, int maxResults, int maxSteps) { var collector = new PSCollectMostProbable>(maxResults).run(); var ps = collector.ps; ProbabilisticBinaryMaximumSearch search = new(f, x -> { //print("At " + ps.currentProbability() + ": Found " + x); collector.add(withProbability(x.probability, new FoundInStep(ps.stepCount(), x!))); }, searchRange); search.featureSize = featureSize; search.run(ps); stepMax(collector, maxSteps); ret collector!; }