VerticalPercolatorclass that models the behavior of a solid material. Objects of this class percolate straight down, but they do not percolate left or right. The goal of today's Mini-Lab is to develop a
GravitationalPercolatorclass. Objects of this class will percolate down, left and right. This could be used as a model of a fluid flowing down through down through a medium.
As a first step, you will make a small change to
VerticalPercolator class that will make it easier to
adapt that code to this new problem. Currently,
getPercolationLocation method returns a single object
Location. That design makes sense for
VerticalPercolator because an object of that class
can percolate to at most one location. However that approach won't
work for our
Exercise 1 — Modifying VerticalPercolator:
Using the modified
VerticalPercolatorclass as a starting point, it will be straightforward to implement the
Exercise 2 — Creating GravitationalPercolator:
At this point your
GravitationalPercolatorclasses are nearly identical. One of the goals of the next Mini-Lab will be to factor out the common code and move it into a common superclass.
The work you have done for this mini-lab will be part of the Percolation programming project, so you don't need to submit anything at this point.