Skip to content
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

Parallel evaluation of Genomes #8

Open
bhearsum opened this issue Aug 5, 2023 · 1 comment
Open

Parallel evaluation of Genomes #8

bhearsum opened this issue Aug 5, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@bhearsum
Copy link
Owner

bhearsum commented Aug 5, 2023

Genomes within the same generation do not depend on each other in any way. It ought to be possible to evaluate all of the Genomes in a given generation in parallel.

@bhearsum bhearsum added the enhancement New feature or request label Aug 5, 2023
@bhearsum
Copy link
Owner Author

I started working on this on a branch. I ended up hitting issues with the borrow checker - as soon as we try to pull more than one Species or Genome at the same time, it gets understandably grumpy.

I went on a long tangent in another branch, thinking that by switching Species and Genome storage to a HashMap that it would solve the issue. While it allows us to pull individual items from Pool.species and Species.genomes, I completely overlooked the fact that we still end up borrowing multiple times from the Pool to do so.

At this point, the only way I can think to get parallel evaluation to work is to allow Species and Genomes to be fully removed from the Pool at the start of each generation, and then put back in at the end, before the new generation is spawned. I think this could work if we had a method on the Pool that returned a Box'ed Species, and then a comparable method that accepts a Box'ed Species to move it back in. (Or maybe this is way off - my knowledge of Box is quite limited.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant