We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40ef0d8 commit 2a6ba48Copy full SHA for 2a6ba48
episodes/files/pred-prey/predprey.py
@@ -84,7 +84,7 @@ def flock(self, prey_list):
84
group_centre_count += 1
85
86
# Avoidance behaviour
87
- if separation < SAME_SPECIES_AVOIDANCE_RADIUS:
+ if separation < SAME_SPECIES_AVOIDANCE_RADIUS and separation > 0:
88
# Was a check for separation > 0 in original - redundant?
89
avoid_velocity_x += SAME_SPECIES_AVOIDANCE_RADIUS / separation * dx
90
avoid_velocity_y += SAME_SPECIES_AVOIDANCE_RADIUS / separation * dy
0 commit comments