Bulletin of Mathematical Biology

, Volume 75, Issue 7, pp 1181–1206

Time Delay Implies Cost on Task Switching: A Model to Investigate the Efficiency of Task Partitioning


    • Department of Computer ScienceUniversity of Paderborn
  • Istvan Karsai
    • Department of Biological SciencesEast Tennessee State University
  • Thomas Schmickl
    • Artificial Life Laboratory of the Department of ZoologyKarl-Franzens University Graz
Original Article

DOI: 10.1007/s11538-013-9851-4

Cite this article as:
Hamann, H., Karsai, I. & Schmickl, T. Bull Math Biol (2013) 75: 1181. doi:10.1007/s11538-013-9851-4


Task allocation, and task switching have an important effect on the efficiency of distributed, locally controlled systems such as social insect colonies. Both efficiency and workload distribution are global features of the system which are not directly accessible to workers and can only be sampled locally by an individual in a distributed system. To investigate how the cost of task switching affects global performance we use social wasp societies as a metaphor to construct a simple model system with four interconnected tasks. Our goal is not the accurate description of the behavior of a given species, but to seek general conclusions on the effect of noise and time delay on a behavior that is partitioned into subtasks. In our model a nest structure needs to be constructed by the cooperation of individuals that carry out different tasks: builders, pulp and water foragers, and individuals storing water. We report a simulation study based on a model using delay-differential equations to analyze the trade-off between task switching costs and keeping a high degree of adaptivity in a dynamic, noisy environment. Combining the methods of time-delayed equations and stochastic processes we are able to represent the influence of swarm size and task switching sensitivity. We find that the system is stable for reasonable choices of parameters but shows oscillations for extreme choices of parameters and we find that the system is resilient to perturbations. We identify a trade-off between reaching equilibria of high performance and having short transients.


Task partitioningTask switchingTime-delay modelSocial cropCommon stomach

1 Introduction

Parallel processing is ubiquitous in insect societies where many individuals carry out the work, which is also frequently done by different specialists (Hölldobler and Wilson 2008; Seeley 1982). One of the most complex types of organization of labor is called task partitioning when the given task is partitioned into subtasks that are connected strongly and frequently sequentially. One of the best examples of this arrangement is the bucket brigade, where the material (water) is passed from the collector to the user via transporters (Anderson et al. 2002). The assignments of individuals to different subtasks can be dynamic. Dynamic assignments pose the decision problem of task switching (Sinha et al. 2006). These decisions support a computationally hard problem (NP-hard and not even easily approximable, see de Weerdt et al. 2007) and are either done by a central task allocation agent (foreman) or in case of a distributed approach by the individual worker itself (de Weerdt et al. 2007).

Social animals and especially social insects often face problems of task partitioning, task allocation, and task switching (Gordon 1996; Ratnieks and Anderson 1999). This includes a large set of problems such as finding the optimal task allocation, decisions whether specialization for the given number of individuals is useful, and how to react to temporal changes (e.g., noise). In this paper we investigate these problems via a model inspired by a natural system in which task allocation is based on individual decisions. The insect society can be viewed as a multi-agent system. Each agent has only a local perception and only local information about the overall situation. Colony-level performance arises from individual-based decision making which is based on partial information (Hirsh and Gordon 2001; Schmickl and Crailsheim 2004, 2008, Thenius et al. 2008). Task partitioning is, for example, an old challenge not only in computational distributed systems (Bannister and Trivedi 1983; Klügl et al. 2003), but also in robot groups (Gerkey and Matarić 2004; Lemaire et al. 2004) and in the RoboCup rescue scenario (Nair et al. 2002), and of course in social insects (Deneubourg and Goss 1989; Seeley et al. 1991).

Delay differential equations (DDE) are commonly used tools to investigate nonlinear dynamics with delayed terms (Kuang 1993). They are the model of choice whenever causes have delayed effects as, for example, in epidemiology or control engineering. In control engineering there is a delay between the measurement of the controlled system and the input of a control value into the system, therefore control theory can be used as a metaphor for the functioning of workers in insect societies. A single individual takes a rough sampling of the actual global measure on which it decides its actions. The summary of all local decisions defines the global controller in a collective decision process (Hamann et al. 2012, 2010).

We can extend this control-theory metaphor to the influence of noisy measurements which necessitate the application of alternative control strategies, such as robust or stochastic control. In biological systems control techniques are often based on low quality measurements because such low performance measurement systems seem to be less expensive. In addition, the measurements are local because many biological systems have a decentralized configuration. The improvement of measuring processes comes with costs. One possibility is to take longer measurements which decreases the time spent on productive tasks. Another possibility is to increase the number of measurements by increasing the swarm size. Increasing the swarm size implies costs as additional investment or energy is needed to produce new individuals. However, each additional worker, in turn, could acquire some additional energy by foraging as well. This big-swarm/low-noise assumption is built into our model.

1.1 Biological Background

Swarm founding wasps, such as Metapolybia mesoamerica, provide an excellent model to investigate task partitioning and the regulation of colony level performance through individual decisions. These societies generally comprise a few hundred wasps (including the larvae) and the workers of the society carry out brood care, nest building, nest maintenance, foraging, and defense (Jeanne 1986; Karsai and Wenzel 2000). The organization of work is distributed (Karsai and Wenzel 1998). These adjustments and the regulation of work are achieved by self-organizing mechanisms based on simple rules and interactions between the individuals.

The center of a wasp society’s social life is the nest which is made of paper material. The nest is built by the builders using pulp that is collected by a second group of wasps: pulp foragers. These pulp foragers require water, which is collected by a third group of wasps: the water foragers. After pulp foragers receive water at the nest, they fly out, collect cellulose plant materials, and process them into pulp (Jeanne 1986; Karsai and Wenzel 2000). These specialists are recruited from a fourth group of wasps: the general population of workers, called free labor (Fig. 1). The four worker groups (builders, pulp foragers, water foragers and free labor) have to be balanced for a steady and efficient construction process. If one of the forager groups is underrepresented, the whole building process will slow down (Anderson and Ratnieks 1999a, 1999b, 2000). On the other hand if a lot of wasps belong to one of the worker groups, then these wasps need to wait a long time to accomplish their work (Jeanne 1996; Karsai and Wenzel 2000). For example, if there is a large number of pulp foragers they will wait for a long time to receive water. This will slow down the construction although there is large number of wasps that could process building materials.
Fig. 1

Overview of different tasks in the system including the transition states of the model. P: Pulp forager; W: water forager; L: free labor; B: builder individual. Light gray arrows show the flow of water, dark gray arrows show the transport of pulp, black arrows indicate the foragers’ source. The ‘job change transitions’-box indicates individuals that are in job changing transitions

Field studies and preliminary models showed that this regulation is based on an information center (Seeley 1985) which is the fill level of the common stomach (Karsai and Wenzel 2000; Karsai and Balazsi 2002; Karsai and Runciman 2009). This common stomach emerges from interactions between inactive wasps and water foragers to store water temporarily. Water is essential for the pulp foragers, but it cannot be stored in the nest, because it would either evaporate or destroy the paper nest. The water collected by water foragers is downloaded to the inactive wasps sitting on the nest and these water receivers store it in their crops. Typically one water forager visits several of these wasps and gives them water until it has distributed it completely. Then it will fly out to the water source again. The common stomach is formed by the total volume of all crops of these water-store wasps. These wasps are visited by the pulp foragers and they give water to the pulp foragers. Direct interaction between water foragers and pulp foragers is very rare; they interact indirectly through the common stomach (Karsai and Wenzel 2000).

Studies on swarm founding wasps showed that the waiting time to accomplish a job affects the decision to switch jobs (Jeanne 1986, 1996; Karsai and Wenzel 2000). Long waiting while interacting with the common stomach indicates that the wasps pursue a job that is in low demand, therefore a job switch would be beneficial for the colony. These cues are linked through the common stomach that is used as an information center. If water quantity is low in the common stomach, then downloading the water is easy and happens without delay because the receiver wasp is eager to receive a large quantity of water. This ease of downloading indicates to the water forager that her job is in high demand and she will continue her work as a water forager. On the other hand, receiving water from the common stomach for the pulp forager becomes difficult when the common stomach is almost empty indicating low demand for pulp foragers or a bottleneck in the water supply. Thus changing job for the pulp forager could be beneficial for the colony.

The ultimate goal of the natural swarm is to accomplish a steady and speedy construction with the current workforce. This means that the colony needs to keep the ‘right’ number of individuals in each task to avoid bottlenecks. If the environment or the colony demand changes, the swarm should adapt itself by adequate task switching. The simplest and ad-hoc approach would be to allow arbitrary switching. Individual behavior flexibility exists in swarm founding wasps, but the individuals are not generalists (Karsai and Wenzel 1998). Hence, task switching implies some costs. For example, an individual that has collected water for several round trips prior to the task switch, has become efficient and learned where to collect and where to distribute water. After the task change, the wasp needs to adapt to different sets of stimuli. For example, a wasp that abandons the water foraging task might do an empty flight before starting to forage for pulp (Karsai and Wenzel 2000). Similarly task switching wasps need to learn the position of water and pulp sources which are often in different positions. To account for the switching costs we combined these as an extra time cost that needs to be payed by individuals that switch tasks. We assume that during this transition time the individual is unproductive (reset period). This allows for an investigation of the trade-off between quick adaptation to changes by frequent switches, and the cost of these switches to colony performance. In the following we report a model that incorporates these time delays in switching and analyze how this trade-off in task switching rates is addressed in a swarm.

In this paper our goal is to demonstrate how the quantity of water in the common stomach can regulate colony level work flow and reduce costs by task switching. While this paper is based on the field study of Karsai and Wenzel (2000), we have made some generalization to derive more general conclusions on this material-driven, balanced system. Karsai and Balazsi (2002) and Karsai and Schmickl (2011) have built model systems that imitated the behavior of Metapolybia wasps well and they compared the predictions of their model to field data. Our goal in this paper is different, namely we address new and more general questions with this model, and therefore a new model was developed that is, in particular, different from the previous one in including: (a) time delays as a cost to change jobs; (b) stochasticity that affect both decisions of job switching and reading the accurate value of the common stomach.

We are going to use the model to explore the possible effects on colony fitness of task partitioning, noise and time delays due to transitions between tasks. This is achieved without assuming any individual adaptation (such as adapting behavioral thresholds) and without assuming any individual differences between workers within the model.

1.2 Summary of Main Results

We are interested in studying the predictions of the model that we obtain by numerical methods, and we specifically demonstrate the following results.

For reasonable choices of parameters an equilibrium emerges which is robust and reflects the parametrization. For example, if the water consumption is increased then the system reaches an equilibrium with a swarm fraction of water foragers that is accordingly higher than that of pulp foragers. We assume that the strong negative feedback that drives the system towards equilibrium relies on an information center: the common stomach (Karsai and Runciman 2009; Karsai and Schmickl 2011).


For extreme choices of parameters the system converges to permanent oscillatory behavior (also known as a periodic attractor) in the absence of noise.


The system is resilient to perturbations. Removing components of the system is followed by a quick reallocation of workforce and reestablishing the equilibrium that ensure steady construction.


In the case of noise-free systems, high efficiency (i.e., high swarm fractions in productive states of water foragers W, pulp foragers P, and builders B) is reached by low task-switch rates.

R5—medium noise:

In noisy systems (comparable to small swarm sizes in nature) high task switch rates result in high efficiency. However, the efficiency is lower than in noise-free systems and the transients (i.e., time until the equilibrium is reached) is longer than in noise-free situations.

R6—high noise:

Low task switch rates result in higher performance in the case of very noisy systems.


In both noisy and noise-free systems there is a trade-off between reaching high performance and having short transients because low task-switch rates result in high performance equilibria but long transients. Whereas high task-switch rates result in equilibria of lower performance but with shorter transients.

R8—colony size:

Based on the assumption that noise in the system corresponds to the swarm size, the system shows a breakdown for high-noise situations reflecting that task partitioning is inefficient in small swarms. Accordingly task switching is more efficient in bigger swarms.

2 Model

The model is defined as a system of time-delayed differential equations. There are basically five system variables: common stomach S, water foragers W, pulp foragers P, builders B, and free labor L (see Figs. 1 and 2 for overviews). They are extended by six transition state variables: TLW wasps changing from free labor to water foraging, TLP wasps changing from free labor to pulp foraging, TLB wasps changing from free labor to building, TWL wasps changing from water foraging to free labor, TPL wasps changing from pulp foraging to free labor, TBL wasps changing from building to free labor. By these transition states we model the time delays of task switching. An individual wasp while switching tasks is kept in the corresponding transition state for a duration τ giving the time cost of a task switch. Hence, the number of wasps in these states is an estimate of the degree of task switching. We assume that all transitions are operated via the free labor group L, that is, there are no transitions from water foragers directly to pulp foraging etc. This is a modeling decision which is our compromise for the trade-off between accuracy and model complexity. The introduction of the remaining transitions would increase the number of system variables by another six and observations show that these transitions are very rare in nature (Karsai and Wenzel 2000).
Fig. 2

State transition diagram for the four main states (L, W, B, P) and the six transition states (TLW, TWL, TLB, TBL, TLP, TPL) indicating also the transitions that have time delays as cost imposed on switching. Note that there are three time delays associated with recruitment (τLP, τLW, τLB, cf. Eqs. (6), (9), (12), (14), (15), (16)) and three time delays associated with abandonment (τPL, τWL, τBL, cf. Eqs. (13), (17), (18), (19))

2.1 Common Stomach

Pulp and water are essential building materials of nest construction. While pulp cannot be stored, because it quickly dries out, water is stored in the colony within the crops of non-forager wasps. In this model only the free labor wasps L store water and hence constitute the common stomach. Each wasp has a crop that can hold a maximum quantity of water smax. Therefore N wasps have the capacity to store a quantity Nsmax of water. The water is used at colony level, so the water is stored in a common stomach or social crop where water is taken from or added to via the pairwise interactions of individuals. Naturally the total water in the common stomach is ∑isi, because wasps store different quantities of water si. Therefore the fill level of the common stomach is \(S=\frac{1}{N}\sum_{i} (s_{i}/s_{\max})\). In this model, we simplify this situation by assuming that the water is always equally distributed exclusively among the free labor wasps L, that is, we assume ∀i,t:S(t)=si(t).

The common stomach is defined on the interval S∈[0,1] and modeled by
describing the change of water in the common stomach by the amount of water added by water foragers, consumed by pulp foragers and due to random fluctuations. We call parameter win the water intake that defines the amount of water contributed by one water forager per time as a fraction of one wasp crop (see Table 1). That is, the unloading process of the water added to the common stomach is modeled as a continuous process over time. Say we set win=0.02 and for simplicity L(t)≈1, a water forager will unload an amount of water that compares to 2 % of wasp crop volume per time. Note that we divide win by L(t) which scales the dynamics of the common stomach with the number of free labor wasps that constitute the common stomach. If there are many free labor wasps it needs more water to fill the common stomach and if there are few the common stomach is easily filled. Parameter wout is called water extraction parameter that defines the amount of water taken by one pulp forager per time in percentage of one wasp crop. L is the free labor swarm fraction, W the water forager swarm fraction, P the pulp forager swarm fraction, and ξS is a noise term that models fluctuations in the common stomach. ξS is a stochastic process modeled as white noise distributed as ξSnX with standard normally distributed \(X \sim \mathcal{N}(\mu=0, \sigma^{2}=1)\) and noise intensity n. Different noise settings are achieved by varying only this noise intensity n in the following experiments.
Table 1

List of all parameters






water intake, amount of water contributed by one water forager per time in percentage of one wasp crop, controls increase of common stomach S



water extraction, amount of water taken by one pulp forager per time in percentage of one wasp crop, controls decrease of common stomach S



master parameter setting all task switch rates φ=rW=aW=rP=aP=rB/3=aB/3



task switch rate for recruitment of water foragers W out of free labor L



task switch rate for abandonment of water foragers W



task switch rate for recruitment of pulp foragers P out of free labor L



task switch rate for abandonment of pulp foragers P



task switch rate for recruitment of builders B out of free labor L



task switch rate for abandonment of builders B



parameter for non-linearity function θ(x)



‘desired’ m-fold number of builders compared to pulp foragers



noise intensity



time needed to switch tasks, set to the same value for all τ=τWL=τLW=τPL=τLP=⋯

The choice of the parameters as given in Table 1 is not strictly based on the natural system of wasps, but mostly determined by logical reasoning. Concerning the water intake and water extraction parameters win and wout, respectively, different values (winwout) were chosen because otherwise it would lead to uninteresting, mostly homogeneous equilibria with L=P=W (equal swarm fractions of free labor, pulp foragers, and water foragers). The actual value of these parameters is, however, arbitrary and one of our goals was to relax narrow parameter ranges observed in natural colonies and to investigate a more general picture of the main regulation mechanism. For example, scaling these parameters up or down results in predictable changes that scale in time and in the amplitude of the transient oscillations.

The water that is carried by task changing wasps is not explicitly addressed in the model. Under the assumption of equally distributed water, the extraction of water from the common stomach through ‘free-labor-to-X’ transitions is modeled in agreement with the natural system because the relative fill level of the common stomach stays constant while the free labor fraction decreases. The addition of water to the common stomach by ‘X-to-free-labor’ transitions is simplified compared to the natural system because we assume that those wasps’ crop fill level is equal to that of the common stomach. As we are modeling swarm fractions the following conservation law has to hold true:

2.2 Switching of Tasks and Time-Delays

Time-delays are introduced to model a cost (payed in time) of switching between tasks. This is done by keeping wasps that switch tasks in transition states (i.e., delaying the transition) before they are added to the group of their new task. Wasps that are recruited for task X will at first switch to transition state TLX (see equations below). They stay in this state until the typical waiting time for this kind of switch has elapsed.

In order to give an overview of the model’s general concept we anticipate the below equations and study the flow of wasp fractions using the example of water foragers that switch to free labor (see also Fig. 2). The fraction of wasps switching from water foraging to free labor at time t is subtracted from the water foragers and immediately added to the corresponding transition state TWL using the exact same term. Wasps that are in the transition state TWL are busy with switching their tasks and are, therefore, not available for doing any actual work. The time delay τWL defines the time this transition takes. Therefore, to model the abandonment we subtract at time t+τWL the full amount of wasp fraction that entered the transition state at time t which is, in turn, added to the free labor. At time t+τWL the switching is done and the wasps are available again, but as free labor. They could, for example, switch to the building state now by switching first to TLB and with a time delay of τLB, which models the time delay for recruitment, to B itself. The actual value of all time delays are set to the same value τ=9 (see Table 1). This value is arbitrary but note that its influence is basically only a scaling in time. The task-switch parameters for water and pulp foragers are set to equal values (rW=aW=rP=aP=φ) determined by a master parameter φ which we vary on the interval [0,1]. The two task-switch parameters for builders rB and aB were chosen to be threefold bigger than the master parameter φ (see Table 1).

We start with the definition of the recruitment process of water foragers. The recruitment of water foragers is controlled by parameter rW (recruitment rate), increases with the available free labor L and also increases if the common stomach S has a low filling level. The increase of water foragers per time is
for a nonlinear dependence on the common stomach via the threshold function θ (a sigmoid function), which is characteristic for many stimulus-reaction response in biology
with a constant c that controls the curve’s steepness. We have ξLW≥0 and ξLW is a stochastic process, modeled as white noise distributed as ξLWn|X| with standard normally distributed \(X \sim \mathcal{N}(\mu=0,\,\sigma^{2}=1)\) and noise intensity n. Note that the noise term ξLW is multiplied with the swarm fraction L to scale this noise also with the current swarm fraction of wasps that are in this state currently. This models that it is more likely that a wasp out of many switches randomly than a wasp out of few. With ξ≥0 and adding ξ in the equations with suitable signs, we enforce that swarm fractions propagate through the states along the directions indicated by the arrows in Fig. 2.
For an explanation of the parameters used in Eq. (3) and all the following see Table 1. The abandonment (or emigration) of water foragers is controlled by parameter aW (abandonment rate), depends on the number of water foragers themselves W and the fill level of the common stomach
Consequently the dynamics of water foragers is modeled by
with noise term ξWL defined as above.
Next we define the dynamics of pulp foragers which is similar to that of water foragers. It is defined by recruitment from free labor
and abandonment of pulp foraging depending on the fill level of the common stomach but also on the dynamics of free labor which is different from the dynamics of water foragers:
Pulp forager wasps will abandon their task if there are too many of them, if there are only few free laborers, or if the common stomach has a low filling level. This dependence of abandonment on free labor is due to the fact that pulp foragers need to download their pulp to free wasps which will become builders. If there are only a few free wasps available then this causes a long delay in the work of pulp foragers, indicating that their job is overfilled. The dynamics of pulp foragers is defined by
with noise term ξPL defined as above.
We define the dynamics of builder wasps. The recruitment of builders increases with the number of pulp foragers and with increasing level of the common stomach. It is defined by
with noise term ξLB defined as above. Builder wasps will abandon their task increasingly with the number of free laborers and they stay busy in their task as long as the ratio \(\frac{B(t)}{P(t)} \approx m\) is approximately satisfied. The latter is implemented by a summand −aB(B(t)−mP(t))L(t) which goes to zero for \(\frac{B(t)}{P(t)} \approx m\). If there are too many builders (B(t)>mP(t)) then the summand is positive and with too many pulp foragers (B(t)<mP(t)) it is negative. A dependence on free labor L is introduced to diminish the increase of builders in low free labor situations, yielding
The dynamics of builders is
with noise term ξBL defined as above. The two task-switch parameters for builders rB and aB were chosen to be threefold bigger than the master parameter φ. This is because the swarm fraction of builders is that with the slowest increase according to Eq. (10) based on a product of two swarm fractions (L and P) and the common stomach fill level. Hence, the two task-switch parameters for builders determine importantly the transient length of the system. With the desire to keep the transient short the task-switch rates for builders were increased by an, in principle, arbitrary factor.
The dynamics of free labor depicts the change of the unoccupied wasps. While these wasps are part of the common stomach they do not carry out specialized work such as foraging or building. Specialized wasps are recruited from and revert to free laborers depending on the status of the common stomach and the amount of arriving pulp material. The following equation models the dynamics of the swarm fraction of wasps that are in the state ‘free labor’. This equation is complex but it is a mere result of the above definitions:
Switching between tasks is always done via the free laborer group and always includes a time delay. During this time delay the wasps will not carry out any work and we assume that they are not a member of the common stomach in order to simplify our equations. Typically, the transition states accumulate only a small fraction of wasps at all times, provided τ is small relative to 1/φ.
Wasps that were doing a special task X and abandoned that job will switch to transition state TXL. Similarly, wasps that were in state ‘free labor’ and switch to one of the three special tasks X, first switch to transition state TLX. The differential equations for the transition states result from the above definitions. For the transition state from free labor to water foragers we get
For the transition state from free labor to pulp foragers we get
For the transition state from free labor to builders we get
For the transition state from water foragers to free labor we get
For the transition state from pulp foragers to free labor we get
For the transition state from builders to free labor we get

By defining an initial state of L(0)=1, S(0)=0.1, and setting all other states to 0, we impose an initial value problem. In order to simplify the numerical approach we apply an approximation to the actual time-continuous stochastic process ξ(t) in Eqs. (1) through (13). We discretize the application of noise in time rather coarsely. Noise-free variants of the equations are solved for small time intervals of length δt=13 during which the system is continuous. In between these time intervals noise is applied to the system creating equidistant discontinuities. We solve the resulting equations using MATLAB®.

As a performance measure we integrate the swarm fraction of builders over a time interval

Note that the actual objective of the colony is not just to keep the builder fraction high but to do as much nest-building as possible. Hence, we could multiply ϒ by a constant to give the amount of nest area the builder wasps build per unit time.

2.3 Modeling Assumptions

Our general approach is that of a macroscopic model; that is, the model is a rather strong abstraction. For example, individual agents (agent positions, agent states, etc.) are not incorporated. In the following we enumerate all other less obvious abstractions and assumptions.

We assume that the swarm size is constant. No individuals will leave or join the swarm. There are several assumptions connected to processes around the common stomach (storage of water in the colony) which needed to be simplified to allow for a concise model. Although the common stomach is naturally implemented as a distributed resource and will usually show inhomogeneous characteristics, we assume that the water within is always equally distributed allowing for a single fill level as state variable. In the model, a water forager will always deliver the same (maximum) quantity of water smax to the common stomach. Similarly, the pulp forager will always take the same (maximum) quantity of water smax to the pulp source. The speed of this water intake and extraction is parametrized by win and wout. All incoming loads of pulp are assumed to have the same size and all pulp is processed without loss.

Wasps that leave the common stomach are assumed to take their water with them; that is, they use this water for the new task if necessary. This assumption means that a task changing wasp does not change the fill level of the common stomach (all staying wasps have still the same relative fill level).

Wasps that switch from one task to another are kept in a transition state for a limited time. Wasps are not part of the common stomach during their stay in transition states.

3 Results

In the following parameter sweeps we investigate the system on different time intervals [0,1000], [0,1500], [0,2000] depending on different parameter settings to avoid major effects by transient behavior where they are undesired. Note that the transient depends heavily on the parameters, especially φ, and we are also partially interested in the transient behavior. This is because long transients have relevance to the efficiency of the wasps. Hence, the choices of time intervals are a compromise and in a sense arbitrary. It reduces the influence of high frequency overshoots, for example, on our performance measure.

3.1 Formation of Equilibria and One-Time Disturbances

In the following we investigate the effect of a single significant disturbance to the system. Note that these one-time disturbances are implemented as external events to the model and are independent of the noise terms ξ. We study the effect of this disturbance on both noise-free systems (i.e., noise intensity set to n=0) and noisy systems (i.e., n>0). In this way we will be able to demonstrate result R1—stability and result R3—flexibility.

We integrate the system equations over time until an equilibrium is reached, then a one-time disturbance is applied to a system variable in terms of a sudden change of a single component of the system (i.e., common stomach or a task-specific swarm fraction). The disturbance is a step increase or decrease of the respective state variable. In case of changes of swarm fractions, the swarm fractions are not normalized after the disturbance to show the differences more clearly. Otherwise the equilibria before and after the disturbance would be identical. Then the system equations are integrated until an equilibrium is reached again. We investigate five kinds of disturbances: increase of water in the common stomach, decrease of water foragers, decrease of pulp foragers, decrease of nest builders, and increase of free labor. In all experiments we are using the basic parameters given in Table 1 and the master parameter was set to a comparatively low value of φ=0.06. The results are shown in Fig. 3.
Fig. 3

One-time disturbance of one state variable (common stomach S, builders B, water foragers W, free labor L, pulp foragers P) at time t=500; φ=0.06. In case of swarm fraction disturbances the fractions are not normalized to show relative changes

The system’s reaction to a sudden increase of water in the common stomach (Fig. 3(a)) is a decrease in water foragers and an increase in pulp foragers and builders. After the decay of all oscillations the system converges to the same equilibrium as before the disturbance.

The reaction to a decrease of water foragers (Fig. 3(b)) is a decrease in all other state variables. After the removal, the water forager group speedily increases in number and the system after some smaller oscillations converges to a lower equilibrium than before because the removed wasps are missing now and we are not re-normalizing.

The sudden decrease of pulp foragers (Fig. 3(c)) is followed by a decrease in builders and water foragers and an increase of free labor and the common stomach. This is followed by the speedy recruitment of new pulp foragers and the system after some smaller oscillations will converge to a lower equilibrium similarly as in the previous experiment.

The sudden decrease of the number of builders (Fig. 3(d)) is a special case because the state transitions of builders are not directly dependent on the common stomach fill level S (cf. Eq. (12)). The system reacts without oscillations with a decrease in pulp foragers, water foragers, and free labor, it converges to a lower equilibrium due to the lower number of wasps.

The increase of free labor (Fig. 3(e)) shows the opposite trend to the previous experiment. It triggers an increase in all other swarm fractions and it also has a slight effect on the common stomach, because the recruiting of new pulp foragers and water foragers occur at different rates.

Common to all experiments are the initial oscillations after the perturbation (t∈[500,700]) until an equilibrium is reached again (indicated by unchanged state variables for the interval t∈[800,1000]). The investigated disturbances do not seem to push the system into an unstable state (at least for the chosen parameters). These findings demonstrate the equilibrium claim of result R1—stability.

In a second series of experiments we repeated the above one-time disturbance scenarios but applied a permanent noise as well. In addition, the time interval was doubled to [0,2000] because the noise causes longer transients. The results are shown in Fig. 4. Comparing these results to those shown in Fig. 3 the most obvious change is the smaller swarm fraction of builders B due to the noisy conditions in all cases. Furthermore, the other states except for the common stomach S are affected and have lower values. Due to the noise the initial oscillations, which are observed also in Fig. 3, do not vanish during the whole time interval. Besides these differences, the effects of the one-time disturbances seem to be similar in their trend to those in the noise-free scenarios. For example, in the case of decreasing pulp foragers (see Fig. 4(c)) the effect seems to be even smaller because oscillations caused by the one-time disturbance are barely distinguished from those of the permanent noise. In case of increasing the free labor (see Fig. 4(e)) the short-scale oscillations of the permanent noise are modulated onto the long-scale oscillation of the one-time disturbance as clearly seen for the water foragers W(t) and the pulp foragers P(t) for t∈[1000,1400].
Fig. 4

Permanent application of small noise (n=0.007) to all state variables and a single disturbance of one state variable (common stomach S, builders B, water foragers W, free labor L, pulp foragers P) at time t=1000; φ=0.06. In case of swarm fraction disturbances the fractions are not normalized to show relative changes

In agreement with result R2—oscillations and as anticipated in result R1—stability the system does not always converge to an equilibrium (i.e., a set of fixed points) but sometimes to periodic behavior. For special parameter settings and no noise, the system converges to a stable behavior showing oscillations, which is called a ‘periodic attractor’ in nonlinear dynamics. This asymptotic system behavior is expressed by permanent oscillations in some or all state variables. For example, if we set wout/win=10 and the task switch rates to a high value (φ=0.3), this setting results in stable oscillations, see Fig. 5(a). The cause of these oscillations is that a small increase of pulp foragers causes a big increase in water extraction from the common stomach, which in turn requires an intensive recruitment of water foragers. Consequently the water level of the common stomach starts to drop which in turn decreases the number of pulp foragers. Then, due to the low number of water users, the common stomach starts to fill up again and this will cause water foragers to revert back to free laborers. This indicates that the result R1—stability does indeed not hold for all parameter settings and demonstrates result R2—oscillations.
Fig. 5

