## Homework

Homework #8 is due today: Railsback & Grimm, Ch. 8, Ex. 8.1, 8.2 (everyone), Ch. 9, Ex. 9.1, 9.3, 9.4 (everyone), Ch. 8, Ex. 8.3, 8.4 (grad. students), and Ch. 9, Ex. 9.6 (grad. students). See the homework assignment sheet for details.

• Railsback & Grimm, Ch. 10.

Important programming concepts in this chapter include:

Agents interact with their physical environment (patches around them) and with other agents nearby, but they can also interact in social networks, which can be represented by links.
Variable scope:
Understand the differences between global variables, local variables, patch variables, agent variables, and link variables. Understand how an agent can get the value of a global variable or variables belonging to a certain patch or link or another agent.
Entity detection:
Understand different ways to detect which agents or patches meet certain conditions (e.g., within a certain distance, have a certain color, have the largest or smallest values of some variable, etc.).

The agents’ interactions, both with their environment and with each other through sensing. Part of the design concepts section of a model’s ODD consists of specifying what the agents can sense: They might be able to sense other agents within a certain distance. They might only be able to detect other agents if they are within a certain angle (e.g., the agent might be able to look forward, but might not be able to see behind itself unless it turns around). Agents might be able to detect certain qualities of one another (e.g., I can see how tall you are, but I can’t see how much money you have).

Agents can interact both spatially and through networks of links. You can create many kinds of links so that agents can belong to many networks (e.g., family, co-workers, members of a church congregation, etc.).

Sensing involves two steps:

1. Detect which entities your agent (or patch) will sense.
2. Get the values of the sensed variables from those entities.

Be sure to code the Business Investor model as you read section 10.4. You will use it in Chapter 11 and it will form the basis for one of the team projects you will present. The other team project will use the Telemarketer model from section 13.3. This would be a good time for you and your teammates to get started on your team projects.

Errata for Chapter 10:

• Section 10.4, p. 140: The first statement in the first block of code near the top of p. 140 should be: let potential-destinations ... instead of set potential-destinations ....