There's a lovely article in Physics World magazine from November 2024 about efforts to model the herding behaviour of sheep. It says that the original work on flocking was done modelling birds by having them match the speed and direction of those nearest whilst inserting a repulsive force to avoid collisions. Sheep proved more problematic because flocks don't just do one thing. There is a need to have both an eating in one place and a moving to a different place behaviour. This is seen as being like a phase transition. Sheep have a hierarchy so some animals lead and the rest follow. That also needs programming into the model. So I'll be keeping an eye on the field!