1 Introduction

Modeling human mobility behavior is a topic of great relevance, since such models can be used for analyzing and understanding many real-world processes, like migration and traffic flows [14], as well as processes depending on human mobility and interaction, such as epidemic spreading [5, 6] and the propagation of information and innovations [710]. In many cases, observed mobility patterns have been shown to be of crucial importance for uncovering essential properties of the underlying dynamics, which is needed for effective prediction, control and optimization of the mobility as well as spreading dynamics [1118]. Although mathematical modeling of such systems has been studied since decades [1923], in recent years traditional modeling techniques needed to be adapted [24] to the large amount of newly accessible data and collected observations about people’s locations and movements, e.g. from social media [25, 26] or mobile phone data [4, 27].

Human mobility behavior in ancient times, however, differs in many aspects from the mobility dynamics we observe in modern times, especially in their spatio-temporal scales, in the observed patterns and in the motivations for movement. In prehistoric times, due to the lack of modern transportation, the distances that could be traveled were shorter and required more effort and time to be traversed. Despite this, people were constantly migrating, mostly influenced and forced by climate changes, unsuitable environmental conditions, the search for resources and social conflicts [1, 28, 29]. Human movements of this type have triggered exchange of various innovations, as people were also spreading their socio-cultural and technological influences [30]. Thus, the importance of studying migration flows in ancient times is closely related to the understanding of the origin of cultural, social and technological ideas in the world nowadays.

Modeling spreading processes that are governed by human mobility in prehistoric times faces several additional difficulties compared to spreading processes in modern times. First, the available data is very sparse, indirect and uncertain [31]. The reason for this is that there is a limited amount of archaeological traces at hand which may or may not represent the true, complete data set. Second, besides the limited data resources, we cannot replicate or observe anymore a process that had happened in prehistoric times in order to obtain new data. Third, given the level of socio-technological development in ancient times, the possibility for humans to interact were restricted to close distances. And thus the produced patterns of the dynamical properties of spreading processes are quite different compared to the ones that can be observed nowadays. For all these reasons, when modeling mobility and spreading processes in ancient times, we can not directly apply many of the state-of-the-art modeling approaches, based on data-fitting and validation [7], data assimilation [25] or methods that assume perfect social mixing [32].

In this paper we will model the spreading of innovations coupled to the mobility of people in the ancient world by using an agent-based modeling approach [33, 34]. Agent-based modeling (ABM), also termed individual-based modeling, considers agents, representing people, organizations or other discrete entities [35], and consists of rules specifying the behavior of these agents. Additionally, agents are autonomous, they can learn and adapt their behavior while interacting with their environment and other agents. We are considering agents that are moving diffusively in a region, but preferentially in direction of a more suitable environment, considering at the same time how densely populated an area is. In our model, the motion of agents is described by a stochastic differential equation that includes random agent movements [36], similar as in the case of Brownian agents [37, 38]. If agents are close to each other in space, they are able to communicate and can exchange the innovation at a certain rate. These connections between agents form a spatial network that is evolving in time [39], as the contacts between agents are changing due to their movements. Since the spreading process of the innovation is happening on this time-evolving network, the two processes, diffusion and spreading, are strongly coupled. Taking this into account, we are proposing here a joint algorithm for the simulation of the time-continuous diffusion and the event-based spreading process, building on the Euler–Maruyama scheme [40, 41] and the Temporal Gillespie algorithm [4244], respectively. Our new simulation scheme benefits from a statistically accurate evolution of the spreading process, while being computationally more efficient than equivalent time-discretizations [42, 45].

As a real-world scenario, we will demonstrate the applicability of our model and data-driven simulation tool to study the emergence and spreading of the wool-bearing sheep from south-west Asia towards central Europe between 6200 BC and 3000 BC. During this time period human mobility and innovation spreading are considered closely related [46]. Thus, the spreading path of the wool-bearing sheep as an innovation can be assumed to be linked to migration routes and mobility dynamics. Since the introduction of wool was an important driving force for the textile production and socio-economic development of past societies [47, 48] it is a question of interest to infer possible spreading patterns of the wool-bearing sheep.

The article is organized as follows. Our general model for human migration and the innovation spreading will be introduced in Sect. 2. In Sect. 3 we will present a new simulation scheme for the combined dynamics. Finally, in Sect. 4 we will apply our modeling and simulation approach on a real-world example and discuss its results. We will derive our final conclusions and possible future directions in Sect. 5.

2 Model formulation

We will briefly introduce the concept behind agent-based models in Sect. 2.1, before arguing our modeling assumptions and the scope of the model in Sect. 2.2. We are modeling the migration of agents in the ancient world, coupled to the spreading of an innovation among agents. In order to achieve this, we first formulate the migration process in Sect. 2.3 and the spreading process in 2.4, and then couple the two processes in Sect. 2.5.

2.1 What is an agent-based model?

Agent-based modeling (ABM) is a modeling technique that captures the behavior patterns of a large number of interacting agents on the global scale by describing and simulating the behavior on the local agent-scale. Agents are discrete autonomous entities that behave according to simple rules and can learn and adapt their behavior in response to other agents and changes in their surroundings [33, 34]. For these reasons, ABM is a technique that is widely applicable and used, especially in scientific disciplines such as sociology, economics, geography [49, 50], but recently also more data-driven and mathematical formulations of ABM’s appeared in the literature [5155].

In this paper we want to model the spreading of innovations with an ABM approach, such that we can couple the spreading of the innovation to the migration of people. By setting up behavior rules for the individuals we can observe complex patterns that emerge from social interactions and movements of the population. Additionally, these models are well suited for incorporating data, for example in order to set unknown parameters or for validation purposes.

