You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File "C:\Users\hunty\AppData\Local\RLBotGUIX\venv\lib\site-packages\neat\math_util.py", line 9, in mean
return sum(map(float, values)) / len(values)
ZeroDivisionError: division by zero
When the population size of my model is set to 1, I receive a division by 0 error, when set to a number > 1, I don't get the error. I found a stack overflow page relating to this, but there was no solution.
Here is some of my code:
config file (the portion that matters):
This is due to the lines: gdmean = mean(distances.distances.values()) and gdstdev = stdev(distances.distances.values())
in the species.py file.
But it is not big bug ;) The program wants to count the mean distance and mean deviation from a sequence of zero-length numbers. This is logical when there is only one genome, because to whom this genetic distance would be counted ;).
There are two solutions:
comment out this part in species.py. gdmean = mean(distances.distances.values()) gdstdev = stdev(distances.distances.values()) self.reporters.info( 'Mean genetic distance {0:.3f}, standard deviation {1:.3f}'.format(gdmean, gdstdev))
OR
add an appropriate exception to mean and stdev in math_util.py. Somethink like:
'if not values:
return 0'
When the population size of my model is set to 1, I receive a division by 0 error, when set to a number > 1, I don't get the error. I found a stack overflow page relating to this, but there was no solution.
Here is some of my code:
config file (the portion that matters):
eval/fitness function:
If you have a solution or need more code, please say so!
The text was updated successfully, but these errors were encountered: