Skip to content

Commit

Permalink
Fixed testUpdatePopulation() to account for moving sorting population…
Browse files Browse the repository at this point in the history
… into run() method.
  • Loading branch information
cristianlacey committed Jan 3, 2019
1 parent 4c3b8e0 commit 5b10232
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_genalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def testUpdatePopulation(self):
for truss in ga.population:
truss.fitness_score = np.random.random()

ga.population.sort(key=lambda x: x.fitness_score)
ga.update_population()

# Check that population is sorted by fitness_score
Expand Down

0 comments on commit 5b10232

Please sign in to comment.