I'm coding a Q-Learning implementation for a game and the Q-Learning state requires a 7-dimensional array because I have everything about the game on it (player x, player y, monsters, treasures, possible moves, etc...)
Everything adds up to more than 1 billion states and the memory can't handle a static matrix of this size, I'm pretty sure the algorithm won't need a lot of these states, so how can I do that using a dynamic structure?
My first thought was to use something like:
ArrayList<ArrayList<ArrayList<ArrayList<ArrayList<ArrayList<ArrayList<Double>>>>>>> qList;
But I'm not sure this is a reasonable solution and I'm not sure how to allocate all of these ArrayLists.
What would be the best way to create a dynamic data structure to store a 7 dimensional matrix?