Skip to content

Multiprocessing feature added on pygad.py.#116

Closed
azarketa wants to merge 1 commit intoahmedfgad:masterfrom
azarketa:master
Closed

Multiprocessing feature added on pygad.py.#116
azarketa wants to merge 1 commit intoahmedfgad:masterfrom
azarketa:master

Conversation

@azarketa
Copy link

@azarketa azarketa commented Jun 5, 2022

The multiprocessing feature is added on the pygad.py file.

The run() and cal_pop_fitness() functions are modified so that they accept three additional arguments, namely:

  • multiproc: a boolean determining whether a multiprocessing approach is to be applied. Defaults to false.
  • num_proc: an integer representing the number of processor by which to run the genetic algorithms. Defaults to 1.
  • pool: an instance of the multiprocessing.Pool object in case the multiprocessing approach is to be applied. Defaults to None.

An additional function, cal_pop_single_fitness(), is defined and called asynchronously from within the cal_pop_fitness() function in case the multiprocessing approach is to be applied.

@ahmedfgad
Copy link
Owner

Your request has so many changes which is not mandatory to support parallel processing. If possible, please keep the changes focused to the purpose of parallel processing and keep everything else.

@ahmedfgad ahmedfgad closed this Jul 4, 2022
@ahmedfgad ahmedfgad added the enhancement New feature or request label Feb 25, 2023
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

Successfully merging this pull request may close these issues.

2 participants