The outcome of an ABM simulation depends on the rules one specifies for the agents. One challenge is therefore to find a reasonable model formulation. More precisely, one has to find a compromise between making too simplistic assumptions, which would lead to a model that is not plausible, and an unnecessarily complicated model, which would be hard to analyze and test [56, 57]. We will tackle this issue by emphasizing the mathematical formulation of the model.

2.2 Modeling assumptions

In our agent-based modeling framework, an agent represents a small tribe or group of people that are able to adopt the innovation in the ancient world. We consider the number of agents n to be constant and thus population growth and decline are not incorporated into the model. Each agent k, \(k=1,\dots, n\) has a position state and an innovation state. The agents’ positions are restricted to a given domain \(D\subset \mathbb {R}^{2}\). The innovation state is denoted by values in \(\{0,1\}\), indicating whether the innovation has been adopted by the agent (state 1) or not (state 0). Thus, the state space of the system is \(S = \{0,1\}^{n} \times D^{n}\). Spatial movements of agents can induce changes in both the position and the innovation states over time, so we distinguish between individual states for each agent at a particular point in time. We denote the state of the kth agent at time t by

$$Y_{k}(t) = \bigl(I_{k}(t), X_{k}(t)\bigr), $$

where \(I_{k}(t)\in\{0,1\}\) is the agents’ innovation state and \(X_{k}(t)\in D\) its position in the domain. The state of the system at time t for the set of agents is then given by

$$Y(t) = \bigl(I(t), X(t)\bigr), $$

where the kth row of the systems’ state corresponds to the state \(Y_{k}(t)\) of the kth agent.

Agents in ancient times have a nomadic lifestyle and are able to move and change their position in the domain D. These movements are modeled such that agents are attracted to regions that are suitable for them. Additionally, agents tend to group together in space and form communities, while keeping a certain distance to avoid spatial overlap with others. Each agent has limited knowledge about other agents in his neighborhood. Especially, its movement in space is independent of the innovation states of the other agents. Based on these assumptions we formulate a model for the spatial migration of agents in Sect. 2.3.

Adopters of the innovation can pass on the innovation to non-adopters at a certain rate independently of each other if their Euclidean distance is closer than some radius r. We assume that agents that have adopted the innovation will stay in state 1 for all times, which leads to the spreading dynamics of the innovation as described in Sect. 2.4.

2.3 Modeling the agent mobility

All agents are following the same rules that describe their mobility and migration. We are including three factors motivating an agent to change its position: First, agents are taking into account the suitability of their environment and move in direction of more attractive areas. Second, agents are considering other agents in their neighborhood and tend to form loose groups without crowding too much. Third, we include some randomness in the agents’ movement to model other unknown incentives for positional changes and to allow agents to take random choices or make mistakes in their evaluation of the environment.

Having this in mind, the movement for every agent k is described by a diffusion process

$$ dX_{k}(t) = -\bigl(\nabla V\bigl(X_{k}(t) \bigr)+ \nabla U_{k}\bigl(X(t)\bigr)\bigr)\,dt + \sigma \,dW_{k}(t), $$
(1)

where \(V: \mathbb {R}^{2} \rightarrow \mathbb {R}\) denotes the suitability landscape, \(U_{k}:\mathbb {R}^{2n}\rightarrow \mathbb {R}\) is the kth agents’ attraction–repulsion potential with respect to all other agents’ positions, \(\sigma\in \mathbb {R}\) is a constant and \(W_{k}(t)\) denotes the standard Brownian motion in \(\mathbb {R}^{2} \). Every agents’ movement is governed by this diffusion equation, thus we have n equations in total, coupled via the attraction–repulsion potential. The evolution of the system of agents can be written as

$$ dX(t)=-\nabla(\tilde{V}+U) \bigl(X(t)\bigr)+\sigma \,dW(t)$$
(2)

with

$$\tilde{V}\bigl(X(t)\bigr)=\bigl(V\bigl(X_{k}(t)\bigr) \bigr)_{k=1}^{n},\qquad U\bigl(X(t)\bigr)=\bigl(U_{k} \bigl(X(t)\bigr)\bigr)_{k=1}^{n}\quad \text{and}\quad W(t)= \bigl(W_{k}(t)\bigr)_{k=1}^{n}. $$

The suitability landscape accounts for the attractivity of the environment (e.g. climate, landscape features) and the availability of resources (e.g. for employing the innovation) in different parts of the domain. The values of V are higher for a less suitable environment, which means that valleys of the suitability landscape correspond to attractive regions and peaks and divides correspond to unsuitable areas that are moreover difficult to surmount. An example is given in Fig. 1. The most natural way to construct the suitability landscape is on the basis of data (see for example Sect. 4.2).

Figure 1
figure 1

An example of a suitability landscape in form of the double well potential \(V(x,y)=(x^{2}-1)^{2}+y^{2}\) is shown here. The heat map colours, ranging from dark blue to yellow, indicate low to high values of the landscape. This landscape is characterized by two attractive areas that are centered at the two local minima and a barrier between them. We consider \(n=35\) agents and the interaction radius \(r=1\). Adopters of the innovation are represented by red dots, whereas non-adopters are shown as yellow dots

The attraction–repulsion potential, on the other hand, drives agents to change their position due to other agents in their vicinity. Attraction between agents occurs when agents at long distances are driven towards another, and repulsion appears when agents are forced apart at short distances (e.g. similar to models in Physics such as [5860]). Thus, intuitively, it is the tendency for agents to find a balance between forming clusters of agents on the one hand and distributing in space on the other hand. In that way communication and exchange with other agents is possible but conflict over resources is avoided. An example of how such a simple system can be constructed and which patterns can be produced is shown in Fig. 1.

2.4 Modeling the spreading of innovations

Given the positional movements of agents in the suitability landscape, we can construct a spatial network between agents that is changing in time, i.e. a time-evolving network [39]. The innovation is then spreading on this time-evolving network which models possible interactions and contacts between agents. The network at time t is constructed in the following way: the set of nodes represents the set of agents, and an edge exists between two nodes if the corresponding agents are close in distance. Thus, the edge set of the network depends on the positions of agents at time t and is defined as

$$E(t) = \bigl\{ \{k,l\}: k,l =1,\dots n, k\neq l, \bigl\Vert X_{k}(t)-X_{l}(t) \bigr\Vert < r\bigr\} , $$

where \(\|\cdot\|\) refers to the Euclidean distance. The edge set can equivalently be given in form of an adjacency matrix \(A(t)\), where \(A_{kl}(t) = 1\) if two agents k and l are closer than some distance r in position space at time t, while \(A_{kl}(t) = 0\) otherwise. The diagonal of \(A(t)\) will be zero as we do not consider self-interactions of agents.

We can then model the spreading process of the innovation on the network as a Markov jump process with time-dependent transition rates, similar to the SI-model that describes epidemic spreading processes [35]. Every agent can only be in one of the two discrete innovation states: 0 (non-adopter) and 1 (adopter of the innovation). In our model, once an agent adopts the innovation, his innovation state becomes 1 for all times, i.e. he can never forget the innovation. Generalizations of this assumption are possible by following for example the SIS- or SIR-modeling approach [20, 35]. We denote by

$$ \mathcal{I}(t) = \bigl\{ k \in\{ 1,\ldots, n\} : I_{k}(t) = 0\bigr\} $$
(3)

the set of agents that have not adopted the innovation until time t. Moreover, each agent can independently influence other agents in their vicinity to adopt the innovationFootnote 1 with a fixed influence rate γ. For each agent k we define the adaption rate \(\lambda_{k}\) at time t by

$$ \lambda_{k}(t) = \sum_{l}A_{kl}(t)I_{l}(t) \bigl(1-I_{k}(t)\bigr)\gamma, $$
(4)

which means that the adaption rate \(\lambda_{k}(t)\) for a non-adopter agent \(k\in\mathcal{I}(t)\) is proportional to the number of its neighbors which are in innovation state 1 at time t,Footnote 2 while for agents that already have adopted the innovation the adaption rate is 0. Since the interaction network and the innovation states change in time, also the adaption rates are time-dependent.

Let \((N_{k}(t))_{t\geq0 }\) be the adaption process counting the number of adaptions for agent k depending on time. In general, the adaption processes can be expressed in terms of Poisson processes, see the Appendix. For the specific rate function defined in (4) the adaption event can happen only once for each agent such that

$$ N_{k}(t)= \textstyle\begin{cases} 0 &\mbox{if } t < \tau_{k}, \\ 1 & \mbox{if } t \geq\tau_{k}, \end{cases} $$
(5)

where \(\tau_{k}\in[0,\infty]\) is the adaption time. The probability for the adaption event to take place before time \(t\in[0,\infty)\) is given by

$$\mathbb{P}(\tau_{k}\leq t) = 1-\exp \biggl(- \int_{0}^{t} \lambda_{k}(s)\,ds \biggr). $$

For agents that know about the innovation from the beginning (i.e. \(I_{k}(0)=1\)) it holds \(\lambda_{k}(t)=0\) for all t, such that \(\tau _{k}=\infty\) almost surely and \(N_{k}(t)=0\) for all t by definition. Therefore, the innovation state of any agent k can be written as

$$I_{k}(t) = I_{k}(0) + N_{k}(t). $$

Combining the jump processes for all agents, we can write for the system innovation state

$$ I(t) = I(0) + \sum_{k} N_{k}(t) v_{k}, $$

with the initial innovation state \(I(0)\in\{0,1\}^{n}\) and the state-change vector \(v_{k} = (v_{k,i})_{i=1}^{n} \in\{0,1\}^{n}\) with \(v_{k,i} = \delta_{ki}\).

2.5 Joint model: movements of the agents and spreading of the innovation

We now combine the two dynamics, the spreading process and the diffusion process, into one equation that describes the complete process \(Y(t)=(I(t), X(t))\). To this end we define the function

$$f\bigl(Y(t)\bigr) = \bigl(0,-\nabla(\tilde{V} + U) \bigl(X(t)\bigr)\bigr) $$

and a Brownian motion

$$B(t) = \bigl(0, W(t)\bigr) $$

for the agent migration. The joint equation for the evolution of the system is then given by

$$ Y(t) = Y(0) + \int_{0}^{t}f\bigl(Y(s)\bigr)\,ds + \int_{0}^{t}\sigma \,dB(s) + \sum _{k}N_{k}(t) \tilde{v}_{k}, $$

where \(\tilde{v}_{k} = (v_{k},0)\).

3 Simulation approaches

In this section we will present a new technique for simulating the introduced ABM, where agents are moving diffusively in a suitability landscape, while interacting with other agents and passing on the innovation. These two processes are coupled: the spreading process of the innovation takes place on the time-evolving network that is given by the positional movements of the agents. Additionally, the diffusion process, which affects the network changes, and the spreading process are evolving on similar time scale orders, which makes an accurate discretization of both processes an essential requirement in order to produce precise results.

Since our model is continuous in time and space we need to find a good approximation scheme that, on the one hand side minimizes the error we make in the simulations and, that is computationally efficient on the other hand. This is essential for real-world models in which we often deal with a large number of agents and due to the stochasticity in the model we need to repeat the simulations many times to get a reasonable prediction for the outcome. For simulating the movements of the agents we will discretize the diffusion process by means of the Euler–Maruyama [40, 41] scheme, see Sect. 3.1. However, in order to simulate the whole system, we need to adapt and combine simulations for the joint process i.e. for the diffusion as well as the spreading process. To this end, in Sect. 3.2 we will present a time-discrete synchronous updating scheme and in Sect. 3.3 we will introduce the new event-based scheme. Last, we will illustrate the simulation approaches on two toy examples in Sects. 3.4 and 3.5.

3.1 Simulating the migration of agents

Movements of the agents can be appropriately simulated by using the well known Euler–Maruyama scheme [40, 41] to discretize Equation (2). Then, in every time step the positions of the agents are updated according to

$$ X(t + \Delta t) = X(t) - \nabla(\tilde{V} + U) \bigl(X(t)\bigr) \Delta t + \sigma \xi\sqrt{\Delta t}, $$
(6)

where ξ is drawn from a standard normal distribution in \(\mathbb {R}^{2n}\). For the Euler–Maruyama scheme to be consistent, the time step Δt needs to be chosen sufficiently small, keeping at the same time the computational cost in the feasible limits. Additionally, because of ξ, every new simulation of the diffusion process will be different from the previous ones and one needs to run sufficiently many Monte Carlo simulations for obtaining reliable results.

In our model, since the interaction network depends on the positions, we will also need to update the interaction network, which influences the spreading process directly. Thus, for simulating the whole system, we need to introduce a joint simulation technique which will take into account properties of both processes.

3.2 Joint simulation: synchronous time-discrete updating

For time-discrete simulations a time step-size Δt has to be chosen and the state of the system can change only at every discrete time step \(t_{m}= m \Delta t\), where the agent movements are calculated from (6).

The time-continuous spreading process, see (5), is then adjusted to discrete time steps, i.e. instead of adaption events happening at certain rates, they happen in each time step with a certain probability. More precisely, the probability for agent k at time \(t_{m}\) to adopt the innovation within the next time interval \([t_{m},t_{m}+\Delta t)\) is set to be

$$p_{k}(t_{m})=1-\exp\bigl(-\lambda_{k}(t_{m}) \Delta t\bigr). $$

Clearly, if \(\lambda_{k}(t_{m})=0\), then this probability is zero. The adaption to time-dependent spreading rates is already included in this discretization. As we are checking the probability of events at every discrete time step, when rates are changing with time, the probabilities will be automatically updated as well.

It is important to note that this simulation scheme gives a good approximation of the true time-continuous and space-continuous process only for Δt approaching zero [45]. However, checking every possible adaption event at every small time step is computationally inefficient, as many events will not happen and will be rejected. On the other hand, for large values of Δt interactions of agents may be missed.

Another byproduct of such time-discrete simulations is that adaption events can happen synchronously, i.e. in the same time step, and the effect of simultaneously happening events on each other is ignored. In time-continuous models this is rarely the case, since agents most likely update their innovation state at different times, and thus immediately affect the other agents’ rates.

In order to circumvent these problems, we will present our new event-based simulation algorithm, which allows for adaption events to happen continuously in time.

3.3 Joint simulation: event-based approach

An efficient approach for simulating time-continuous stochastic processes is by using the Gillespie algorithm [62], also often referred to as the stochastic simulation algorithm (SSA). Time-continuous simulations that are based on the Gillespie algorithm are statistically exact and they can be faster to simulate than time-discrete simulations [45]. This algorithm was originally developed for simulating chemical reactions, and it got generalized for different systems among which is simulating spreading processes on static networks [63, 64].

In the language of innovation spreading, the Gillespie algorithm consists of the following two steps:

  1. (i)

    determining the waiting time τ until the next adaption event,

  2. (ii)

    determining which agent will adopt the innovation next.

The waiting time τ between two events is drawn from an exponential distribution with the total adaption rate \(\Lambda(t) = \sum_{k\in\mathcal{I}(t)} \lambda_{k}(t)\). An agent l is randomly chosen with probability \(\frac{\lambda_{l}(t)}{\Lambda(t)}\) for the adaption event. Following this scheme, the Gillespie algorithm produces a statistically correct evolution of events in continuous time without rejecting some events. In this classical setting, it is assumed that the interaction network itself does not change between events, but that only the states of the agents can change, i.e. the adaption rates are time-dependent but only changing when an adaption happens. More precisely, if the last event happened at time \(t^{*}\), then \(\Lambda(t) = c_{0}\) for \(t\in[t^{*},t^{**})\), where \(t^{**}\) is the time when the next event happens given by \(t^{**} = t^{*}+\tau\), with \(\tau\sim\mbox{Exp}(c_{0})\). Alternatively one can use \(\alpha\sim\mbox{Exp}(1)\) on a normalized timescale and derive τ by solving \(\alpha= \int _{t^{*}}^{t^{**}} \Lambda(t) \,dt\) which here reduces to the simple equation \(\alpha=\tau c_{0} \).

However, in our model the positions of agents are changing continuously in time and so the interaction network is as well. Thus, the adaption rates can change both when adaption events happen, but additionally also in between when the interaction network evolves. The problem then again consists of finding the time \(t^{**}\) of the next event from \(\alpha= \int_{t^{*}}^{t^{**}} \Lambda(t) \,dt\) given \(\alpha\sim\mbox{Exp}(1)\). But for rates that are not constant between the adaption events, the integral equation is more complex to solve. In our algorithm this is done iteratively, as proposed in the Temporal Gillespie approach [42], with parallels also to adaptive simulation methods considered in other fields of research, see e.g. [65].

In order to capture both the diffusion and the spreading processes, our new simulation tool is combining (i) an Euler–Maruyama discretization of the migration process with (ii) a Gillespie algorithm for time-continuous spreading of the innovation, see Fig. 2. More precisely, we choose again a time step size Δt and set the initial time to \(t^{*}=0\), starting the simulation with the initial innovation states given by \(I(0)\). We draw a random number \(\alpha\sim\mbox{Exp}(1)\). Then, until the first adaption event happens, the interaction network and resulting adaption rates are updated every Δt. The first event happens at the first time \(t^{**}\) when the total adaption rate integrates to α. We immediately update the positions of agents at time \(t^{**}\) by (5) and the following network updates are at times \(t^{**} +\Delta t\), \(t^{**} + 2\Delta t\) etc. until another adaption event takes place.

Figure 2
figure 2

Toy example of an innovation spreading among four agents that are changing their positions in the suitability landscape continuously in time. Agents that adopted the innovation are colored in red and non-adopters are shown in yellow. We start with an updated network at time \(t^{*}\) with one agent knowing about the innovation. Then, the interaction network and resulting adaption rates are updated every Δt, until the next adaption event happens at time \(t^{**} = t^{*} + \tau\), i.e. when the total adaption rate integrates to \(\alpha\sim \mbox{Exp}(1)\). The network and rates are updated at time \(t^{**}\). Similarly, between \(t^{**}\) and the next adaption event, fixed updates for the adaption rates and network are done at times \(t^{**} +\Delta t\), \(t^{**} + 2\Delta t\) etc.

The pseudo-code for our joint algorithm then reads as Algorithm 1.

Algorithm 1
figure a

Joint event-based simulation

As discussed above, our joint algorithm builds on the Temporal Gillespie approach [42], but it also allows for network updates in smaller time steps, i.e. directly after a spreading event, taking into account the current situation for the further evolution of the system. This adaption is more accurate for our model, where the network is changing continuously in time, as more network updates are done. Moreover, by the immediate network update after every adaption event, the algorithm is also suitable for systems where the innovation spreading influences the movement of the agents. For example, more connections could be formed with agents who adopted the innovation. Such systems, where both the network and the spreading processes can influence each other, are often seen in real-world examples and they are modeled by the so-called adaptive networks [66].

3.4 Numerical example: single well suitability landscape

For illustration and comparison of the two simulation approaches, we consider a simple model example with \(n=20\) agents moving in a single well given by

$$V(x,y)=10 \bigl(x^{2} +y^{2}\bigr). $$

The landscape contains one minimum at \((0,0)\), which for the agents corresponds to the most attractive point of the suitability landscape. For simplicity the attraction–repulsion potential is neglected, i.e. \(U_{k}=0\) for all agents k. The diffusion process will then result in the agents’ positions to be clustered around the minimum. In order to study the spreading of an innovation among the agents, one randomly chosen agent receives the innovation at time \(t=0\). With rate \(\gamma= 10\) the innovation spreads to other agents along the edges of the time-evolving contact network.

Next, we compare the two joint simulation approaches, i.e. the synchronous updating and the event-based simulation. Due to the stochastic nature of our model, we need to simulate repeatedly in order to give meaningful statements, here we average over 2000 realizations. By varying the Δt for the Euler–Maruyama time steps, we are also changing the fixed time intervals at which the network is updated. In this example, the network needs to be updated at least every \(\Delta t=0.002\), in order to obtain a reasonable approximation of the agents’ movement and the resulting time-evolving network. Given the time-evolving network, for any Δt, the event-based simulation approach provides statistically exact event times, whereas the synchronous updating scheme is a good approximation of the spreading process only for small Δt [45]. Thus, in order to compare the two combined approaches, we use the synchronous updating scheme with \(\Delta t = 0.0001\) as a benchmark. From the plot in Fig. 3, one can see that the event-based simulation with \(\Delta t=0.002\) indeed agrees with our benchmark. The synchronous updating for larger time steps \(\Delta t=0.002\) deviates from the benchmark and on average the spreading is slower.

Figure 3
figure 3

We consider the coupled process for 20 agents in a single well suitability landscape given by \(V(x,y)=10 (x^{2} +y^{2})\) with spreading rate \(\gamma = 10\). As an initial condition at \(t=0\) one randomly chosen agent is in state 1. For an ensemble of 2000 realizations, we plot the mean proportion of adopters of the innovation depending on time and compare the results for the synchronous updating scheme (for \(\Delta t = 0.0001\) and \(\Delta t = 0.002\)) as well as for the event-based simulation scheme (for \(\Delta t = 0.002\)). The synchronous updating simulation with larger time steps is deviating from the simulation with the small time step size, while the event based simulation is still accurate even for \(\Delta t = 0.002\)

In this example case, we have confirmed that the event-based approach is more accurate than the synchronous updating scheme for the same step-size, but also in other cases this holds [42, 45] due to the immediate response of the simulation algorithm to adaption events in the event-based approach. Besides the accuracy of the event-based scheme, we can also consider computational costs. In general, the simulation time for the discretization of the diffusion process is the same for both simulation approaches as long as the same time step sizes are chosen. However, if we consider the network updates as given, then the simulation time for the event-based simulation of the spreading process has been shown to be a few orders of magnitude faster than for the synchronous updating scheme [42]. Especially in the case of large systems with many agents and in the case of sparse connections between agents, the computational gain is high. This is also the regime in which our real world example in Sect. 4 is given.

3.5 Numerical example: double well suitability landscape

To give a second example for illustration of the interesting dynamical patterns, we are considering again the suitability landscape, shown in Fig. 1, given by

$$ V(x,y)=\bigl(x^{2}-1\bigr)^{2}+y^{2}. $$

This landscape consists of two attractive areas that are centered around the two local minima \((-1,0)\) and \((1,0)\) and a barrier between them. The agent diffusion process in this landscape exhibits a metastable behavior, i.e. agents stay for a long time near the center of one of the wells, while rarely transitioning to the other well.

Equipped with this suitability landscape, we can study a system of \(n=30\) agents that spread the innovation with rate \(\gamma=10\) when getting closer than \(r=1\). For simplicity the attraction–repulsion potential is neglected. As an initial condition at time \(t=0\), one randomly chosen agent will receive the innovation, while all other agents are in innovation state 0. As simulation time advances, more and more agents will adopt the innovation, see Fig. 4 for several temporal snapshots of the coupled process. Agents are attracted to the centers of the two wells and thus their positions will be clustered near the two wells. Connections between agents will mostly exist for agents in the same well. Therefore the spreading of the innovation inside the well of the initial adopter will be fast, since mixing of the agents inside the wells happens on a small timescale. The transition of an agent from one well to the other is a rare event with an exponential waiting time on a larger timescale, so the spreading of the innovation between wells will be slower. Thus, the metastability of the diffusion process induces a metastability in the spreading process, where the system stays for a long time in the state that all agents in one well have adopted the innovation while there are no adopters in the other well. In total, the innovation will take much longer to spread to all agents compared to the single well example.

Figure 4
figure 4

We are considering a model example with \(n=30\) agents, where the suitability landscape is given by the double well potential \(V(x,y)=(x^{2}-1)^{2}+y^{2}\) and the interaction radius is \(r=1\). In the first row, temporal snapshots of one realization of the process highlight its metastability. Due to the fast mixing in the well of the initial adopter, the innovation spreads quickly in the first well. In contrast, the transitioning between the two wells is a rare event, resulting in a large time gap for the innovation to spread from one well to the other. Then again, when the innovation has reached the second well, it will spread fast. The metastability of the spreading process is also confirmed in the plot of the evolution of the proportion of adopters. The 50 realizations (plotted in gray) out of an ensemble of 2000 simulations with the event-based approach for \(\Delta t=0.002\) show the fast spreading inside the wells and the exponential waiting time for the innovation to jump from one well to another

This example landscape is very simple compared to the real-world example in Sect. 4 which has a suitability landscape that contains many wells and barriers, but the metastable behavior of fast spreading inside attractive areas and slow spreading between areas also applies there.

4 Data-driven modeling and simulation: spreading of wool-bearing sheep

We will now apply our ABM framework and simulation tools proposed in the previous section on a real-world example. In particular we will model the spreading of the wool-bearing sheep (as an innovation) among groups of herders (represented by agents) in the ancient world. Between 6200 BC and 3000 BC, the wool-bearing sheep appeared and spread in the area spanned from the Zagros Mountains in the south-east to the Carpathian Basin in the north-west. Prior to the appearance of the wool-bearing sheep, herders were already keeping other domestic animals, among them the hairy sheep [67]. The exact spreading path of the wool-bearing sheep is a question of interest in the archaeological research community [47, 68]. Here, we will make the assumption that the origin of the wool-bearing sheep in 6200 BC is Tell Sabi Abyad [69] and use forward-modeling to infer possible spreading scenarios. People at that time had a nomadic life-style and it has been shown that migration and technological change were strongly related [46]. Therefore, it is a reasonable approach to model the spreading of the innovation via migration and exchange between herders.

4.1 Data sources

Archaeological data from ancient times is sparse, uncertain and indirect [31]. In this example, the archaeological data provides information on sheep herding during prehistoric times, but unfortunately direct evidences of the wool-bearing sheep are missing and indirect evidences are limited to certain parts of the study area and to restricted time periods. Therefore, instead of fitting our model to limited and uncertain data available, we will use modern-day environmental data to construct the suitability landscape which will reflect how suitable an area is for herding the wool-bearing sheep.

The environmental data consists of: (1) elevation data derived from the Shuttle Radar Topography Mission with resolution 500 m × 500 m (SRTM 500) [70], (2) topographic compound index (TCI) [71], (3) terrestrial landforms [72, 73] and (4) data on the soil texture [74], see Fig. 5(a)–(d). The TCI represents the tendency of water to accumulate at any point in the catchment and the tendency for gravitational forces to move the water downslope. These factors influence the suitability of an area for grazing sheep and thus will be used to construct the mobility model. The environmental data covers the whole area of interest with a resolution of 500 m × 500 m and is constant for the simulated time period.

Figure 5
figure 5

For each of the environmental factors discussed in Sect. 4, the Figures (a)–(d) show the suitability of the geographical areas for herding the wool-bearing sheep, i.e. yellow color corresponds to very suitable areas and blue tones to less suitable areas. In Figure (e) the suitability landscape for the innovation spreading of the wool-bearing sheep is plotted, the landscape is constructed by combining influences from different types of environmental data (a)–(d). The assumed origin of the woolly sheep Tell Sabi Abyad is marked by a red circle

4.2 Constructing the mobility model

The mobility model consists of two components: the suitability landscape and the attraction–repulsion potential.

The suitability landscape V encodes the attractiveness of each point in space for an agent to herd sheep. Available environmental data accounts for the four main environmental factors that influence sheep-keeping: (1) elevation, (2) water availability (TCI), (3) different geomorphological landforms (such as ridges, flat plains) and (4) soil texture [36, 75]. We construct the suitability landscape V (see Fig. 5) by using an evaluation of the suitability \(S_{i}: \mathbb {R}\rightarrow \mathbb {R}\) for keeping sheep depending on each factor \(f_{i}:D \rightarrow \mathbb {R}\), \(i=1,\ldots, 4\), at each point in our domain \((x,y)\in D\) and summing them up to get

