Skip to content

Instantly share code, notes, and snippets.

@fedden
Created October 12, 2017 18:28
Show Gist options
  • Save fedden/28a1af6a88e812343a0e42f76afd7df8 to your computer and use it in GitHub Desktop.
Save fedden/28a1af6a88e812343a0e42f76afd7df8 to your computer and use it in GitHub Desktop.
hybrid
elif self.mode == 'hybrid':
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 = (best_neighbour[x] + self.swarms_best[x]) / 2.0 - p[x]
p[x] = p[x] + leader_rate * update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment