Do not add empty test cases to offspring population
@@ -53,12 +53,12 @@ class AbstractMOSATestStrategy(
# Apply mutation on offspring_1
self._mutate(offspring_1)
- if offspring_1.has_changed():
+ if offspring_1.has_changed() and offspring_1.size() > 0:
offspring_population.append(offspring_1)
# Apply mutation on offspring_2
self._mutate(offspring_2)
- if offspring_2.has_changed():
+ if offspring_2.has_changed() and offspring_2.size() > 0:
offspring_population.append(offspring_2)
# Add new randomly generated tests
@@ -76,7 +76,7 @@ class AbstractMOSATestStrategy(
tch = randomness.choice(list(self._archive.solutions)).clone()
tch.mutate()
- if tch.has_changed():
+ if tch.has_changed() and tch.size() > 0:
offspring_population.append(tch)
self._logger.info("Number of offsprings = %d", len(offspring_population))
