8000 Test parallel processing · madprog/GeneticAlgorithmPython@0f26588 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f26588

Browse files
committed
Test parallel processing
1 parent c4b1378 commit 0f26588

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pygad/pygad.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,9 +1803,13 @@ def cal_pop_fitness(self):
18031803
solutions_to_submit = []
18041804
for sol_idx, sol in enumerate(self.population):
18051805
# The "undefined" value means that the fitness of this solution must be calculated.
1806-
if pop_fitness[sol_idx] == "undefined":
1807-
solutions_to_submit.append(sol.copy())
1808-
solutions_to_submit_indices.append(sol_idx)
1806+
if type(pop_fitness[sol_idx]) is str:
1807+
if pop_fitness[sol_idx] == "undefined":
1808+
solutions_to_submit.append(sol.copy())
1809+
solutions_to_submit_indices.append(sol_idx)
1810+
elif type(pop_fitness[sol_idx]) in [list, tuple, numpy.ndarray]:
1811+
# This is a multi-objective problem.
1812+
pass
18091813

18101814
# Check if batch processing is used. If not, then calculate the fitness value for individual solutions.
18111815
if self.fitness_batch_size in [1, None]:

0 commit comments

Comments
 (0)
0