The state of an ABM, say W , is defined as the set of agents (locations are types of agent) that make up the system being modelled
W = P Agent (6.1)
Agents are composed of a set of attribute-value pairs, sometimes known as prop- erties. Each attribute is uniquely identifiable and its associated value can be either mutable or immutable. A mutable attribute-value pair may have constraints placed on the values it can take. The value of an attribute x belonging to an agent A is denoted “A.x”.
In any ABM there must exist a function, τ , that can tell how far apart any two agents are. It calculates this by comparing various attributes of the two agents in some predefined manner.
τ takes as input any two agents and returns a natural number (N ) represent- ing the “distance” between them (equation 6.2). There is no requirement that τ be commutative but non-commutative τ functions are very unusual (that is, it is
generally the case that distance from a to b is always the same as distance from b to a). This function defines the topology of a model1.
τ (Agent × Agent) → N (6.2)
All agents have an attribute called range which holds an integer value ≥ 0. For every agent a we define a set containing all agents within its locality (also known as its neighbourhood) where locality is defined using an agent’s range attribute:
La,W == {x ∈ W | τ (a, x) ≤ A.range} (6.3)
In ABM it is always the case that each agent’s locality is a small subset of the entire world (Equation ??).
∀ a : Agent, W ; P Agent • a ∈ W ⇒ La,W ⊂ W (6.4)
In fact each agents neighbourhood tends to compose a tiny fraction of the world being modelled: |La,W| |W | in all ABMs. It is an important principle in ABM that agents can only access local information when making decisions. Not allowing agents access to global information enforces a property known as bounded ratio- nality. Bounded Rationality is enforced by only allowing agents directly interact with, and have direct knowledge of, agents within its locality. Overall simulation properties, known as emergent properties are caused by individual local interac- tions. An agent is allowed to get indirect knowledge of things outside its local neighbourhood through information transfer across localities e.g. gossip, news- paper, television, etc. But this knowledge takes time to arrive, that is, it is time delayed. Information takes time to move through an ABM. I can see my neigh- bours state as they are now (instantaneously or within this time step) but I cannot see the state of non neighbours instantaneously. My knowledge of non local agents is always out of date due to the time it takes information to get to me.
One of the defining properties of an ABM is that all state changes occur through individual agent interactions. An agent interaction rule δ (see Equation 6.5) defines how the behaviour of each agent affects the world. It takes in the agent that is undertaking the behaviour and the current state of the world and then updates the state of the world by:
1. Updating the state of the agent the rule is applied to;
2. Possibly updating one or more other agents within the neighbourhood of the agent applying the rule.
δ : Agent × P Agent → P Agent (6.5)
When a behaviour δ is applied to an agent a in some world W the following must apply:
1. It cannot update any agents not in its neighbourhood (Equation 6.6). Equa- tion 6.6 states that if an agent b is not in my neighbourhood then any action I take now cannot directly affect b. My actions may have future consequences for b but these are indirect results of the current action. This is the principle of locality - all interactions are local;
2. The outcome of an agent’s behaviour cannot be influenced by any other agent not in its neighbourhood (Equation 6.7). Equation 6.7 states that anything occurring outside my neighbourhood now is unknowable by me now so can- not affect how I act now. An agent cannot be directly aware of any agents outside its neighbourhood.
∀ a, b : Agent; ∀ Wi, Wk: P Agent•(b ∈ Wi∧ b6∈La,Wi ∧ δ(a, Wi) = Wk) ⇒ b ∈ Wk
(6.6)
∀ a : Agent; ∀ Wi, Wk: P Agent • La,Wi = La,Wk ⇒ δ(a, Wi) = δ(a, Wk)
(6.7) These restrictions are essential properties of any ABSS. Without these restric- tions agents have access to non local information and that is not allowed.
∆ : P Agent → P Agent (6.8)
The state transition function ∆ (Equation 6.8) represents a single time step in the model. During each step all agents simultaneously take some action (that is, apply δ). This is implemented by applying the agent interaction rule, δ, to every agent (equation 6.9). This is also true if we are using a DES implementation. In that case the behaviour will revert to the identity mapping id (do nothing) for any agent whose timestamp is not the minimum timestamp in the World W .
applyRule : P Agent × δ → P Agent (6.9) A simulation run of a model is a sequence of model states where the first state matches the model initial state and every other state is computed from the previous state using the state transition function ∆ (equation 6.8).
If M = (W0, ∆) then [W0, W1, W2, ..., WN] is a valid simulation run iff ∀ i : 0 ≤ i < N • Wi+1 = ∆(Wi). That is, there is a valid transition between each adjoining pair of states. If the model is stochastic there may be many different valid simulation runs starting from the same initial state. A stochastic transition function is one where there is more than one valid outcome from applying the function to the starting state For example, agents might be allowed to move at random and can have a number of equally plausible destinations during any step.
There are a number of different ways of implementing an agent behaviour in a simulation, for example, different AU variants or SU. It is up to the modeller to choose a particular approach that correctly implements the transition function. applyRule is a correct implementation if its output matches that of our transition function ∆ as per equation 6.10.
∀ W : P Agent • applyRule(W, δ) = ∆(W ) (6.10)
An AU version of applyRule will update each agent in some order (Equation 6.11). Here we see the first parameter identifies the sequence in which the agents are to be updated. This sequence is generated using a well defined method that is defined by the particular AU variant employed.
AU ApplyRule is defined recursively. The base case occurs when there are no agents to apply the rule to so the state remains unchanged (Equation 6.12). Other- wise we apply δ to the first agent in our sequence producing an updated simulation state and then we recursively call applyRule with the remaining agents and the updated state (Equation 6.13).
AU ApplyRule : seq(Agent) × P Agent × δ → P Agent (6.11)
applyRule([a1, a2, . . . , an], w, ) = applyRule([a2, . . . , an], δ(a1, w)) (6.13) For AU ApplyRule to be a correct implementation of a set of concurrent events it must be the case that the order in which the rule is applied to the agents in the model does not affect the outcome of the rule (as defined in Equation 6.14). If application of the implementation has results that depend on the order in which the rule is applied to individual agents then it does not reflect the concurrent na- ture of a step. This is what leads to artefacts in a simulation. The sequence of behaviour applications does not exactly match the concurrent nature of the system being modelled.
∀ a, b : seq(Agent); ∀ W : P Agent •
(# a = # b = # W ∧ ran(a) = ran(b) = W ) ⇒
applyRule(a, W, δ) = applyRule(b, W, δ) (6.14)