I'm using the following code to make experiments and start learnig how to use DE to optimize more complex problems. i need and optimizer that can work with integer numbers.
from scipy.optimize import differential_evolution
def objfun(x):
print('N')
return x[0]+2*x[1]**-4*x[2]
solution=differential_evolution(objfun,bounds=((1,10000),(1,200000),(1,50000)),popsize=0,maxiter=3,polish=False,disp=True)
The problem rises when setting popsize. I get more population than expected and if i set it to 0 it keep getting me 10 elements for the first population and then 5 for the other populations till it gets to maxiter.
that's an exampre of the output i get with the above code
runfile('D:/PYTHON/untitled0.py', wdir='D:/PYTHON')
N
N
N
N
N
N
N
N
N
N
differential_evolution step 1: f(x)= 318.074
N
N
N
N
N
differential_evolution step 2: f(x)= 169.667
N
N
N
N
N
differential_evolution step 3: f(x)= 169.667
I really don't understand what i'm doing wrong, at least i expected popsize=0 to give an error. Moreover, are there any other hidden parameters to set initial population size that must be edited?
I'm still a beguinner, i've started with python a few week ago so i'd be really thankfull for a simple explaination.
Thank a lot to everyone who take time to answer me.
Steve