We can model the agents using four states. SITTING, CLAPPING, STANDING, FINISHED. All agents begin sitting. After the performance, if it exceeds their threshold, they clap, otherwise they are finished. If the performance is really good, they stand.
Initialize a world with 100 agents, each with variable thresholds for when they will clap or stand. Scatter them around the world. Also, include a threshold where they will simply leave without clapping.
Add a "Run Once" block, to enact the end of the performance. This will have each agent judge the quality of the performance, determined by a slider, to see what state they will be in next.
Now, add a forever block to simulate the peer pressure. If at least 2 people in a radius of 5 are standing, then they should also stand. Use a line graph to visualize how many agents are standing, clapping, sitting, or finished.
Add another element to the model, where agents get exhausted from clapping after a certain amount of time. Once they are exhausted, they change to the finished state.
Agents can be represented with 4 states. SITTING, READY, STANDING, EXHAUSTED. If a sitting agent sees a standing agent near them, they turn ready for one timestep, then stand up. They stand for a set number of steps, then are exhausted for a set number of steps, before they are sitting again.
We want our agents to be in a circle. This can happen when we create all the agents, but do not scatter them. Add a "RUN seconds" block, and have them move forward 1 step for 4 seconds.
Also, one of the agents needs to begin in the standing state for the wave to propagate through the stadium. You can identify a certain agent by their ID. If the agent has ID 0, in the setup block, give them the standing color.
We can smell in a certain direction by first moving in that direction, smelling, them moving back, reversing our steps in the move.