I have been working on a problem which uses ANSYS to perform the evaluation function and thus find the fitness values. I have used DEAP's NSGA-II framework [https://github.com/DEAP/deap/blob/master/examples/ga/nsga2.py] used for the benchmark test as something to built on making suitable changes where ever necessary to fit my needs. The problem arises while executing lines 80-83 in the link provided above, it shows an error message "float object is not iterable". This is in spite of the fact that the individual is registered in the DEAP toolbox as a list which is an iterable in line. I have replaced line 32 ### creator.create("Individual", array.array, typecode='d', fitness=creator.FitnessMin) with ### creator.create("Individual", list, fitness=creator.FitnessMulti) . It is line #82 in the code provided that flashes the error `message.```
There is probably a problem on how you return you fitness in the evaluation function. Remember even if returning a single value it should be a tuple of 1.
I have been working on a problem which uses ANSYS to perform the evaluation function and thus find the fitness values. I have used DEAP's NSGA-II framework [https://github.com/DEAP/deap/blob/master/examples/ga/nsga2.py] used for the benchmark test as something to built on making suitable changes where ever necessary to fit my needs. The problem arises while executing lines 80-83 in the link provided above, it shows an error message "float object is not iterable". This is in spite of the fact that the individual is registered in the DEAP toolbox as a list which is an iterable in line. I have replaced line 32 ### creator.create("Individual", array.array, typecode='d', fitness=creator.FitnessMin) with ### creator.create("Individual", list, fitness=creator.FitnessMulti) . It is line #82 in the code provided that flashes the error `message.```