$$V: D \rightarrow \mathbb {R}\quad \text{by } (x,y) \mapsto\sum_{i} S_{i}\bigl(f_{i}(x,y)\bigr). $$

The suitability functions \(S_{i}\) are chosen such that higher values correspond to less suitable conditions, so for increasing values of \(V(x,y)\), the suitability decreases. The gradient of V, which is needed for the Euler–Maruyama discretization, is estimated by a first order finite difference approximation.

Another way to construct the suitability landscape is considered in [36]. Additionally, if the environmental factors are changing in time or their suitability changes in time (for example seasonally [75]), then one can consider a time-evolving suitability landscape \(V(t,x,y)\) instead.

In order to model the positional interactions between agents we use a potential similar to interatomic potentials between atoms and molecules. The attraction–repulsion potential for agent k is of the form

$$ U_{k}\bigl(X(t)\bigr)=\sum_{j=1, j \neq k}^{n}-C_{A} \exp \biggl(-\frac{\lVert X_{k}(t)-X_{j}(t) \rVert}{l_{A}} \biggr) + C_{R} \exp \biggl(- \frac{\lVert X_{k}(t)-X_{j}(t) \rVert}{l_{R}} \biggr), $$

where \(C_{A}\) is the attraction potential constant, \(C_{R}\) is the repulsion potential constant and \(l_{A}\), \(l_{R}\) are the respective decay rate constants [58]. The constants are chosen such that \(C_{R}>C_{A}>0\) and \(l_{A}>l_{R}>0\), which leads to the repulsion dominating at short ranges while the attraction is the dominating term when the distance between two agents is larger.

4.3 Simulation details

We construct the suitability landscape and the attraction–repulsion potential as described in the previous section. For the construction of the suitability functions \(S_{i}\) we assume all influences to be equally important and the suitability evaluations of the different environmental factors are based on [75]. We choose the attraction and repulsion constants \(C_{A}=20\), \(C_{R}=20.5\) and decay rate constants \(l_{A}=1.5\) and \(l_{R}=1\), such that the optimal distance between two agents is 650 m.

For the joint simulation of the spreading of the woolly sheep we use the event-based Algorithm 1, which produces accurate realizations of the agent diffusion and the innovation spreading process. The time step size \(\Delta t=\frac{1}{365}\) is chosen such that one time step represents one simulated day. The suitability landscape and the random noise are scaled such that the average distance an agent is moving in a time step is 1 km. Since an agent represents a small group of 10–30 people, the position change of an agent can be understood as changing the location of the camp of the group or as the daily activities. We set the interaction distance between two agents to \(r=10\) km and the spreading rate to \(\gamma=8\). The number of agents is set to be \(n=4000\), which corresponds to a population of \(40\mbox{,}000\) to \(100\mbox{,}000\) herders. Not much is known about the population density between 6000 BC to 3000 BC, but simulations suggest [76] that the population density in today’s Greece was 2–5 people per square kilometer during that time period, therefore the chosen number of herders seems reasonable.

Since the suitability landscape is not given in terms of an analytical function, the initial distribution of the agents is achieved by starting with a uniform distribution of agents and letting the dynamics run for 400 simulation years in order to approximate the equilibrium distribution. The initial innovation state of all agents is 0, except for agents with a position in a 125 km radius of the assumed origin of the woolly sheep at Tell Sabi Abyad in northern Syria [69], who start with innovation state 1. Since it is assumed that the spreading of the woolly sheep started around 6200 BC, this will also be the starting time of our simulation. We stop the simulation when 95% of agents have adopted the innovation, which in our example simulation is the case after 3200 simulation years at 3000 BC. The reason for this criterion is that our domain contains many islands and the modeling approach does not consider sea travel, thus agents that are on the island will never get in contact with the innovation and therefore we will never reach 100% of agents in state 1.

4.4 Analysis and simulation results

We run the simulation using the settings from Sect. 4.3. At the beginning of the simulation at 6200 simulated BC, see Fig. 6(a), the spreading is very fast since the agents are mixing well in the regions close to the origin. The spreading slows down around 6000 simulated BC, as soon as all agents in the suitable areas around the origin have fully adopted the innovation. The reason is that, at this point an agent has to make a transition via an unsuitable area to interact with other agents that are not yet adopters. This behavior of the innovation process, where the innovation is stuck for a very long time in one suitable area before it quickly enters another suitable area where it spreads fast, is called metastability. As we discussed above, in this example, metastability of the spreading process is caused directly by the metastability of the human mobility process. Metastability of the adaption process can be seen in Fig. 6(b), which plots the change of the proportion of adopters in time. We see that whenever a rare transition happens, the number of adopters rapidly increases. After the innovation has fully spread in a new region, the adaption speed slows down and the system is again in a metastable state. This pattern continues until the innovation of the wool-bearing sheep has spread among 95% of agents.

Figure 6
figure 6

(a) Snapshot of one realization of the wool-bearing sheep innovation spreading, where blue dots indicate agents that have not adopted the innovation and red dots give agents that have adopted the innovation. (b) Proportion of adopters over time, indicating metastability of the innovation process is presented. (c) The first hitting times of the 23 landscape regions for the example simulation

