2.2.1: Agents#
In a nutshell
Agents are the actors an agent-based model is built from, so before you can build one you need to answer two questions: what makes something an agent, and how do you describe one? This section answers both, then shows how a mix of simple agents can produce behaviour that no one programmed directly.
2.2.1.1: What is an agent?#
Agents are the fundamental building blocks of agent-based models. Several key properties characterise each agent and define its identity and behaviour within the simulation[1]:
Agents are encapsulated entities with clearly identifiable boundaries and well-defined interfaces that separate them from their environment and from other agents. They are situated in particular environments, where they receive input through sensors and act through effectors. They are capable of flexible action, responding to changes and acting in anticipation of future events. Most importantly, agents are autonomous: they control their own internal state and behaviour, and they are designed to meet objectives as they attempt to fulfil purposes, solve problems, or achieve specific goals[2].
These four broad properties (encapsulated, situated, flexible, and autonomous) show up in a handful of concrete facets that you set for every agent you build. The tab-set below unpacks them, from the behaviour and goals that drive an agent to the states and actions through which it engages the world.
How agents act and respond to different situations and stimuli. Behaviour encompasses their decision-making processes, their response patterns, and the way they carry out activities within the model environment.
Objectives or purposes that drive agent decision-making. Goals provide direction and motivation for agent actions, helping determine priorities and choices when multiple options are available.
The ability to communicate and engage with other agents and the environment. Interactions include direct communication, observation of the behaviours of others, and responses to environmental changes.
Decision-making follows programmed rules and logic. Agents use conditional statements (if-then rules) to determine appropriate responses to different situations and stimuli.
Agents can modify their behaviour based on experience or changing conditions. This flexibility allows agents to respond to new situations and to improve their performance over time.
The capacity to acquire new knowledge or improve performance over time. Learning enables agents to update their strategies, remember past experiences, and make better decisions.
Internal conditions that change during the simulation (location, resources, beliefs). States represent the current status of an agent and can be modified through actions and interactions.
Specific behaviours or operations that agents can perform. Actions are the observable outputs of agent decision-making and can affect both the agent itself and its environment.
2.2.1.2: Agent vs. not-an-agent#
Knowing what properties an agent has is only half the job; you also need to tell an agent apart from the parts of a model that merely surround it. An agent is an autonomous individual, meaning it senses its situation and acts on its own to pursue a goal. The environment, global outputs such as an average, and fixed settings are not agents, because they make no decisions of their own. Telling the two apart matters when you build a model, since the agents are the parts you give behaviour to, while everything else is background they act in. In the activity below, label each item an agent or not an agent.
The lesson to hold on to is that being an agent is about deciding and acting for oneself. Parts of the model that only sit there, or that are averages and settings, are not agents no matter how important they are.
2.2.1.3: Describing an agent: role, state, and properties#
It helps to describe an agent from three angles that answer three different questions. Its role says what the agent stands for in the world being modelled, whether a person, an object, or something more abstract. Its state is the set of conditions that change as the simulation runs, such as where it is, what it holds, and what it believes. Its properties are the characteristics that define it, some fixed for the whole run and some varying with experience. Keeping these three apart matters when you build a model, because it tells you which facts about an agent stay put and which you must update at every step. Use the switcher below to move between role, state, and properties, and notice which kind of information each one collects.
The distinction to carry away is between what stays fixed about an agent and what changes as it acts, since the state is precisely the part your model has to keep updating over time.
2.2.1.4: The agent loop: perceive, decide, act#
Role, state, and properties tell you what an agent is made of; the next question is how those parts work together as the simulation runs. They are wired into a single repeating cycle, in which an agent perceives its situation, decides on the basis of its state and rules, and acts back on the world.
Fig. 16 Figure 2.2 Agent in environment: agent is a thing that does things to other things[3].#
As illustrated in Figure 2.2, an agent-based model (ABM) consists of autonomous agents situated within a shared Environment. Each individual agent is defined by its internal State (its current traits or variables) and by a set of behavioural Rules (the logic guiding its decisions). The dynamics of the model follow a continuous feedback loop. First, an agent receives Inputs from both the environment and the surrounding agents. Guided by its internal rules, these inputs then update the agent’s internal state, which in turn triggers specific Actions. Finally, these actions can modify the agent itself, affect other agents directly, or alter the broader environment, thereby shifting the state of the system over time.
The idea to keep in mind is that every agent, however it is dressed up, runs the same loop: it perceives its situation, decides using its rules and state, and acts, and that action feeds back into the world for the next round.
2.2.1.5: Agent types in practice#
With the parts and the loop in place, it helps to see what agents look like across different fields. Consider different types of agents in various ABM applications:
Consumers with preferences, budget constraints, and purchasing behaviours.
Individuals with social networks, opinions, and influence relationships.
Animals with movement patterns, foraging behaviours, and reproduction cycles.
Vehicles with speed preferences, route choices, and following behaviours.
Example: market trading agents
Consider agents in a financial market simulation representing individual traders:
State (dynamic information):
Portfolio composition: Current holdings of stocks, bonds, and cash
Cash balance: Available funds for new investments (\(10,000 - \)1,000,000)
Properties (agent characteristics):
Risk tolerance: Conservative (low-risk), moderate, or aggressive (high-risk)
Experience level: Novice (0-2 years), intermediate (2-10 years), expert (10+ years)
Behaviour (decision rules):
Buy decisions: Purchase when price drops below personal valuation threshold
Sell decisions: Sell when profit target reached or stop-loss triggered
Interactions (market dynamics):
Price observation: Monitor real-time stock prices and market indicators
Order execution: Submit buy/sell orders that affect market prices
This example demonstrates how simple agent rules create complex market behaviour without explicitly programming market-level phenomena.
The example above splits the trader into four kinds of attribute; test that distinction yourself by filing each attribute under state, property, behaviour, or interaction.
Filing the attributes this way reinforces the anatomy of any agent: what changes, what defines it, how it decides, and how it connects.
2.2.1.6: Emergence: behaviour no one programmed#
That last remark is the real payoff of thinking in agents: the trader example already hints that market-level behaviour is never written down anywhere, but arises from the traders acting on their own rules. The simulation below makes that concrete. Here the agents are traders of two types: fundamentalists, who buy when the price is below its true value and sell when it is above, and trend-followers, who buy simply because the price is rising. The activity lets you set the mix of the two types. No one sets the price; it comes out of the traders.
The lesson to take away is that no one sets the market price directly; it emerges from the mix of agents and their rules, so the very same market can stay calm or break into bubbles and crashes depending only on who is trading.
Important
Key terms:
Agent: An autonomous entity that can perceive its environment and act upon it
Autonomy: Agents make independent decisions based on their internal rules
Agent behaviour: The rules and processes that determine how an agent responds to stimuli
State: The current internal condition of an agent (changeable over time)
Rules: Logic that governs how agents make decisions and take actions
Adaptation: The ability to modify behaviour based on experience
Learning: Acquiring new knowledge or improving performance over time
Interactions: Communication and engagement with other agents and environment
Decision-making process: The systematic approach agents use to evaluate options and choose actions
Output actions: The observable behaviours and operations that agents perform in the environment
With the agent itself now defined, described, and shown to produce emergent behaviour, the next section turns to the space and environment those agents inhabit.
Key takeaways#
Key takeaways
An agent is an autonomous entity with its own state and behavioural rules that perceives its surroundings, decides, and acts.
Agents are described by their role, state, and properties, and they operate through a repeated loop of perceiving, deciding, and acting.
Because each agent acts on local information, system-level behaviour emerges that no individual agent was programmed to produce.