Closed HeleNoir closed 9 months ago
And if you have time (@luleyleo or @Saethox), please take a look at what I did for the firefly algorithm. I'm pretty sure that this could be done much better. And it does not perform quite well, so I might have done something wrong...
I really wasn't prepared for the firefly algorithm, it certainly looks... interesting. Let's hope the other ones are not as bad :/.
In general, I think this is a good time to split the swarm
module further into pso
, fa
, gs
, etc. submodules for the specific algorithms.
Also, evaluating individuals inside the nested loop is weird, but certainly possible with mahf
. It makes parallelizations pretty much impossible, but oh well. This is also pretty much a case where generation and evaluation are inseparable.
You can just get the state::common::Evaluator
at the start and call from_mut
with the individual[i]
as argument to get a &mut [Individual]
that you can feed into the evaluate
method on the Evaluator
. And don't forget to update the state::common::Evaluations
after.
This PR relates to issue #182 and includes operators and heuristics for
The other swarm based algorithms will be implemented later on.