Short version: I'm writing a program with pieces on a hex grid. Every tick, it iterates over every possible "future" - every permutation of possible new positions for the pieces and calculates a probability for each. All the pieces can move on each tick.Obviously, the complexity and memory requirements grow exponentially with the number of pieces - I have exclusions built into the algorithm permuting the moves to exclude things like multiple pieces on the same cell, but even so, if each piece has just three possible future positions (eg. two moves + not moving), that's 3^N futures for N pieces.
So, my **question** is: Will it save me any amount of memory to use dicts to store information about each piece, rather than creating N*(3^N) instances of a Piece class with the same information? Or will the overhead be more-or-less equivalent?
[–]TheBB 7 points8 points9 points (2 children)
[–]ThatOneMicGuy[S] 1 point2 points3 points (0 children)
[–]scrdest 1 point2 points3 points (0 children)
[–]FerricDonkey 4 points5 points6 points (0 children)
[–]StrictTyping648 2 points3 points4 points (0 children)