*/
public synchronized void submitTaskResults(Object task, Object results,
ProgressMonitor monitor) throws Exception {
int taskMutations = (Integer) task;
Raster taskRaster = (Raster) results;
monitor.notifyStatusChanged("Accumulating partial results...");
mutationsSubmitted += taskMutations;
if (displayPartialResults) {
double alpha = (double) taskMutations / (double) mutationsSubmitted;
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
raster.setPixel(x, y, raster.getPixel(x, y).times(
1.0 - alpha).plus(
taskRaster.getPixel(x, y).times(alpha)));
}
}
display.setPixels(0, 0, raster);
} else {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
raster.setPixel(x, y, raster.getPixel(x, y).plus(taskRaster.getPixel(x, y)));
}
}
}
monitor.notifyProgress(++tasksSubmitted, tasks);