Unfortunately, it is hard to debug this if I cannot execute your code with your input data. I suppose you set the seed at the start of the algorithm correct? Can you make some very verbose printing (e.g., every new population generated is printed), run both versions of the code, and then diff the outputs (i.e., look at the first point where they diverge)? This should give you some insight about what is different between the two.
3 Likes