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

IdGenerator prevents parallel mutation of genomes #4

Open
SilvanCodes opened this issue Sep 4, 2022 · 0 comments
Open

IdGenerator prevents parallel mutation of genomes #4

SilvanCodes opened this issue Sep 4, 2022 · 0 comments

Comments

@SilvanCodes
Copy link
Owner

SilvanCodes commented Sep 4, 2022

As of now genomes can only be mutated sequentially as the mutate method of the Mutation struct requires exclusive mutable access to an IdGenerator. The IdGenerator is a shared resource, i.e. it has to be the same for all mutation operations on all genomes as it is responsible for tracking and managing node identities in order to determine genome similarity or 'distance' between genomes. This is used to approximate genome compatibility for crossover which assumes matching structure via node identities.

If genomes are used without crossover it could be possible to avoid having a shared IdGenerator.

If crossover is desired, the IdIter could be rewritten to utilise an Arc + RwLock on the IdGenerator and only acquire the write-lock when a new Id needs to be generated and written to the cache.

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

No branches or pull requests

1 participant