-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use f32
/ f64
as fitness scores?
#18
Comments
The evaluation functions must order the fitness score. The Ord trait is not implemented for floats. That's the reason why the |
I enabled the Here's how it looks like: https://github.com/ravicious/collage/blob/808fb238da24415b72371bded32d49994f2b611a/image-processor/src/algorithm.rs#L22-L64 Unfortunately it's not something one can copy and paste, as I also had to flip the order. By default genevo treats higher fitness as better, but the cost function of the algorithm I was implementing treats lower fitness as better with zero being the best possible fitness. But you should be able to just remove the match on If you're sure that your cost function never returns |
Hello,
I am currently stuck using a janky float discretization technique because I can't use floats directly.
Is there a better workaround? Is there some truly compelling reason we cannot implement the
Fitness
trait for floats internally like is done for the signed and unsigned integers?Thank you.
The text was updated successfully, but these errors were encountered: