Difference between revisions of "Floodfill Application"

From CSE231 Wiki
Jump to navigation Jump to search
(Created page with "=Background= In this studio, you will be using a parallel and recursive method to create an app that fills in a space with color, much like the paint bucket in MS Paint. =Wh...")
 
Line 2: Line 2:
  
 
In this studio, you will be using a parallel and recursive method to create an app that fills in a space with color, much like the paint bucket in MS Paint.
 
In this studio, you will be using a parallel and recursive method to create an app that fills in a space with color, much like the paint bucket in MS Paint.
 +
 +
=Setup=
 +
In order to run the visualization app you will need to [http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/setup/JavaFX.html setup e(fx)clipse].
  
 
=Where to Start=
 
=Where to Start=

Revision as of 07:58, 18 September 2017

Background

In this studio, you will be using a parallel and recursive method to create an app that fills in a space with color, much like the paint bucket in MS Paint.

Setup

In order to run the visualization app you will need to setup e(fx)clipse.

Where to Start

In order to test this application, please refer to the visualization classes provided for you under floodfill.viz. More specifically, check out the FloodFillVizApp.java class. Otherwise, the only class you will need to modify is StudentFloodFiller.java, which can be found under floodfill.assignment. As usual, we recommend checking out all of the classes under the core directory to get your bearings on the project.

The Kernel

The class is composed of two methods: floodFill and floodFillKernel. As you will be implementing FloodFill recursively and in parallel, you have to carefully consider where to put the asyncs and finishes so that your application maximizes parallelization. To accomplish this, we will call the kernel in the floodFill method. This is so that the kernel can run recursively and asynchronously so the floodFill method can wrap the kernel in an all-inclusive finish.

The kernel should check if the given pixel is in bounds. If it is, it should check if the given pixel matches the targetColor (the color we wish to change). If it is, it should then replace the color with the replacementColor and asynchronously call the method again to repeat the process for the surrounding pixels. The purpose of the assignment is to understand recursion and how to make it work in parallel.