I'm using the geneticalgorithm2 module for minimization. I use mixed variables and my code is similar to the example given by them:
import numpy as np
from geneticalgorithm2 import geneticalgorithm2 as ga
def f(X):
return np.sum(X)
varbound = [[0.5,1.5],[0,100],[0,1]]
vartype = ('real', 'int', 'int')
model = ga(function=f, dimension=3, variable_type=vartype, variable_boundaries=varbound)
model.run()
varbound shows the bounds of the variables and the tool will minimize between those values as expected. My question is: is it possible to choose the stepsize?
For example: the code will look between 0 and 100 for integers, but what can I do to make it look for tens only? So 0, 10, 20, 30, 40, 50, 60, 70, 80, 90 and 100. And what about a stepsize of 0.001 for the first variable (between 0.5 and 1.5).