CS300b – Agent Modeling
What are we assuming, and what are we excluding from those assumptions?
This model features a population of spatially embodied agents moving through continuous space, each using a coordinated walk. When agents collide, they become confused, and each sets off in a new direction. We run each model simulation for 10,000 time steps and compare the number of collisions during that time.
A population of N agents is initialized with each agent placed at a random real-valued locations on an \(L×L\) grid with periodic boundaries. Each agent \(i\) has a direction heading \(\theta_i\), which is initially chosen at random from a uniform distribution of integers \([0, 359]\). Each agent is fully defined by its location and directional heading. Other model parameters are the whimsy, \(w\), which determines the turning angle agents use on each time step, and the speed, \(s\), which determines the size of the step they take when moving. Finally,we keep track of the cumulative number of collisions over time, \(C(t)\).
At each time step, each agent, in a random order, turns, moves, and collides. An agent first turns by adding to its direction heading an integer value that is randomly drawn from a uniform distribution in \([0, w]\). The agent then subtracts a newly drawn value from the same distribution from its directional heading. In other words, its new directional heading is \(\theta_i + \epsilon\), where \(\epsilon\) is randomly drawn from a binomial distribution bounded in \([−w,w]\). The agent then moves \(s\) units forward. If there are any other agents with a position within one unit of the focal agent’s new location (defined by the Euclidean distance between the centers of each agent), a collision occurs between the focal agent and all of these other nearby agents. In this case, all of the agents involved in the collision update their heading to a new value randomly selected from the uniform distribution \([0,359]\). Each of the involved agents then moves forward \(0.1\) spatial units in order to move away from the site of the collision and avoid cycles of perpetual collision. If a collision occurs,the cumulative collision counter \(C(t)\) is incremented by one.