A hall is full of people. Before the alarm, place pillars and signs. Then sound the alarm: each person goes to a door. Bring all the people out fast, with no one hurt in the crush.
Make your plan, then sound the alarm.
Choose a tool, then click in the hall.
Each person is a gen_boid process. It goes to the nearest door, walks around the pillars, keeps a distance, and walks slower in a dense crowd. No person knows the plan of the crowd.
The walls, the signs and the doors are rules that are functions. Each one reads the hall, the doors and the signs from the state of the person.
Each pillar is an obstacle of the world (boids:set_obstacle/4). The people see it at once with the rule avoid.
No rule says "make a crush". It comes from many people that go to one door. A pillar a little in front of a door divides the crowd, and fewer people get hurt.