Emergence of stable periodic attractors for strongly unbalanced relations of water extraction to water intake wout/win combined with high task switch rates (φ=0.3)

In Fig. 5(b) a bifurcation diagram for a noise-free system (n=0) and varied ratio wout/win is given. It shows the values of state variables to which the system converges for different parameters wout/win. Lines are shown in the case of fixed points and areas in the case of periodic attractors (defined by the minimum and the maximum of the oscillations). The diagram starts at the left with values of wout/win<1, that is, one water forager adds more to the common stomach than one pulp forager within a given time interval. For about wout/win<6 the lines (in contrast to areas for wout/win>6) indicate that the system converges to fixed equilibria (i.e., sets of fixed points). For about wout/win>6 the areas give minima and maxima of the stable periodic behaviors of the system variables. The amplitudes of the oscillations increase with increasing unbalance of water extraction to water intake. In Fig. 5(c) the accompanying bifurcation diagram for a system with noise (noise intensity n=0.014) is given. Due to noise the areas stretch over the whole interval (even for wout/win<6, which is comparable to those settings used in Fig. 4).

The data shown in Fig. 5(b) indicates the existence of a Hopf bifurcation at about wout/win=6. Periodic attractors and oscillations are common in systems described by DDE and in delayed negative feedback control as which this model can be interpreted. Furthermore, it is also known that additive and multiplicative noise increases the decay time of perturbations prior to the bifurcation (Longtin et al. 1990) and consequently longer lasting oscillations and oscillations with higher amplitudes are observed as seen in Fig. 5(c) for wout/win<6. Also notice that with zero delay (τ=0) the periodic attractor vanishes in both cases: the noisy and the noise-free system.

By comparing Fig. 5(c) with Fig. 5(b) we find that the influence of the periodic attractor (for wout/win>6) on builders, free labor, and pulp foragers in the presence of noise seems to be small. Only in the case of the water foragers and the common stomach do the distances between minimum and maximum clearly increase with increasing imbalance of water extraction to water intake. Hence, noise does not add to the variance in the state variables introduced by periodic attractors but might rather have a damping effect.

We conclude that while noise in some cases reduces and in some cases generates larger changes in the task groups in both our perturbation experiments and in the presence of periodic attractors, the main trends of colony-level reactions seem to be similar to the performance of the noise-free systems. Due to these findings, in the next section we investigate in more detail how the different strength of noise and degree of task switching rate will affect colony-level task performance.

3.2 Dependence of Performance on Task Switch Rates and Noise

In the following parameter sweeps we investigate the system on time interval [t0,t2] with t0=0 and t2=1500. The interval [t0,t1] denotes a period that might be considered a transient. This is relevant for the performance measure (Eq. (20)) which is measured only over the interval [t1,t2]. Here we set t1=750.

In the following we investigate the dependence of performance on task switch rates and noise; that is, we demonstrate results R4—noise-free, R5—medium noise, R6—high noise, and R7—transients. It is to be noted that there is a close relation between the length of time delays τ and the task switch rate φ. For moderate task switch rates (depending on the noise level, about φ<0.1), increasing the task switch rate reduces the time spent in transient states. Similarly a decreased time delay reduces the transient, too. Consequently, the following presentation of varied task switch rates is also to be interpreted as changes in the time delays whereas high task switch rates correspond to short time delays (i.e., low task switch costs).

Fig. 6 shows the influence of task switch rates φ and seven different noise settings on the performance as measured by ϒ given in Eq. (20). The increase in performance for increasing values of φ for φ<0.05 is due to the long transients that are even longer than our predefined value t1=750. For high task switch rates (depending on noise-level, about φ>0.1) the performance decreases again because higher task switch rates increase the swarm fraction that is idling in transition states. Hence, there are optima for apt relations between transient length and task switching intensity. For increasing noise the transients are increased, hence, higher task switch rates are advantageous for medium noise intensities (first five lines from top in Fig. 6). However, optimal task switch rates decrease for even higher noise intensities (two lines at the bottom in Fig. 6 for noise n∈{0.055,0.14}) because high task switch rates combine with high noise intensities to increase the swarm fraction in transition states. For extreme values this even decreases the performance until it is close to zero as almost the whole swarm is in transition states (for n=0.14). We note that for the noise-free case (n=0) high performance is reached by comparatively low task-switch rates (cf. R3—flexibility) while even lower task-switch rates would increase the performance but the transients would be increased as well (cf. R6—high noise).
Fig. 6

Parameter sweep over different task switch rates φ investigating the influence of noise to the performance measure ϒ (see Eq. (20)); noise intensities n from top to down: 0, 0.0014, 0.0055, 0.014, 0.028, 0.055, 0.14; squares mark the maxima of each setting

3.3 Dependence of Equilibria on Task Switch Rates and Noise

In the following we focus on the dependence of the equilibria on the task switch rates for a given intensity of noise n and for variable noise intensities n. Here, noise can be interpreted as a representation of colony size. This is due to the following reasoning. In a small colony a percentage of randomly task switching individuals, will have a bigger impact on the colony’s performance than the same percentage in a bigger colony given that the random switches are statistically independent. This assumption of independence is supported by the typical properties of swarms (e.g., local interactions, autonomous agents). The behavior of an individual is determined mostly by its local surrounding at that time. This line of argument is described in detail and with reference to the central limit theorem by Wenzel and Pickering (1991). This allows us to reconsider result R4—noise free and R5—medium noise. In addition we investigate result R8—colony size.

We extend the above analysis of performance dependence on task switch rates and noise by analyzing this dependence in more detail and investigating the equilibria that are reached. The influence of the task switch rates on the equilibrium state with (n=0.014) and without noise (n=0) is shown in Fig. 7. The vertical axis gives the system variables of the equilibria. Low task switch rates φ have the positive effect that the equilibrium states of builders, water foragers, and pulp foragers are high, which is equivalent to high efficiency (cf. R4—noise-free and R7—transients). However, the transient is long (data not shown) which might cause low efficiency if the time intervals, for example, of environmental changes are small in relation to this transient.
Fig. 7

Dependence of equilibria on the task switch rates φ with noise (solid lines, n=0.014) and without noise (dashed lines, n=0); mean values are computed over an interval of the last 100 time steps

In contrast, with high task switch rates the equilibrium is reached much faster but there is also a higher rate of persistent task switching even without noise. (Wasps certainly show persistent switching, cf. Karsai and Wenzel 2000.) Hence, a much higher fraction of the swarm is idling in transition states which explains the lower equilibrium states of builders, water foragers, and pulp foragers.

When applying a persistent noise (n=0.014) the situation changes only slightly (see Fig. 7). The equilibria are reached more slowly (data not shown). Hence, the efficiency is lower (cf. R5—medium noise) and the transient is longer (cf. R7—transients). This is why the number of builders increases while the number of workers doing other tasks decreases for increasing task switch rate φ in the region φ<0.2 as this is actually still transient behavior. Note that if we increase the time interval of our observations, this situation would persist although the curve would shift to the left towards φ=0. For any given φ all states have lower equilibrium values when noise is included because more task switching is forced by noise. Hence, a higher fraction of the swarm is idling in transition states. This is most obvious in the case of the builders fraction B which depends on two other swarm fractions (L and P) that are both lower due to noise. The average level of the common stomach is not influenced by noise because it is mostly defined via the ratio win/wout.

An analysis of noise and its influence on the equilibria in this system is shown in Fig. 8. Obviously a lot of noise can be endured by the system. Still, the system breaks down completely at a certain intensity of noise. This breakdown is to be placed between 0.2<n<0.27 where the fraction of builders decreases significantly. As mentioned above, we can interpret high noise as representing a small colony and low noise representing a big colony. Hence, noise intensities of n>0.27 represent small colonies for which task switching is inefficient. This is in accordance with result R8—colony size.
Fig. 8

Influence of noise intensity n with fixed task switch rates defined by φ=0.2; the n-axis is logarithmic; mean values are computed over an interval of the last 100 time steps

4 Discussion

One of the key results of our study is that our model predicts plausible patterns of work allocation without assuming initial intrinsic differences among the workers or implementing any individual adaptation (such as adapting behavioral thresholds). The main emphasis in our model is on individual interactions that happen indirectly via the common stomach, which is both an information center and a storage/buffer for water. Our goal was to construct a general model without restrictions to narrow parameter ranges which would relate to observations of natural wasp colonies. In contrast, we retained only the key core of the mechanism we observed in nature (Karsai and Wenzel 2000) and used in our previous models (Karsai and Balazsi 2002; Karsai and Schmickl 2011). Still, this more general model gave predictions similar to those reported before. This is especially apparent in case of the perturbation experiments. If we did not employ significant noise and our master parameter was low (recruitment and abandonment were slow) then the system showed similar behavior compared to our previous studies (Karsai and Balazsi 2002; Karsai and Schmickl 2011).

The key difference from these previous papers is that in the reported model we have dropped the simplifying assumption of complete, cost-free flexibility of task switching (Karsai and Balazsi 2002; Karsai and Schmickl 2011). Due to the switching costs by time delays in the model, we were able to investigate how the performance of especially small colonies (here represented by very noisy settings) is influenced as the reactions to perturbations might be slower than the perturbations themselves. In addition, we were able to investigate the performance of species with bigger colonies (here represented by less noisy settings) as they can afford to operate on low task switch rates in the presence of task switch costs and hence work with highly efficient specialists (Karsai and Wenzel 1998). Consequently, the above mentioned similarities in some of the results are an interesting result themselves because they were not to be expected.

Because the parameters were not fitted to measured values from wasp societies and because we applied some simplifications, there are some differences between our current model and previous ones. For example, the number of foragers has slightly different values, but the trend that the number of foragers is smaller than the number of builders still holds. Generally the transient oscillations seem to be more intensive here but that scales with the master parameter φ and could be further reduced to decrease oscillations. Also in this study pulp is not modeled explicitly, therefore one of our experiments with natural wasps and pulp could not be done here. In one experiment we have also shown that the common stomach was insensitive to a sudden decrease of builders (see Fig. 3(d)). This is because, on the one hand, builders are not directly affected by the common stomach (cf. Eqs. (11), (10), and (12)). On the other hand, here the common stomach S gives only a relative measure of its filling level. The actual quantity of water is determined by the free labor L which decreases after the disturbance.

The reported results and additional experiences with the model support the assumption that for a vast region in parameter space the system converges to equilibria (cf. result R1—stability). Still, stable periodic attractors exist in the system as well for specific parameter settings as reported above. The strongly unbalanced relation between water intake by water foragers and water extraction by pulp foragers relates to real wasp colonies as an unequal situation which necessarily has to be solved. For example, this inequality could mean that water foragers do not use their crops efficiently or that pulp foragers need very different quantities of water compared to the quantity provided by each water forager. It could also be interpreted as a very different attitude of common stomach wasps towards the two groups of foragers. For example, they could easily accept water but would not give water away as easily. These details are not yet clarified for real wasp societies, however, we know that in several species the collection of pulp takes longer than the collection of water (Karsai and Wenzel 2000). Hence, inequalities of water intake and extraction emerge in nature which results in fluctuations. With our model we explicitly investigate how strongly these inequalities are destabilizing the system and our findings show that these inequalities need to be big to cause significant oscillations. These oscillations in a natural system could be detrimental for the construction efficiency. Therefore, we expect that natural systems evolve towards solutions that minimize these fluctuations. Besides the obvious buffering role of the common stomach, especially in larger colonies as shown in this paper, the symmetry of water intake and water extraction, as well as the optimal setup of the workforce, and the size of the interaction platform (Karsai and Runciman 2009) would result in a stable equilibrium in the construction behavior.

