I want to develop a virtual garden with a lot of kind of insects like ants, bees, etc...
For example, if I want to create an area of 10x10m².
I can implement this with
ArrayList<ArrayList<Insect>> area an put all the insects in a specific position. With this approach, my space is limit of the array size, but I think that is more easy implementing A* algorithms for the behavior of insects, and of course I want to create a 10x10m² area I need to define if each position of the ArrayList is in M, CM, DM, MM, etc..., and this could use a lot of memory
Or I can implementing a
int x, y; in each insect, and a class for observe where insects are in each time. With this I think that when I'll when representing the insects in a GUI It'll be easiest. so maybe with this approach use algorithms like A* for search, the shortest path between a insect and another insect is more hardest
The idea too is that you can use this as a library for implementing with a lot of type of GUI libraries.
What do you think?
Do you know another approach to this problem?