Skip to content

Instantly share code, notes, and snippets.

@fedden
Created October 12, 2017 18:22
Show Gist options
  • Save fedden/f0f00582e16be87050467c48a0d61b53 to your computer and use it in GitHub Desktop.
Save fedden/f0f00582e16be87050467c48a0d61b53 to your computer and use it in GitHub Desktop.
original
if self.mode == 'original':
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 = self.swarms_best[x] - 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