-
Notifications
You must be signed in to change notification settings - Fork 79
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
Supporting reusable chromosomes #33
Open
wjladams
wants to merge
13
commits into
dwdyer:master
Choose a base branch
from
dlens:master
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previous version 1.2.2 will no longer compile (it requires jfreechart 1.0.8 which no longer exists in the maven repo).
Now when the GenerationalEvolutionEngine is done with a chromosome, and the chromosome implements the Releasable interface, it calls chromosome.release(). This effectively allows that chromosome to be reused if that behavior is desired.
See HelloWorldGeneratorV2 or HelloWorldGneratorV2Test for this working.
Problem was waiting for UI to sync, a few extra robot.waitForIdle() did the trick.
Also updating programmers for this branch to just me. Not sure if that is the correct protocol, but at the same time I don't want to volunteer others to be contributors to my branch.
This works for now.
A termination validator that takes into account: 1. A minimum generation count, before even considering termination 2. A maximum generation count, once reached we consider it terminated 3. The history of the fitness function for each generation If we are between min/max number of generations, we look at the history of fitness function values for timesMustBeClose before the current generation. If each successive value is within closeEnough of the previous generation for timesMustBeClose, we consider it converged.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In my particular usage of the watchmaker library my chromosomes are very large. Recreating them over and over was hurting performance badly. So I added a "Releasable" interface and made my chromosomes implement that. When GenerationalEvolutionEngine is done with a chromosome I added a couple of lines of code to check if the chromosome implements the Releasable interface, and if so it calls chromosome.release() prior to releasing it from the population.
This allows me to recirculate that object and avoid destroy/recreating objects. This change sped up my algorithm by a factor of 10+.
The majority of the code in this pull request is to add a unit test to make sure releasing is actually working, in addition to adding a simple ReleasablePool implementation.