A previous study on the properties of the common stomach (Karsai and Runciman 2009) showed that a common stomach could be beneficial for a colony’s performance, although it requires additional water transfers and subsequently causes additional delays. This increase of colony-level performance is only lacking if the density of the wasps is very low (hard to find partners) or very high (easy to find a partner for direct transmission). In our current model we did not explicitly study the interaction success. However, in real systems the interaction frequency could be a consequence of evolutionary pressures that favor mechanisms that allow a steady construction by using only a small number of foragers. Obviously, in smaller colonies random events can have larger effects. Larger variation was observed in the productivity of smaller wasp societies by Wenzel and Pickering (1991). Our current model implements swarm fractions, therefore we could not model colony size directly. Instead we interpreted the noise intensity as a representation of colony size. While noise is important for controller systems, it also could be used as a metaphor to study biological processes.

Interestingly, the single disturbances in the series of experiments with the application of persistent noise (Fig. 4) have small effects compared to the oscillations caused by noise in the cases of decreasing pulp foragers (Fig. 4(c)) and decreasing nest builders (Fig. 4(d)). This and the analysis of noise in Sect. 3.3 (especially Fig. 8) indicate the robustness of this system. The system has several mechanisms that decrease sensitivity to noise. First, noise triggers higher task switching rates because deviations from the equilibrium state are compensated. Higher task switching rates increase the swarm fraction in transition states which, in turn, reduces the swarm fraction in active states. Task switching rates are, however, determined by these active states. Hence, protracted high numbers in transition states result in lower task switching rates. Second, the common stomach level is only directly influenced by water foragers, pulp foragers, and to some extend by free labor but influences all task switch rates directly except for those of builders. Therefore, it serves as a buffer for fluctuations in free labor and indirectly in builders. Third, some portion of noise is probably compensated for by integrating over time (inherent to the system) because it is simple white noise.

The previously mentioned trade-off between high task switch rates and low task switch rates can be resolved in the following way. Our results imply that too high task switch rates seem to have less disadvantages than too low task switch rates and similarly too short time delays imposed on switching seem to have less disadvantages than too long delays. This seems to be true especially for medium sized colonies (i.e., medium noise, see Fig. 6). Too low task switch rates increase the transients significantly while too high task switch rates seem not to waste as much time due to populated switching states. Note that this might even hold if we scale up both, task switch rates and task switching delays (increased τ, higher switching costs) because the task switch costs only scale linearly while the transients seem to have non-linear dependencies. These findings also agree with observations of natural colonies. Wasp colonies using the studied mechanisms for construction needed a decent colony size to allow for processing tasks simultaneously without too many task switches. Those wasp species, which have smaller colony sizes, cannot operate via task partitioning, but instead they use all-rounder workers (Karsai and Wenzel 1998) which allow for low-cost task switching.

The effectiveness of the modeled swarm in solving the problem of dynamic task switching combined with the decision process whether task partitioning should be applied at all depending on the colony size can barely be underestimated. This is especially revealed by comparing these natural swarms to artificial swarms and multi-agent systems. Task partitioning and task allocation in distributed computational systems, UAVs, and RoboCup, for example, is often based on global all-to-all communication, at least in environments of less variation (Gerkey and Matarić 2004; Klügl et al. 2003). Dynamic swarm sizes seem not to be addressed in such artificial groups, hence, the decision process of whether task partitioning should be applied is seldom included. Implementations of dynamic task allocation without global communication seem to be rare and restricted to low numbers of tasks (Lerman et al. 2006). Hence, we conclude that the ability of a natural swarm to decide whether task partitioning is useful, to do efficient dynamic task switching, to absorb sudden disturbances, and to be robust to persistent noise seems to be beyond the current art of engineering.

The reported results indicate a high degree of robustness and high efficiency in the modeled system inspired by the task allocation mechanisms of social wasp colonies. The robust and efficient performance is achieved by the time costs of task switching and the function of the common stomach as an information center. Noisy environments together with high task switch rates present a danger to the stability of task allocation. However, high task switch rates will push a relatively high percentage of the swarm into transition states and remove them from work for a certain time period. In this way the task switch turnover is reduced and, in turn, the system is stabilized. Three out of the four tasks are naturally connected to the common stomach in two regards: they physically deal with water and they are regulated by supply and demand of water. The meaning of the word ‘center’ in ‘information center’ should be interpreted as an abstract and conceptual center as its implementation is actually distributed. The fill-level of the common stomach is only locally sampled by wasps which is, of course, a noisy measure. This measurement, however, gets better in the average with increasing number of measuring wasps (central limit theorem). The combination of being a physical water storage/buffer and an information carrier generates synergies because no additional, explicit measurement actions have to be done by the wasps to gather information about the current status of the colony. Instead it is perceived by the individual easily as the individual performs its actual task. That is, if the individual finds it easy and quick to accomplish its work, then this indicates that the individual’s task is in demand. Hence, the water/pulp foraging and the free labor task are well regulated through the common stomach and the builder task builds on this stable basis and performs a higher level task regulated by pulp flow.

As a final and concise conclusion we note that natural, locally controlled systems such as social insect colonies achieve a high efficiency and robustness by leveraging physical constraints (e.g., task switching overhead, water storage in the wasp crop) and reusing locally obtained information (e.g., time needed to relay water) while avoiding explicit, additional measurements or other direct actions. The knowledge and insights about these self-organizing and adaptive processes based on time costs as regulation mechanisms and using synergistic combinations of task-inherent measurements might allow for even better ways of analyzing natural swarms and also designing artificial swarms.


We thank the anonymous reviewers for precise comments that helped to improve the manuscript significantly. Authors T. Schmickl and H. Hamann were supported by the following grants: EU-IST-FET project ‘SYMBRION’, no. 216342; EU-ICT project ‘REPLICATOR’, no. 216240. T. Schmickl was also supported by the following grants: EU-ICT ‘CoCoRo’, no. 270382; EU-ICT ‘ASSISIbf’, no. 601074; Austrian Science Fund (FWF) research grant P23943-N13 (REBODIMENT). The authors thank Wayne G. Basler for establishing the Chair of Excellence for the Integration of the Arts, Rhetoric and Science and East Tennessee State University for supporting T. Schmickl as Basler Chair and I. Karsai as Basler Host 2012. I. Karsai was supported by 12-005M RDC and E82141 grants from ETSU.

Copyright information

© Society for Mathematical Biology 2013