5
Answers

array please I need help

Ask a question
mfon uwa

mfon uwa

14y
2.5k
1
You are required to develop a prototype implementation of an Ecological Simulator using an object Oriented language of your choice. The implementation should use the object oriented features of your language appropriately. Initially the simulator must support two type of creature – predators and prey. The creatures live on a 2-dimensional grid of cells. An initial population of predator and prey are randomly distributed on the grid. The population evolves in discrete time steps. At each time-step creatures will move from one cell to another. If a predator creature finds a prey creature at its new cell it will "eat" it and its fitness will improve. If a cell contains two creatures of the same type they will "breed" by merging to produce a new creature of the original type but with fitness the average of the parent creatures. If a prey creature finds itself on a new unoccupied cell its fitness will increase (for having avoided being eaten). As it stands this will not produce a very realistic simulation of predators and prey! You implementation should allow for the extension of having some cells containing food to be eaten by the prey creatures, creatures being able to sense the contents of cells beyond their own and using this information as the basis for making a decision as to where to move at the next turn. You are not required at this time to produce a nice GUI base programme. The programme when run (for some number of generations) should print out a simple summary of the numbers of each type of creature in each generation.

Answers (5)