Wator Predator and Prey
Erstelle ein C# Konsolenprogramm um eine Bevölkerung von Fischen und Haien zu simulieren.
Die Regeln für die Simulation sind online beschrieben: https://www.leinweb.com/snackbar/wator/#:~:text=WATOR%20is%20a%20simulation%20of,the%20area%20is%20made%20small.
Die wichtigsten Regeln:
The program is dependent upon five parameters, plus the size of the rectangular grid. The first parameter is the number of fish, the prey. A fish swims at random to one of the four horizontally or vertically adjacent spaces on the grid, if it is unoccupied. The grid wraps around so a fish can swim off one edge and appear at the opposite edge. The second parameter is the fish breed time. If a fish survives this number of cycles and an open space is available, a new fish is bred. The third parameter is the number of sharks, the predators. A shark eats a fish in an adjacent space on the grid. A shark swims to an open space if there is no adjacent fish. The fourth parameter is the shark starve time. If a shark finds no fish for this number of cycles, it dies. The final parameter is the shark breed time. A shark breeds in the same way as a fish.
Das folgende UML-Klassendiagram stellt den Zusammenhang der benötigten Klassen dar.