Next, we study how properties of different geographical regions influence human mobility and human interactions over time. To this end, we consider a partition of our domain into 23 major landscape units [36]. For each of these 23 regions we can measure the first arrival time of the innovation, i.e. the first time an agent with innovation state 1 enters the region, see Fig. 6(c). From the color-scheme of the plot one can deduce the spreading path resulting from our simulation: starting from red, the darker the color becomes the further away the innovation is from the origin, blue being the furthest point. Additionally, this figure reflects the rare transition between the two main metastable sets Asia (in red tones) and Europe (in blue tones), i.e. the intercontinental transition through the Bosporus around 5200 simulated BC in the example simulation.

Our model shows how the metastability of the spreading process reflects the metastability of the human mobility process. This is achieved by evaluating the area of interest and finding the most attractive regions to adopt and use the innovation. The largest limitation of the spreading process is then the human mobility process which is biased towards attractive parts of the domain given by the suitability landscape.

Here we have presented one realization of the modeled spreading process and it has been shown [36] that even though every realization of the modeled process (with the same parameters) is slightly different due to stochasticity, the overall emergent spreading path is the same. Nonetheless, our model is not intended to reproduce the true prehistorical spreading process in all details, but the simulated spreading path can lead to a better understanding of how different factors might have influenced the prehistorical spreading path. The speed of the simulated innovation spreading gives insights into model components that might have accelerated the prehistorical spreading process. In order to understand the model factors, we will discuss the sensitivity of the model to its key parameters by looking at the global trend in the outcome of a number of independent simulations.

Increasing the innovation influence rate γ doesn’t affect the spreading path but accelerates the speed of innovation spreading [36], small changes in γ lead to small changes in the spreading speed. Similarly, increasing the number of agents n will accelerate the innovation spreading into different regions since the exit events from the metastable regions will be more frequent. If the interaction distance r between agents is chosen in a reasonable range, i.e. large enough such that agents can sometimes interact, and small enough such that agents cannot interact over barriers of the suitability landscape, the model is robust to this distance r and small variations in the interaction distance only lead to small changes in the speed of the simulated process. The suitability landscape is the most important influence for the migration of agents and thus for a different suitability landscape, both the speed and spreading path will change.

In summary, small perturbations of our model parameters do not change considerably the trend of the global emergent spreading path. However, changes in the metastability of human migration can lead to big changes in the spreading dynamics. The main reason for this is that the innovation spreading process is strongly governed by the human mobility.

4.5 Interpretation in the historical context

One could speculate whether or not the true prehistorical spreading path is correlated with the outcome of our simulation. The main reason we can not validate our model is that available archaeological data is very sparse and obscure. This data consists of ovicaprid bone findings from 401 sparsely distributed archaeological sites and spindle whorls from 23 sites located only in Panonian basin [77, 78]. Moreover, the ovicaprid bone data provides only an evidence for sheep (Ovis from scientific Latin) and goats (Capra from scientific Latin) in general, but does not confirm the presence of wool-bearing sheep in particular. Finally, here we can not generate new data to reproduce the true dynamics in order to validate our results. For all these reasons a model validation in the common sense of natural science appears impossible to us. The simulated spreading path can be understood as a spreading path hypothesis which has to be discussed and evaluated with the help of additional expert knowledge. For a discussion of the simulated spreading process of the wool-bearing sheep, we refer the interested reader to [75].

5 Conclusions and future outlook

In this paper we presented a general framework for modeling the spreading of an innovation among human individuals in prehistoric times. We introduced an agent-based model which combines the spatial movement of individuals with a time-evolving network for possible social interactions. Our model considers data-driven dynamics of human movements, i.e. available data is used for building a suitability landscape which governs the diffusion of individuals. The innovation spreading between individuals that are close in distance is modeled by a spatial network that is changing in time, as people are changing their positions. Additionally, a novel simulation algorithm has been proposed, allowing for network updates at flexible time points that are adjusted to the random times of the innovation adaption events. This simulation approach accounts for a faster and more accurate simulation of the spreading process than synchronous time-discrete updating schemes that are usually considered. Especially for settings where the spreading dynamics affect the spatial movement, the accuracy of our simulation approach is increased by this adjustment.

We applied our modeling and simulation approaches to the spreading of the wool-bearing sheep among herders in the south-west Asia and central Europe between 6200 BC and 3000 BC. At this stage it is important to note that, given the complexity of the observed system and very limited available data, we do not claim that our methods can reproduce the exact historical spreading process itself. In this application, our methods can be used to study how different influences can affect the migration and spreading process. In a broader sense, this paper offers a generalized technique for modeling and simulation of spreading processes in the ancient world that are coupled to human migration.

Several extensions of our modeling framework would be interesting to consider in future investigations. For example, one could include competing innovations or consider different type of spreading processes where the adaption process is reversible, such that adopters of the innovation can become non-adopters again or loose interest in the innovation with some fixed rate (SIS or SIR model respectively). The diffusion dynamics could be generalized by considering time-evolving suitability landscapes, where external factors affect the change of the landscape, e.g. seasonal changes or climate influences [28]. Recent publications include extensive research on using genomic data for inferring human migration patterns in ancient times [29, 79]. Such an extensive data-set could be used for comparison and further calibration of the model.

Furthermore, we believe that in some cases taking into account different dynamical properties of the spreading process could be of interest for reducing the model complexity. More precisely, in our real-world example we have observed metastability induced by the fast spreading dynamics between agents located in the same well of the suitability landscape and very slow spreading dynamics between agents located in different wells. This suggests further coarse-graining of the system by splitting the domain into metastable areas within which agents are assumed to quickly mix, such that detailed spatial information becomes redundant. Combining the well-mixed spreading dynamics within the metastable areas with diffusive transitions between them leads to a description by a spatio-temporal master equation, a coarse-grained model for the effective dynamics which is shown to be more efficient to simulate in other applications [80]. Developing this idea for systems of our interest needs further investigation and will be the topic of future research.