In this instance an array would be the better choice. I chose to complicate a simple part of my code to make a more complex part simpler. While I was debugging this glitch in my code I refactored and reimplemented the genetic sorting algorithm many times, and the current iteration uses a similar technique to what you linked (albeit they did it better, making me wish I'd seen that post earlier). It got to the point that I was absolutely confident that part of the code wasn't the problem, so I started recording the output from my simpler subroutines to track down where the inconsistencies were being generated. I will say, genetic sorting doesn't work all that great when your value function gives different results for the same input. | [reply] |