Agent City is a program for demonstrating how multiple rule-based agents can behave in an environment. Agent City is a fictive city inhabited by three types of agents; green, blue and red. Each agent lives in a house in the city. The city also has some houses for sale (white squares), roads (gray) and areas without houses (white large areas). There are in total 774 houses in the city, and 8 is always for sale. The idea behind the program is that green agents prefer to live next door to other green agents, blue next to blue agents and red next to red agents. When an agent does not like its neighborhood (too many blue's around me and I am green) the can choose to move to a house for sale. By running the simulation it is shown that the city becomes more and more segregated.
Each agent follows these rules: