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
I have been exploring Julia's GA capabilities, looking at GeneticAlgorithms and Evolutionary packages. I really enjoy the simple interface presented by Evolutionary and it also seems to be more advanced in terms of development. Great work and thank you for your efforts.
However, I am having trouble figuring out how I can implement a binary GA. I am using a knapsack problem as a simple illustrative example. I've written a fitness function which looks like this:
ERROR: wrong number of arguments
in anonymous at /home/colliera/.julia/v0.3/Evolutionary/src/ga.jl:23
in ga at /home/colliera/.julia/v0.3/Evolutionary/src/ga.jl:66
Looking at the debug output from ga() I see that the vectors being passed into my fitness function are floating point rather than binary (or at least a vector of integer 0 or 1). I'm not sure whether this is the source of the ERROR above, but it's certainly something that I need to resolve in order to get my problem up and running.
Is there support for binary chromosomes? Have I missed something?
Best regards,
Andrew.
The text was updated successfully, but these errors were encountered:
It is just default selection and crossover functions are incorrect. Try some other functions. BTW, binary chromosomes supported as Vector{Bool}. I'll write some examples. Thanks for bringing this issue.
Hi,
I have been exploring Julia's GA capabilities, looking at GeneticAlgorithms and Evolutionary packages. I really enjoy the simple interface presented by Evolutionary and it also seems to be more advanced in terms of development. Great work and thank you for your efforts.
However, I am having trouble figuring out how I can implement a binary GA. I am using a knapsack problem as a simple illustrative example. I've written a fitness function which looks like this:
but when I try to run the GA as follows
I get
Looking at the debug output from
ga()
I see that the vectors being passed into my fitness function are floating point rather than binary (or at least a vector of integer 0 or 1). I'm not sure whether this is the source of the ERROR above, but it's certainly something that I need to resolve in order to get my problem up and running.Is there support for binary chromosomes? Have I missed something?
Best regards,
Andrew.
The text was updated successfully, but these errors were encountered: