Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b84d062

Browse files
None solution index
1 parent a3e1219 commit b84d062

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎pygad/utils/mutation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ def adaptive_mutation_population_fitness(self, offspring):
476476
if self.fitness_batch_size in [1, None]:
477477
# Calculate the fitness for each individual solution.
478478
for idx in range(first_idx, last_idx):
479+
# We cannot return the index of the solution within the population.
480+
# Because the new solution (offspring) does not yet exist in the population.
481+
# The user should handle this situation if the solution index is used anywhere.
479482
fitness[idx] = self.fitness_func(self,
480483
temp_population[idx],
481484
None)
@@ -495,6 +498,9 @@ def adaptive_mutation_population_fitness(self, offspring):
495498
batch_last_index = first_idx + (batch_idx + 1) * self.fitness_batch_size
496499

497500
# Calculate the fitness values for the batch.
501+
# We cannot return the index/indices of the solution(s) within the population.
502+
# Because the new solution(s) (offspring) do(es) not yet exist in the population.
503+
# The user should handle this situation if the solution index is used anywhere.
498504
fitness_temp = self.fitness_func(self,
499505
temp_population[batch_first_index:batch_last_index],
500506
None)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /