wildart / Evolutionary.jl

Evolutionary & genetic algorithms for Julia
Other
321 stars 61 forks source link

Plot Fitness Function for all evaluated points #67

Open koehlerson opened 3 years ago

koehlerson commented 3 years ago

Hey there, I'm using Evolutionary, great package, so thanks for developing it. I was wondering if it's possible by a callback or something like that, to save all individuals and their associated fitness function values? Since I'm only solving a 2 dimensional Problem and this in fact very often, it would be nice to get an Idea of how multi-modal my function is and thus, I would like to plot the fitness function over the 2D parameter space.

wildart commented 3 years ago

Implement custom trace! method (https://wildart.github.io/Evolutionary.jl/dev/tutorial/#Trace-1). The population parameter is an array of the individuals, and the state should contain their fitness (see the particular algorithm implementation). There exist a test for that functionality, you can use it as an example.