Skip to end of metadata
Go to start of metadata

====Project 5 ====

The goal of this project was to take my Cell landscape from project 4 and improve it greatly. The main task of this project was to create a landscape in which, predator, prey, producers, and obstacles all interacted with one another. For my project I chose to make a squirrel as my predator, a rock as my obstacle, a Tree as my producer, and an acorn as my prey. Also, another way in which this project differed from last week is that my LinkedList class has been improved so that it is now a DoubleLinkedList.

====Solutions====

1.) Step one simply asked me to plan out my simulation and the rules required for each object to behave and interact in a certain way.

2.) Step two asked me to update the updateState methods for all my subclasses of cell. The new updateState had to take in the Landscape as its parameters and not a list of neighbors like the last project. For each updateState method, I had to create and assign the rules for the squirrel, tree, rocks, and acorn sub classes.

3.) Squirrels wander the map and look for acorns to eat. If there health was above a certain point, they would create a new squirrel. Acorns also have a chance to move around the map and are spawned by the trees.Trees also have a 1% chance to generate a new tree. Rocks simply spawn and do nothing besides not allowing anything to pass through them.

4.) I then had to create a different look to differentiate each of my cells. In the image below note the blue circles around the rocks. This is intentional to show that the other cells are obeying its boundaries.

5.) Next I had to update my landscape class. In it a created a function called fix with help from CP and Tony which essentially checked to see if anything spawned within the boundary of a rock. If it did, the object would automatically be removed from the landscape.

6-7) For this step I had to edit my landscape classes so that I could create a simulation. I set the initial conditions for my cells (IE: generate 30 squirrels) and then used the code I developed from last week to save an image of each of my iterations to be eventually turned into a gif image.

8.) Step 8 asked me to create a gif. I do not have access to the terminal tools on my PC to create a gif, so I uploaded all my png images to makeagif.com and created my gif. See below for image

9.) This project had many aspects that required fine tuning. In particular, it was very tough to keep my squirrels from dying out very soon. I did a lot of trial and error, and fixed a few things. First, I increased the health of the squirrels so that they would last longer. In addition I also increased the radius search size of the squirrels so that they could more easily locate acorns.

====Results====

 (100 iterations)
====Extensions====
1.) For my extension I did extension 2 (Get creative with the display of the cells). Through online research on stack overflow, I was able to find out that I could draw images by saving them in my source folder. Thus, I found images for all my cells and the background.
====Worked With====
Worked with Anthony Karalekas. Helped by CP.

Labels