I'm working on a multi-agent simulator in which agents learn an environment while moving through it. Being somewhat new to Java, I'm looking for suggestions on what data structure to use for storing an agents associative memory. To give you an idea, I'm currently using an array for the agent's exploratory memory (a buffer), then when the agent finds food the path used to find food is then copied to the agent's associative memory and the exploratory memory is whiped clean. The problem I'm encountering is I don't want just a bunch of paths to be stored in the agent's associative memory - exsecially paths that have exact subpaths. For example, if an agent moves North, North, East, then South, and finds food, that path will be stored in associative memory - in case the agent finds itself on that same path it can use it's associative memory to find food. The problem is what if the agent does find itself on that same path, but moved South then West prior to finding the above path. My current logic updates associative memory with the full path taken to reach food. Therefore I would have two paths in my associative memory but one path would be a subpath of another. I guess I'm looking for a data structure that can store full paths as well as parts of paths that connect to full paths. Any suggestions?
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center