Skip to content

Commit

Permalink
fixed bug with imap chunksize
Browse files Browse the repository at this point in the history
  • Loading branch information
f0uriest committed Jan 1, 2019
1 parent 8217c75 commit 86c2c14
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gastop/genalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def score(truss):
# With parallelization
else:
if self.ga_params['pop_size'] < 1e4:
chunksize = self.ga_params['pop_size']/100
chunksize = int(self.ga_params['pop_size']/100)
else:
chunksize = int(np.sqrt(self.ga_params['pop_size']))
for current_gen in tqdm(range(num_generations), desc='Overall', position=0):
Expand Down Expand Up @@ -347,6 +347,7 @@ def update_population(self): # Cristian

# Append separate lists to form new generation
population = pop_elite + pop_crossover + pop_mutation + pop_random

pbar.close()
# Update population attribute
self.population = population
return

0 comments on commit 86c2c14

Please sign in to comment.