Simulations

Bobbles and Friggles (ecological sim)

I made this project at the end of my Data Structures class in my freshman year of college. Having taken ecology in high school the year prior, I had learned about the way different animal populations grow and decline. I wanted to attempt to simulate such an environment with my newly acquired java coding abilities.

The environment is home to two animal species: Bobbles and Friggles.

Bobbles are a predatory species which feed on Friggles, and Friggles are a herbivorous species which subsists off of a plant called Beeterweed. Each day they would forage/hunt and possibly die/reproduce based on their energy level

The project was successful. The population sizes my simulation determined matched ecological theory. Specifically, the population sizes of predator and prey would never settle but instead rise and fall periodically with predator population sitting a quarter period behind the prey population. What also matched predictions was the consequence of removing predators from the environment (herbivores decimating the vegetation) which I added later.

The graph below is a visualization of these findings I made at the time. (the middle is the removal and reintroduction of Bobbles)

Report from CS201 (freshman year)

Bobbles and Friggles Report.pdf

Orbits

I actually began this project by accident. I was helping a fellow student who wanted to make a game based on the sport Quidditch from the Harry Potter novels. My friend was struggling to implement the "bludger", a ball that follows around the player and attempts to hit them off their broom. I thought the blunger should feel like it had weight and should therefore have inertia that would have to be overcome for it to change directions. A few hours later I had written a bludger that used the formula to calculate gravitational force to attract the ball to the player (F = (G * m1 * m2) / d^2)

At this point my friend had come up with a different approach to his problems and my code simply became my own project.

The resulting project was a virtual environment that the user would add bodies to that are affected by each other's masses and positions.

In the first image, you can see a single body orbiting around a stationary star. In the second image you can see two pairs of orbiting bodies attracted to the opposite pair