Each neighbour contributes a unit vector away from it, weighted by 1 / distance, so close neighbours dominate distant ones — the standard
inverse-distance falloff. The neighbour set is the neighbourhood (see the
module note); a neighbour exactly on top of the agent has no direction to push
along and is skipped rather than producing NaN.
With no neighbours — or with contributions that cancel exactly — the result is
the zero vector, not a braking −velocity. "Nothing to avoid" must be an
abstention, or a weighted blend of behaviours would silently brake whenever
the flock spread out.
Separation (§12 flocking): steer away from crowding neighbours.
Each neighbour contributes a unit vector away from it, weighted by
1 / distance, so close neighbours dominate distant ones — the standard inverse-distance falloff. The neighbour set is the neighbourhood (see the module note); a neighbour exactly on top of the agent has no direction to push along and is skipped rather than producingNaN.With no neighbours — or with contributions that cancel exactly — the result is the zero vector, not a braking
−velocity. "Nothing to avoid" must be an abstention, or a weighted blend of behaviours would silently brake whenever the flock spread out.