*7.1. Interaction Model*

For the sake of simplicity, there is a two-dimensional grid world that consists of places at discrete locations (*x*,*y*). An artificial agent occupies one place of the grid. A maximum of one agent can occupy a place. The agents can move on the grid and can change their living position. It is assumed that there are two groups related to the classes *a* and *b* of individuals. The social interaction is characterised by different attitudes [31] of an individual between different and among same groups given by four parameters:

$$S = (\mathbf{s}\_{\text{an}}, \mathbf{s}\_{\text{ab}}, \mathbf{s}\_{\text{ba}}, \mathbf{s}\_{\text{bb}}). \tag{4}$$

The model is not limited to two groups of individuals. The *S* vector can be extended to four groups (or generalised) by the matrix:

$$\begin{array}{ccccc} \mathbf{S}\_{abcd} = \begin{pmatrix} \mathbf{s}\_{b1} & \mathbf{s}\_{ab} & \mathbf{s}\_{ac} & \mathbf{s}\_{ad} \\\\ \mathbf{s}\_{b1} & \mathbf{s}\_{bb} & \mathbf{s}\_{bc} & \mathbf{s}\_{bd} \\\\ \mathbf{s}\_{cd} & \mathbf{s}\_{cb} & \mathbf{s}\_{cc} & \mathbf{s}\_{cd} \\\\ \mathbf{s}\_{cd} & \mathbf{s}\_{db} & \mathbf{s}\_{dc} & \mathbf{s}\_{dd} \end{pmatrix} . \end{array} \tag{5}$$

The world model consists of N places *x*i. Each place can be occupied by none or one agent either of group α or β, expressed by the variable *x*<sup>i</sup> = {0,−1,1}, or generalised *x*<sup>i</sup> = {0,1,2,3,4,..,n} with *n* groups. The social expectation of an individual *i* at place *x*<sup>i</sup> is given by:

$$f\_i(\mathbf{x}\_i) = \sum\_{k=1}^{N} f\_{ik} \delta\_s(\mathbf{x}\_i, \mathbf{x}\_k). \tag{6}$$

The parameter *J*ik is a measure of the social distance (equal to one for Moore neighbourhood with a distance of one), decreasing for longer distances. The parameter δ expresses the attitude to a neighbouring place, given by (for the general case of *n* different groups):

$$\delta\_s(\mathbf{x}\_i, \mathbf{x}\_k) = \begin{cases} \mathbf{s}\_{a\emptyset}, & \text{if } \mathbf{x}\_i \neq 0 \text{ and } \mathbf{x}\_k \neq 0 \text{ with } a = \mathbf{x}\_i\boldsymbol{\beta} = \mathbf{x}\_k\\ 0, & \text{otherwise} \end{cases} \tag{7}$$

Self-evaluation is prevented by omitting the current place (i.e., *k i*). There is a mobility factor *m* giving the probability for a movement.

An individual agent *ag*<sup>i</sup> of any group α (class from the set of groups) is able to change its position by migrating from an actual place *x*<sup>i</sup> to another place *x*<sup>m</sup> if this place is not occupied (*x*<sup>m</sup> = 0) and if *f* i(*x*m) > *f* <sup>i</sup> (*x*i) and the current mobility factor *m*<sup>i</sup> is greater than 0.5. Among social expectation (resulting in segregation), transport and traffic mobility have to be considered by a second goal-driven function *g*(*x*m), commonly consisting of a destination potential functions with constraints (e.g., streets). If *g*i(*x*m) > *f* i(*x*m) > *f* <sup>i</sup> (*x*i) than the goal-driven mobility is chosen, otherwise the social-driven is chosen.

$$\lg : (\mathbf{x}\_i, \mathbf{x}\_{\text{tr}}, \mathbf{x}\_{\text{tr}}, \mathbf{v}, t) \to \mathbb{R} \tag{8}$$

The mobility function *g* returns a real value [0,1] that gives the probability (utility measure) to move from the current place *x*<sup>i</sup> to a neighbouring place *x*<sup>m</sup> to reach the destination place *x*<sup>k</sup> with a given velocity *v*. The *g* function records the history of movement. Far distances from the destination increase *g* values. Longer stays at the same place will increase the *g* level with time *t*. Social binding (i.e., group formation) will be preferred over goal-driven mobility.

The computation of the neighbouring social expectation values *f* is opportunistic, i.e., if *f* is computed for a neighbouring node assuming the occupation of this neighbouring place by the agent if the place is free, and the current original place is omitted *x*<sup>i</sup> for this computation. Any other already occupied places are kept unchanged for the computation of a particular *f* value. From the set of neighbouring places and their particular social and mobility expectations for the specific agent the best place is chosen for migration (if there is a better place than the current with the above condition). In this work, spatial social distances in the range of 1–30 place units are considered.

Originally, the entire world consists of individual agents interacting in the world based on one specific set of attitude parameters *S*. In this work, the model is generalised by assigning individual entities its own set *S* retrieved from real humans by crowd sensing, or at least different configurations of the *S* vector classifying social behaviour among the groups. Furthermore, the set of entities can be extended by humans and bots (intelligent machines) belonging to a group class, too.

Segregation effects inhibit individual movement until a different social situation enables a movement. Transportation mobility triggers movement even if there is no social enabler. This is reflected in the extended Sakoda model by the mobility factor *m* and the goal-driven expectation function *g* that control mobility and overlays social and transportation and traffic mobility. The mobility function *g* includes random walk and diffusion behaviour, too. Constrained mobility is one major extension of the original Sakoda model presented in this work.
