This is an awfully verbose write-up trying to glean a kind of handwavy deeper meaning behind flocking. I kind of get what its going for, you'll see a lot of interesting crowd behavior from a simple view of a predator-prey model where you replace lions consuming gazelles with arrests. A couple people have asked me about what they should wear to protests and I suggested wearing zebra stripes. If enough people do it, it makes it hard to visually track what direction people are going in when they disperse and has the benefit of reducing bug bites. The idea here is good though, a swarm is a decent model for how protestors should behave because their forces are about numbers whereas the police are about specialization. I mean one of the more remarkable things about protests globally is the emergence of more distinct support classes offering dedicated services. As soon as trouble brews, I see people on both sides clearing out the most vulnerable because they probably can't afford to get arrested. There's definitely a hierarchy of high-value targets unfortunately. A good example is the emergence of white shields.

If you really want to get into it, attrition models here model rates for both factions. You can simulate it yourself with a cellular automata model for a visual representation.
Appropriate considering they are literally using phalanxes.

http://chalkdustmagazine.com/blog/modelling-warfare

Here's the interesting thing to me. What allows swarm behavior in humans isn't the advent of Internet technology or fancy math. Sure, social media makes it easier to coordinate immediate responses and allocate ourselves. But the only reason any of this happening is that we find ourselves having a lot of free time to actually understand each other, decide to agree on something and then organize a time and place to do it.

Aside: Dear Hacker News, if you really want to make a difference on the ground, consider offering tech stations where people can charge batteries or get service. Maybe take the time to teach people about surveillance cameras and adversarial fashion. Or you know, just tell people how to set up Signal. You might think this is low hanging fruit, but your average citizen is intimidated by it or completely isolated from the stuff that we get bored about. I know at least a good deal of us are frustrated that the average consumer is not more savvy or protective of their digital rights. What's beautiful about computer technology to me is how we help each other by teaching people to help themselves. Not everyone needs to know DevOps, but getting a community to switch from unencrypted messaging is fun and simple if you show them how easy it is.

Back to business:
It's kind of a coding rite of passage to cook up the physics for a flocking system. Reynold's boids model is a masterful demonstration in how to intuitively understand class behavior.

My boss once asked me if we would ever be able to compute the complex behavior of bird swarms. I immediately flipped around and said yes, one day in the distant future of 1986. A bit snarky. I regretted it immediately. He just expressed disappointment by how simple it ended up being. I explained that its just a model of understanding and elegant for it, real life behavior is a lot more chaotic and nuanced than this toy. In 2D it runs pretty well, and it's a decent stress test on GPUs if you can also generalize the structure to take advantage of 3D engines.

Here's a link to Daniel Shiffman's excellent write up and code examples illustrating the phenomena:
https://natureofcode.com/book/chapter-6-autonomous-agents/

Another interesting take on swarming behavior is the study of convexity in the generalized raptor problem. The discrete version of this problem is a kind of flavor of the N-Queens problem. Basically you're solving for an ODE so the police on all sides can't get you.