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

Cannot modify the attributes of the ga_instance when running multiple processes in parallel #270

Open
rucky96 opened this issue Jan 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@rucky96
Copy link

rucky96 commented Jan 29, 2024

Hi,

I was trying to delete some of the solutions of the population on the fly (inside the fitness_func) which were introducing my prediction to diverge. This is possible only when the flag parallel_processing is not set, while when working with multiple processes any changes in the attributes of the class will not be reflected in the subsequent generations.

I would like to know if it is possible to extend this feature to parallel processing as well

@ahmedfgad ahmedfgad added the enhancement New feature or request label Jan 29, 2024
@ahmedfgad
Copy link
Owner

Hi @rucky96,

Thanks for your suggestion.

Each process has its own memory that is not shared by the other processes. So, any changes to the population inside a child process will be discarded once this process finishes its execution. This is not the case compared to using threads instead of processes.

To support this feature, it needs changes to how the processes are executed which is not a good fit to the library. But you can make a copy of the cal_pop_fitness() and edit it to support making edits to the GA attributes inside the processes.

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

2 participants