This seems to be the most bizarre thing, however I am at my wit's end here. I have a PyGame/PyMunk simulation (the simple BouncyBall demo that is scheduled to run for 2 seconds). I have it hooked into DEAP to try and optimize line placement to maximize the number of balls on screen at the end.
The first generation seems to run fine (and for the expected amount of time), however any remaining generations simply fly by.
I am printing out the invalid_ind
list and there are contents there, however it almost seems like pygame just doesn't want to re-run following the first generation.
Is there some kind of low-level optimization that's happening here? I wouldn't expect a DEAP run of 10 generations * 50 individuals * 2 sec evaluation to run instantaneously, so I am quite confused.
Here is my DEAP code
And here is my BouncyBall code
They link up nicely for generation 1, but anything beyond that flies by.
I don't know if this will help anybody, but the issue seems to be more related to how I handle evaluation of the PyMunk code. Instantiating it for each individual has the same effect whether I run DEAP or a handmade GA.
However, calling the BouncyBall
code via subprocess
works as expected.