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
Minimum score goes up rather than down sometimes #29
Comments
Hey, The minimum fitness you're seeing is not the best obtained fitness. It's the minimum fitness inside the population. The However, it is a bit weird that the populations fitness is going up. If you can share the code I can look into why this is happening. To be totally honest I haven't battle-tested |
Thanks for the quick response! Yes, I understand that I don't see this effect with Regarding code, it's hard to share less than the whole thing in this case. I made a branch that reproduces this problem. The main repo is http://github.com/gwd/session-scheduler , and the branch name is
That will generate a bunch of random users, a bunch of random discussion sessions, and set the "interest" of users in attending various sessions between 0 and 100. At that point, we just need to generate a schedule that maximizes happiness, as calculated by the sum of 'interest' when a user is able to attend the sessions they want to. To run the genetic algorithm scheduler, just run:
This will run the search for 30s, and compare the results to to a "heuristic" scheduler (greedy first-fit), and choose the best one. If you want more data about what's going on, add the I realize this is a lot, so if you don't have time to dig into this, don't worry; my 'random' scheduler will do well enough for the time being. I mainly just wanted to let you know there might be a bug (and/or see if I'm doing something obviously wrong, like using arbitrarily large negative scores). |
Okay cheers for linking the code. I'm a bit busy at the moment but I should be able to free some time over the weekend. Hang tight! |
Hey, I went through the code and noticed that the mutants would replace the initial individual if the fitness was higher, which is not the intended behaviour. I've corrected this and pushed the fix to GitHub. Can you try it again and tell me if it works? |
That seemed to do the trick. Thanks! |
Awesome! Closing this. Tell me if you have any other questions! |
I'm trying to use your library, but I'm getting some really strange results sometimes. For certain models, the population seems to be getting worse (fitness function going up) as time goes on rather than better.
Here's one configuration I used:
And here is some sample output from the log:
[snip]
As you can see, the minimum fitness (with random starting points) started around -42k, and ended around -14k 30 seconds later. Regardless of how I implement the
Genome
interface, I don't see how this should be possible.The text was updated successfully, but these errors were encountered: