Skip to content

Instantly share code, notes, and snippets.

@fedden
Created October 12, 2017 18:48
Show Gist options
  • Save fedden/716efa1a546f69756eab4b0c828371d0 to your computer and use it in GitHub Desktop.
Save fedden/716efa1a546f69756eab4b0c828371d0 to your computer and use it in GitHub Desktop.
n_fittest
elif self.mode == 'n_fittest':
if r[i][x] < self.disturbance_threshold:
p[x] = np.random.normal(dev, mean)
else:
leader_rate = np.random.uniform(0.0, 1.0)
update = np.average(self.population[n_fittest]) - best_neighbour[x]
p[x] = best_neighbour[x] + leader_rate * update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment