This is my first post here in programmers.stackexchange (I'm a regular on SO). I hope this isn't too general.
I'm trying a simple project to learn Java from something I've seen done in the past. Basically, it's an AI simulation where there are herbivorous and carnivorous creatures and both must try to survive. The part I am trying to come up with is that of the board itself.
Let's assume very simple rules. The board must be of size X by Y and only one element can be in one place at one time. For example, a critter cannot be in the same tile as a food block. There can be obstacles (rocks, trees..), there can be food, there can be critters of any type. Assuming these rules, what would be one good way to represent this situation ?
This is what I came up with and want suggestions if possible:
Use multiple levels of inheritance to represent all the different possible objects (AbstractObject -> (NonMovingObject -> (Food, Obstacle) , MovingObject -> Critter -> (Carnivorous, Herbivorous))) and use polymorphism in a 2D array to store the instances and still have access to lower level methods.
Many thanks.
Edit: Here is the graphic representation of the structure I have in mind.

CarnivorousorHerbivorousto define a new type of critter with a new AI algorithm. I am replicating a small contest that was held on a programming forum I used to go. Basically, everyone could write his own version of the code as either Carnivorous or Herbivorous and simulations were run to test which was the best. – Alexandre P. Levasseur Oct 8 '12 at 23:08