This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

Judapacabra
Judapacabra presents ...

2020/7/7

Simulation Predator-Prey

I wrote a text for class about how to visualize certain data. The text has a math part and an informatics part. Here you can view my (kind off) finished Simulation for the informatics part.
To start the simulation simply add predator and prey to the World, by calling the Worlds randomTiere(int int)-Method. Enter the amount of predators ("anzahlRäuber") and amount of prey ("anzahlBeute"), weird titles I know, but Im from Germany :)
I recommend an even splitted amount like 20-20 for starters, but feel free to experiment.
After adding predators and prey, click Run and enjoy.

For context:
-Both predator and prey move mostly random.
-Predators will chase prey as long as they are in a certain radius.
-if two instances of prey overlap nothing happens
-if predator and prey overlap, the prey will be eaten and the predator reproduces
-if two predators overlap they will fight and both will die
-prey will reproduce randomly over time


Feedback would be amazing, but not really needed, since I probably gave the project to both my teachers, when it reaches me anyway. Still thanks to anybody for their efforts :)

Your browser does not support the canvas tag.
A new version of this scenario was uploaded on 2020-07-07 17:41:24 UTC I wrote a text for class about how to visualize certain data. The text has a math part and an informatics part. Here you can view my (kind off) finished Simulation for the informatics part. To start the simulation simply add predator and prey to the World, by calling the Worlds randomTiere(int int)-Method. Enter the amount of predators ("anzahlRäuber") and amount of prey ("anzahlBeute"), weird titles I know, but Im from Germany :) I recommend an even splitted amount like 20-20 for starters, but feel free to experiment. After adding predators and prey, click Run and enjoy. For context: -Both predator and prey move mostly random. -Predators will chase prey as long as they are in a certain radius. -if two instances of prey overlap nothing happens -if predator and prey overlap, the prey will be eaten and the predator reproduces -if two predators overlap they will fight and both will die -prey will reproduce randomly over time Feedback would be amazing, but not really needed, since I probably gave the project to both my teachers, when it reaches me anyway. Still thanks to anybody for their efforts :)
A new version of this scenario was uploaded on 2020-07-07 17:43:10 UTC you will have to open the Project on your desktop for it to run properly
JudapacabraJudapacabra

2020/7/7

Unfortunatly, you will have to open the Project on you Desktop. Since this is my first upload, I had no idea what to look out for sooooo, sorry i guess :^)
Super_HippoSuper_Hippo

2020/7/7

You could add a button to add animals. Or let the world spawn a random number at the beginning.

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.