-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added sequence generation option by giving a generator method #65
base: master
Are you sure you want to change the base?
Conversation
src/nature/core.cljc
Outdated
monitors (:monitors options)] | ||
(loop [population (io/build-population population-size allele-set genome-length fitness-function) | ||
monitors (:monitors options) | ||
sequence-generator-function (:generator options)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add this to the docstring for this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new commit addresses this, you can find my detailed response below.
"Build `population-size` individuals by invoking `build-individual` on random, conforming genetic sequences." | ||
[population-size alleles sequence-length fitness-function] | ||
(repeatedly population-size #(build-individual (generate-sequence alleles sequence-length) fitness-function))) | ||
"Build `population-size` individuals by invoking `build-individual` on random, conforming genetic sequences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I'd really appreciate a test with a trivial sequence-generator-function if you wouldn't mind
and removed the unused function parameters for sequence generation functon case
I've made updates to core.cljc in my latest commit. I think the initial implementation lacked some clarity in the sense that it made two function parameters ( While the new changes were not necessary in terms of functionality, I think eliminating the unused parameters made the overall code more readable. If you are okay with this version, I'll be adding the necessary tests to finalize the development related to this. There is a middle commit that is unrelated, I'll be removing that part and squashing the commits together after you are okay with all changes. Also, as a final point, I've realized after a couple of hours that the mutation and crossover functions require nature's individual structure to be returned, we can make this clearer in docstrings. WDYT? |
Proposed Changes
Pre-merge Checklist