public IntegrationResult integrate(Evaluator evaluator, StopCondition condition, List<Visualizer> visualizers) throws IntegrationFailedException {
double lastValue;
SparseResult result = new SparseResult();
FlatIndexGenerator indexGenerator = new FlatIndexGenerator(evaluator.dimension());
Visualizers.submitToList(visualizers, new Integrand(evaluator));
Visualizers.submitToList(visualizers, new StartIntegration());
lastValue = Double.NaN;
int lastLevel = 0;
while (! condition.stop(result)) {
Index index = indexGenerator.next();
int level = index.sum();
if (level > lastLevel) {
result.errorEstimate = Math.abs(result.value - lastValue);
lastValue = result.value;