Abstract
Effectively coordinating one’s behaviors with those of others is essential for successful multiagent activity. In recent years, increased attention has been given to understanding the dynamical principles that underlie such coordination because of a growing interest in behavioral synchrony and complex-systems phenomena. Here, we examined the behavioral dynamics of a novel, multiagent shepherding task, in which pairs of individuals had to corral small herds of virtual sheep in the center of a virtual game field. Initially, all pairs adopted a complementary, search-and-recover mode of behavioral coordination, in which both members corralled sheep predominantly on their own sides of the field. Over the course of game play, however, a significant number of pairs spontaneously discovered a more effective mode of behavior: coupled oscillatory containment, in which both members synchronously oscillated around the sheep. Analysis and modeling revealed that both modes were defined by the task’s underlying dynamics and, moreover, reflected context-specific realizations of the lawful dynamics that define functional shepherding behavior more generally.
Keywords
Many human activities require that individuals coordinate their actions with others to achieve a shared goal. For instance, family members must coordinate their movements when clearing a dinner table. Teammates playing doubles tennis must coordinate their strokes and court positions. Teachers must coordinate their relative positions when shepherding school children through a museum on a field trip. Such multiagent coordination is often highly complex, involving a large number of degrees of freedom that must be collectively controlled in a flexible and robust manner. Indeed, coactors engaged in multiagent activity must continuously adapt and redirect their actions with respect to one another, as well as mutually respond to the dynamic properties of other task-relevant objects (or agents) and the environmental context. Accordingly, the stable patterns of multiagent behavior are best conceptualized as emergent properties of a complex multiagent-environment system (McGarry, Anderson, Wallace, Hughes, & Franks, 2002; Richardson, Marsh, & Schmidt, 2010; Riley, Richardson, Shockley, & Ramenzoni, 2011; Schmidt, Fitzpatrick, Caron, & Mergeche, 2011).
In recent years, increased attention has been given to understanding the cognitive and perceptual-motor processes that enable humans to achieve effective patterns of multiagent activity. The neurocognitive mechanisms that support social action have been a particular concern (Vesper, Butterfill, Knoblich, & Sebanz, 2010), as have been the mechanisms that support joint attention and the influence of representing a conspecific’s task goals on one’s own motor planning (Knoblich, Butterfill, & Sebanz, 2011). Other researchers have investigated the collective behavior of large groups of individuals, including traffic and pedestrian dynamics (Sumpter, 2010), human path systems (Goldstone & Roberts, 2006; Helbing, Keltsch, & Molnár, 1997), movements of sports teams (Davids, Araújo, & Shuttleworth, 2005), and the emergent order of social networks, organizations, and societies (Miller & Page, 2007; Schelling, 1978).
A prominent feature of this latter research has been the application of contemporary complex-systems tools, including computational and agent-based modeling approaches (Axelrod, 1997; Epstein, 2006), to identify the principles that shape the behavioral regularity of multiagent activity. With an emphasis on contextual emergence and self-organization, this research provides consistent evidence that the macroscopic order of multiagent systems naturally emerges from the embedded interaction of agents, with no one agent defining the behavioral organization that arises (Goldstone & Gureckis, 2009; Miller & Page, 2007).
Attempts to understand the emergent, self-organized dynamics of multiagent behavior have also focused on the minimal state of collective behavioral organization, namely the behavioral dynamics associated with two-person, interpersonal rhythmic coordination—for instance, the synchronous behavior that occurs between the leg movements of two individuals walking side by side. Starting with the seminal work of Schmidt, Carello, and Turvey (1990), this research has demonstrated that the coordination occurring between the rhythmic movements of interacting individuals is defined by the dynamics of coupled oscillators and can be modeled using the same coupled-oscillator model used to predict patterns of intrapersonal rhythmic interlimb coordination (Haken, Kelso, & Bunz, 1985). Specifically, interpersonal rhythmic coordination is spontaneously constrained to in-phase patterns of behavior (limbs oscillate with the same spatiotemporal relationship) or antiphase patterns of behavior (limbs oscillate with the same temporal, but opposite spatial, relationship), with the relative stability of in-phase coordination being greater than antiphase coordination (see Schmidt & Richardson, 2008, for a review).
Consistent with research on large-group, multiagent behavior, research on the dynamics of interpersonal rhythmic coordination has also demonstrated that the organization of multiagent behavior often emerges from the low-dimensional dynamical processes that constrain the actions of coupled individuals (low dimensional refers to the number of dynamical variables required to explain a behavior). It also highlights how the lawful dynamics defining rhythmic coordination are largely unaffected by the physical or biophysical properties of the movements involved, as well as the manner of coupling—the coupling can be physical or informational (visual or auditory). Particularly relevant for the current study, recent research has demonstrated how similar low-dimensional dynamical processes define a myriad of periodic or semiperiodic multiagent coordination tasks, including interpersonal object-movement and collision-avoidance tasks (e.g., Mörtl, Lorenz, & Hirche, 2014; Richardson et al., 2015), competitive sports tasks (e.g., McGarry et al., 2002; Okumura et al., 2012; Yokoyama & Yamamoto, 2011), and improvised social-movement tasks (e.g., Zhai et al., 2014).
The degree to which the self-organized behavioral dynamics (Warren, 2006) of interpersonal rhythmic coordination can be generalized to more complex multiagent tasks remains uncertain, however, because the majority of previous research has explored only simple rhythmic behaviors that either require intentional in-phase or antiphase coordination or involve incidental, non-goal-directed movements (Richardson et al., 2015; Sebanz & Knoblich, 2009). Although the previously discussed research on large-group coordination is theoretically consistent with research on interpersonal rhythmic coordination, the degree to which the self-organizing principles governing the macroscopic order of large-scale multiagent systems (e.g., flocks, social networks) provide a generalized understanding of the coordination patterns characterizing complex, goal-directed interpersonal or small-group coordination is also unclear. This is because these principles are not typically concerned with detailing the local, fast-time-scale actions of coacting agents and, in most instances, consider agents as minimally thinking, cellular entities (Smith & Conrey, 2007).
A generalized understanding of the self-organizing dynamics that determine interpersonal and small-group multiagent coordination is further restricted by the fact that almost no research has explored the coordination dynamics that emerge during tasks requiring the collective control and organization of other nonstationary environmental objects or agents (e.g., teachers corralling school children), despite the commonality of such behavior. Accordingly, the aim of the present study was to investigate these dynamics using a goal-directed, multiagent task that required coactors to work together to control a set of autonomous agents and in which rhythmic interpersonal coordination was not explicitly defined by the task goal. To achieve these aims, we developed a shepherding video game inspired by the single-player task of Dotov, Nie, and Chemero (2010). The game required pairs of participants to work together to herd groups of three, five, or seven virtual sheep within a containment region at the center of a game field (Fig. 1). Sheep movements were random, and sheep were repelled from virtual sheepdogs that participants controlled using motion-tracking sensors. We expected that participant pairs would learn to effectively herd the sheep over repeated performances by converging on one or more stable coordination strategies. Of particular interest were the degree to which pairs converged on the same task solutions and whether the patterning and differential effectiveness of the emergent task solutions were defined by the task’s lawful dynamics.

The shepherding video game. Pairs of participants played the game on a virtual tabletop display (a) using wireless motion-tracking sensors. The screenshots show (b) an example game, in which participants’ goal was to herd the sheep into the containment region by controlling the sheepdogs, and the initial trial setup for the three-, five-, and seven-sheep conditions.
Method
Participants
Ninety right-handed undergraduate students (50 female, 40 male) from the University of Cincinnati participated in the study for partial course credit. Each participant was randomly assigned to 1 of 45 participant pairs (16 female-female, 11 male-male, and 18 mixed gender); 15 participant pairs were assigned to each of the three sheep-herd-size conditions (three, five, and seven sheep). Fifteen pairs was determined to be an appropriate sample size for each cell on the basis of prior interpersonal-coordination research (e.g., Richardson et al., 2015; Schmidt & O’Brien, 1997). The participants ranged in age from 18 to 31 years and were naive to the purpose of the study. The task, procedure, and methodology were reviewed and approved by the University of Cincinnati’s Institutional Review Board.
Apparatus and task
The shepherding game is displayed in Figure 1. The game was designed using the Unity 3D game engine (Version 4.6.0; Unity Technologies, San Francisco, CA) and was presented on a virtual tabletop display, on which the participants had a top-down view of a 1.17 m × 0.62 m game field (see Section A in the Supplemental Material available online for more information about the Unity game components). The game was rear-projected from below onto a 1.2-cm-thick pane of frosted glass at a refresh rate of 60 Hz. The equipment consisted of a ViewSonic PJD6683ws rear projector and a Dell OptiPlex PC with third-generation Intel I7 3770 processor, 8 GB of RAM, and a 1 GB Radeon HD 7040 graphics card (AMD, Sunnyvale, CA). The maximum display latency between the participants’ movements and the virtual sheepdog was 33 ms. The movements of the sheep and the sheepdogs were continuously displayed at 50 Hz.
Participants in a pair stood on opposite sides of the tabletop display, and each controlled a virtual sheepdog (represented by a red and a blue box) using a handheld wireless LATUS (Large Area Tracking Untethered System) motion-tracking sensor (Polhemus, Colchester, VT) operating at 96 Hz. Game play took place within a fenced-in area of a “grass” game field. The goal of the game was to corral three, five, or seven sheep (brown spheres) within a circular red containment region (radius = 9.6 cm) at the origin of the game field’s (x,y) Cartesian coordinate system. Herd size was used to manipulate task difficulty; the three-sheep condition was expected to be the easiest, and the seven-sheep condition was expected to be the most difficult. Trials lasted 60 s each, and the task was successfully completed on any given trial when all the sheep remained inside the containment region for 70% of the last 45 s of the trial (the first 15 s of the trial served as time for participant pairs to initiate a behavioral coordination strategy or corral the sheep). This task-success criterion was established during pilot testing to ensure that it was sufficiently difficult yet attainable. At the end of each trial, participants received visual feedback (i.e., what percentage of time they managed to keep the sheep within the target area). A game trial ended prematurely (i.e., before 60 s) if one of the sheep hit the fence around the field’s perimeter or if all sheep escaped beyond the border of a 4.9-cm-wide annulus (shown in gray in Fig. 1) that surrounded the containment region.
At the start of a trial, one sheep appeared at the center and the rest appeared along the circumference of the containment region (Figs. 1c–1e); the subsequent motion of the sheep was governed by random Brownian-motion dynamics. The sheep also dynamically reacted to the sheepdogs: When a participant’s sheepdog was within the sheep’s threatened region (12 cm), the sheep would move directly away from the sheepdog at a speed proportional to the distance between the sheep and the sheepdog (see Section A in the Supplemental Material for more details). Notably, sheep were programmed to be able to collide with (as opposed to pass through) each other. The experiment ended either when participant pairs made it past the 70%-success threshold eight times or when 45 min had elapsed.
Procedure
After providing informed consent, participant pairs were told that they would be required to play a virtual shepherding game together. Each pair was then led into the testing room and randomly assigned to opposite sides of the tabletop display. After learning the object of the game, participants were told to hold the motion sensors with their right hand and control their sheepdogs by sliding the sensors on top of the tabletop display. This ensured that the location and movement of their sheepdog was aligned with the motion-tracking sensors. Note that the sensor-to-sheepdog alignment was handled automatically by the game engine, such that the participant’s sensor and the sheepdog it controlled were continuously mapped to the same place on the game field. Participants were then shown the game field, and the rules for success and failure were described. Notably, no instructions were given about how to best play the game or how to coordinate or corral the sheep. Participants were simply told to complete the task to the best of their ability. Finally, participants were told not to talk or verbally strategize within or between trials. An experimenter was present during the session to enforce this no-talking rule.
Data reduction and preprocessing
Of the 45 participant pairs, 1 was dropped because a fire alarm went off during the experimental session. Two other pairs were excluded because the members did not cooperate with each other. In these pairs, 1 participant took complete control of the game and did not cooperate with the coparticipant—a phenomenon known as the obnoxious partner effect (a description of the dominant partner in these pairs is provided in Section B in the Supplemental Material). This resulted in 14 pairs in each of the three-, five-, and seven-sheep conditions. In addition, 2.1% of trials not completed successfully were discarded because of a software malfunction.
To ensure a valid determination of shepherding performance and the behavioral dynamics exhibited by participants during both successful and unsuccessful trials, we analyzed only trials lasting 20 s or longer. For these trials, the x and y positional-movement data of each participant i (sheepdog i, where i = 1 or 2) and sheep j (where j = 1, 2 . . . n) were extracted so we could calculate the time series of participant’s and sheep’s radial distances (Di and Dj, respectively) and polar angles (θ i and θ j , respectively; see Fig. 2a). Prior to behavioral classification and analysis, these movement time series were low-pass filtered at 10 Hz using a fourth-order Butterworth filter. When necessary, time-series data were also linearly detrended.

Participant pairs’ radial distance, polar angle, and behavioral strategies. The graph in (a) illustrates how the radial distance, D, and polar angle, θ, were defined for participants, i, and sheep, j, with regard to the euclidean (x,y) game space. Participant pairs generally adopted either (b) a search-and-recover (S&R) mode of behavior (in which both members worked predominantly on their own sides of the game field to corral stray sheep) or (c) a coupled-oscillatory-containment (COC) mode of behavior (in which each member synchronously oscillated around the sheep). COC pairs engaged in either in-phase movements (both players moving in parallel) or antiphase movements (each player moving in the opposite direction from the other). Typical examples of D and θ over time are shown in the left graphs of (d) and (e) during S&R and COC trials, respectively, in the seven-sheep condition. Corresponding frequency power spectra of the θ time series for each player are presented in the right graphs. For the power spectra shown in (d), the values of the behavioral-classification indices were ϕ1 = −0.49, ϕ2 = −3.54, and
Behavioral-mode classification
A preliminary analysis revealed that there were two behavioral modes (or coordination strategies) adopted by participants. Initially, all pairs adopted a complementary search-and-recover (S&R) mode of coordination, in which each participant appeared to move toward and corral the sheep farthest from the containment region on (predominantly) his or her side of the display—moving from sheep to sheep as each one got nearer or farther from the containment region (see Fig. 2b). However, after a variable number of game trials, a significant number of pairs also discovered and spontaneously transitioned to a coupled-oscillatory-containment (COC) strategy. Using this strategy, participants synchronously moved back and forth in a semicircular manner around the containment region—establishing a kind of “spatiotemporal wall” around the sheep (see Fig. 2c). The synchronous movement could be either in-phase (both players moving in parallel) or antiphase (each player moving in the opposite direction from the other). A video showing general game performance and the S&R and COC modes of behavior can be viewed at http://www.emadynamics.org/bi-agent-sheep-herding-game/.
The S&R and COC behavioral modes were differentiated by the presence of a strong oscillation between 0.5 and 2.0 Hz in the polar-angle movements of both participants during COC behavior and a spectral peak below 0.5 Hz during S&R behavior (see Fig. 2). Accordingly, to determine whether a given trial was dominated by S&R or COC behavior, power spectra for the polar-angle-movement time series of each participant i in participant pair k (k = 1, 2, . . . 42) were computed to identify the strongest frequency component, ωfrequency,i,k , under 2.0 Hz—that is, the frequency component with the greatest “peak” power in this frequency range (see Figs. 2d and 2e); the pwelch function in MATLAB (The MathWorks, Natick, MA) was employed using a 50%-overlapped window of 512 samples. This dominant frequency component and its corresponding power, ωpower,i,k , were then employed to determine the intrapersonal behavioral mode, ω i,k , adopted by each participant during a given trial, as follows:
where (as noted previously) the 0.5-Hz classification boundary was determined empirically by inspecting the entire data set (see the right-hand graphs in Figs. 2d and 2e). Using this measure for each participant, we defined a ϕi less than 0 as a preponderance of S&R behavior and a ϕi greater than or equal to 0 as a preponderance of oscillatory behavior for that participant in a given trial. Finally, in order to classify a pair’s collective behavior as S&R or COC for a given trial, we calculated the average value of ϕ
i,k
across the participants,
Pairs that successfully completed the experiment (i.e., who completed eight successful trials before the end of the 45-min experimental period) were classified as successful COC pairs if they coordinated their herding efforts on at least two trials. All other successful pairs were classified as S&R pairs. Pairs that did not complete eight successful trials before the end of the experimental period were classified as unsuccessful.
Data analysis and measures
Following trial-type (S&R vs. COC) and pair-type (S&R pair, COC pair, unsuccessful pair) classification, we employed a range of measures assessing (a) general game performance and (b) shepherding performance to index the effectiveness of the S&R and COC behavioral modes and to determine what performance variables were related to the emergence of COC behavior. Mode-specific time-series analysis methods were then employed to determine the dynamics of S&R and COC behavior.
General game-performance measures.
For successful S&R and COC pairs, we assessed general game performance in each herd-size condition (i.e., three, five, and seven sheep) via time (in minutes) to game completion, the total number of trials played, and the number of trials that lasted 20 s or longer. For these measures, better game performance was expected to be associated with faster game-completion time and fewer trials played (both overall and with regard to the 20-s-length criteria). The number of unsuccessful trials and the number of the first successful trial played were also determined for successful S&R and COC pairs in each herd-size condition in order to assess whether differences in these trial-count measures related to the emergence of COC behavior. Finally, the total number of trials played and the number of trials 20 s or longer were also calculated for unsuccessful pairs in each herd-size condition for comparison purposes.
Shepherding performance measures.
Three shepherding measures were calculated for all unsuccessful and successful trials lasting at least 20 s. The first measure was the trial score or, more specifically, trial containment time, which was calculated as the time in seconds that all sheep were successfully kept within the containment region. For this measure, better shepherding performance corresponded to greater containment time. The second and third within-trial measures, respectively, were mean herd radial distance, which equaled the average radial distance of the sheep in the herd from the center of the game field over the course of a trial, and mean herd area, which equaled the average polygon area, operationalized as the area of the polygon’s convex hull, of the sheep’s x,y positions over the course of a trial (see the plots on the left of Figs. 3a, 3b, and 3c). Together, these latter two variables captured the degree to which players were able to contain the sheep closer to the center of the game field and closer together, with lower herd radial distance and herd area corresponding to better performance. Note that this correlation was true even for successful trials, so mean herd radial distance and herd area indexed differing degrees of success during successful trials.

Herd radial distance and herd area in the (a) three-sheep, (b) five-sheep, and (c) seven-sheep conditions. The plots on the left illustrate how the radial distance, D, for each sheep j was calculated for each trial to determine the herd radial distance and collective herd area with regard to the euclidean (x,y) game space. Mean radial distance and herd area are shown for example 30-s time series during search-and-recover (S&R) trials (middle graphs) and coupled-oscillatory-containment (COC) trials (right graphs). The S&R and COC trials for each condition are from the same participant pair.
For illustration purposes, typical time series for sheep and herd radial distance and herd area during S&R and COC trials in the three-, five-, and seven-sheep conditions are displayed in the graphs in the middle and right, respectively, of Figure 3. Of course, containment time was expected to be higher for successful trials than for unsuccessful trials, and mean herd radial distance and herd area were expected to be lower for successful trials than for unsuccessful trials. Of more interest was whether there was a difference in containment time, herd radial distance, and herd area between S&R, COC, and unsuccessful pairs during unsuccessful trials and, if so, whether this difference was related to the discovery of COC behavior and the ability to complete the experiment successfully. Of additional interest was the comparative effectiveness of successful S&R and COC behavior; our assumption was that participant pairs that discovered COC behavior would use it more often than S&R behavior because COC behavior was more effective. That is, COC behavior was expected to result in greater containment time and lower herd radial distance and herd area, compared with S&R behavior.
Dynamics of S&R behavior
As mentioned previously, all pairs initially adopted the S&R strategy. For this mode of behavior, each participant appeared to herd the sheep farthest from the containment region predominantly on his or her own side of the tabletop display, moving from sheep to sheep as the farthest sheep from the center of the containment region changed over time. To verify that this “farthest-sheep” strategy was indeed what participants adopted, we conducted a cross-correlation analysis on all S&R trials 20 s or longer. More specifically, cross-correlations were performed to examine the relationship between the participant radial-distance (Di) and polar-angle (θ i ) time series and the following four sets of corresponding sheep behavioral time series.
The first set of sheep time series captured the radial distance and polar angle of the sheep that was farthest from the center of the game space on participant i’s side of the table, regardless of whether the sheep was inside or outside of the containment region. These farthest/own-side time series were the primary test time series and were calculated by determining the radial distance, Dsfi, and polar angle, θ sfi , of the farthest sheep, sf, on participant i’s side of the game space at every time step (see Fig. 4). The three other sets of radial-distance and polar-angle sheep time series were generated for comparative, baseline purposes and corresponded to several other possible S&R strategies. The first of these was generated by finding the farthest sheep from the center of game space at each time step irrespective of which side of the table the sheep was on (farthest sheep), a randomly selected sheep on participant i’s side of the game space (random/own-side sheep), and a randomly selected sheep (random sheep). For the latter two time series, a random sheep was tracked every time the farthest sheep changed in the farthest/own-side time series. The radial distance and polar angle of the randomly selected sheep were then tracked at each time step until the data from the farthest/own-side time series indicated a change in the farthest sheep, at which point another sheep was selected at random and then tracked.

Corralling strategy data and analysis. The plot in (a) illustrates how the radial distance, D, and polar angle, θ, of each participant i in a pair and the sheep farthest (sf) from the center of the game field on each participant’s side of the euclidean (x,y) game space were calculated for the behavioral time series employed in the cross-correlation analysis of search-and-recover (S&R) trials. Example time series for (b) radial distance and (c) polar angle are shown for a participant engaged in S&R behavior in the seven-sheep condition, as well as for four corresponding sheep time series: the farthest sheep from the center of the game space irrespective of the side it was on (farthest sheep), the farthest sheep from the center of the game space on participant i’s side of the table (farthest sheep on own side), a randomly selected sheep on participant i’s side of the table (random sheep on own side), and a randomly selected sheep (random sheep).
We also calculated the maximum zero time-lag cross-correlations between each participant’s behavioral time series and the four corresponding sheep time series for each S&R trial and then averaged these values across trials within each herd-size condition. This yielded a mean radial-distance and mean polar-angle cross-correlation coefficient for each participant pair for each of the four sheep time series. Additionally, the maximum cross-correlations between participants’ radial distance and polar angle for the set of time delays between 0 and ±250 samples (i.e., ±5 s) were also averaged across trials to help assess the degree to which the behavioral movements of coacting participants were coupled during S&R performance.
Dynamics of COC behavior
As previously described, COC behavior involved pairs performing either a semicircular in-phase or antiphase oscillatory pattern of apparent behavioral coordination. Representative examples of radial angle and relative phase during in-phase and antiphase COC behavior are displayed in Figures 5a and 5b, respectively. These examples were chosen to show that different movement frequencies and magnitudes of coordination stability were observed during COC behavior. The frequency of the movements for the trial displayed in the graph on the left of Figure 5b are approximately twice as fast as the movements displayed in the graph on the left of Figure 5a. Consistent with previous research demonstrating that the stability of rhythmic coordination decreases with increases in movement frequency (e.g., Haken et al., 1985; Schmidt et al., 1990; also see Kelso, 1995; Schmidt & Richardson, 2008), the relative-phase relationship displayed in the graphs in the middle and right of Figure 5b is also more variable (less stable) than the relative-phase relationship displayed in the corresponding graphs of Figure 5a. Note, however, that there was no mean difference in movement frequency across herd-size conditions as a function of phase mode in the current study (i.e., the average frequency of movement for in-phase and antiphase COC trials was equivalent; see the Results section).

Polar-angle time series (left graphs), relative-phase time series (middle graphs), and frequency distributions of absolute values of relative phase (right graphs) for exemplar (a) in-phase and (b) antiphase coupled-oscillatory-containment trials. The dashed horizontal line in the distributions represents the .05 significance threshold determined from surrogate analysis (see the text for details).
To quantify the occurrence and stability of these patterns during COC trials, a relative-phase analysis was conducted on all successful COC trials (i.e., excluding six unsuccessful COC trials). For this analysis, a time series of the (instantaneous) relative-phase angles that occurred between the angular movements of a participant pair was first generated using the Hilbert transformation (see Pikovsky, Rosenblum, & Kurths, 2001). To eliminate the transient dynamics that occurred at the beginning of a trial, we excluded the first 5 s of each analyzed trial. To determine the pattern of relative phase that occurred between the 2 participants, we calculated the distribution of the absolute relative-phase angles that occurred across six 30° regions of relative phase between 0° and 180° (i.e., 0°–30°, 30°–60°, . . . 150°–180°) for each analyzed trial. For these distributions, in-phase and antiphase coordination was indicated by a concentration of relative-phase angles near 0° and 180°, respectively (Schmidt & O’Brien, 1997). Thus, to determine whether participants engaged in in-phase or antiphase oscillatory behavior for a significant proportion of a trial, we created 1,000 random relative-phase time series of corresponding sample lengths (45 s) and sample rates (50 Hz) to generate 1,000 surrogate random relative-phase distributions. The 950th largest value for each 30° relative-phase region—17.933%—was then employed as the statistical threshold value; this corresponded to a .05 significance level (Varlet & Richardson, 2015). Accordingly, in-phase coordination was deemed to have occurred for a given trial if the percentage of occurrence of relative-phase angles for the 0-to-30° region was greater than the 17.933% surrogate-distribution threshold. Similarly, antiphase coordination was deemed to have occurred if the percentage of occurrence of relative-phase angles for the 150-to-180° relative-phase region was greater than the 17.933% surrogate-distribution threshold. In addition, intermittent in-phase and antiphase behavior was deemed to have occurred on a given trial if both the 0-to-30° and 150-to-180° regions were greater than the 17.933% surrogate-threshold level.
Results
Recall that successful trials were defined as those in which participant pairs corralled all the sheep inside the containment region for at least 70% of the time (31.5 s) during the last 45 s of a 60-s trial. Furthermore, overall game success (i.e., game completion) was specified to have occurred if pairs completed eight successful trials within the 45-min experimental period. Twenty-nine of the 42 pairs retained for analysis met these criteria. Two other pairs, one in the three-sheep condition and one in the five-sheep condition, completed six and seven successful trials, respectively, within the experimental period. These two pairs were also considered successful, which resulted in a total of 31 successful pairs: 12 pairs in the three-sheep condition, 10 pairs in the five-sheep condition, and 9 pairs in the seven-sheep condition. Note that 1 successful pair discovered the COC strategy on the first trial and therefore completed the experiment in eight trials (i.e., had no unsuccessful trials). This pair was therefore excluded from any statistical analysis that included a comparison of successful and unsuccessful trials. Of the remaining 11 pairs that did not complete the experiment successfully, 6 did not complete any successful trials (1 pair in the three-sheep condition, 1 pair in the five-sheep condition, 4 pairs in the seven-sheep condition), 3 pairs completed just one successful trial (2 pairs in the five-sheep condition, 1 pair in the seven-sheep condition), and the remaining pair (five-sheep condition) completed only two successful trials.
Behavioral classification
Of the 1,254 trials retained for analysis, 1,144 (91.55%) were classified as S&R (
Seventeen of the 31 pairs that successfully finished the experiment completed at least 2 or more COC trials and were therefore classified as successful COC pairs; these pairs had an average of 6.12 successful COC trials (
Mean Trial Statistics for Search-and-Recover (S&R) and Coupled-Oscillatory-Containment (COC) Pairs
Note: Standard deviations are reported in parentheses.
These values exclude data from the S&R pair in the three-sheep condition that completed only six successful trials and the COC pair in the five-sheep condition that completed only seven successful trials, respectively.
As Table 1 shows, there were fewer unsuccessful pairs in the three-sheep condition than in the five- and seven-sheep conditions, which is consistent with the expectation that the three-sheep condition would be easier than the other two conditions. Second, a 2 (pair type: S&R vs. COC) × 3 (herd size: three vs. five vs. seven) Fisher exact test revealed a significance difference (p = .045) between the observed and expected (chance level) frequencies of pair classification as a function of herd size. Notably, more pairs were classified as S&R than as COC in the three-sheep condition (eight to one). Conversely, more pairs were classified as COC than as S&R in the seven-sheep condition (eight to four). The same number (n = 5) of S&R and COC pairs were identified for the five-sheep condition. Taken together, these findings suggest that although the reduced difficulty of the three-sheep condition increased the probability that pairs would successfully complete the game, it also appeared to reduce the possibility that pairs would discover or adopt COC behavior. In contrast, while pairs in the seven-sheep condition were more likely to fail the game, they were also more likely to discover and adopt COC behavior.
General game performance
The effectiveness of discovering the COC behavioral strategy can also be discerned from the data in Table 1. In particular, COC pairs on average completed the game faster and required fewer trials than S&R pairs did (also see Fig. 6). Although the nontrivial differences in the cell size for each herd-size condition prevented a valid statistical analysis of pair type as a function of herd-size condition, between-subjects t tests comparing game-completion time, t(27) = 2.54, p < .025, d = 0.94, and the number of trials played after the first successful trial, t(27) = 3.20, p = .003, d = 1.16, for successful S&R and COC pairs (excluding the two pairs that completed only 6 and 7 successful trials) verified that these differences were significant (Figs. 6a and 6b). Moreover, separate one-way between-subjects analyses of variance (ANOVAs) comparing the total number of trials played and the total number of trials greater than 20 s for S&R, COC, and unsuccessful pairs were also significant, both F(2, 39)s > 19.28, p < .001, η p 2 = .50, and Bonferroni post hoc tests revealed that the trial counts for COC pairs were significantly lower than the trial counts for S&R (both ps < .01) and unsuccessful pairs (both ps < .01; see Fig. 6b). Note, however, that on average, S&R and COC pairs completed their first successful trial after the same number of unsuccessful trials, t(29) = 0.31, p = .76, d = 0.11. This indicates that the differences between S&R and COC pairs with regard to completion time, number of trials played, and number of trials greater than 20 s was due to COC pairs exhibiting a greater and more consistent level of shepherding performance following their first successful trial.

General game performance. Mean game-completion time (collapsed across herd-size conditions) is shown in (a) for successful search-and-recover (S&R) and coupled-oscillatory-containment (COC) pairs. The mean number of total trials played (b) and the mean number of trials that lasted longer than 20 s (c) are shown for successful S&R and COC pairs, as well as for unsuccessful (Unsuc.) pairs. The mean number of the first successful trial completed (d) and the mean number of trials played after the first successful trial (e) are shown for successful S&R and COC pairs. Error bars represent +1 SEM.
Shepherding performance
As can be seen from the mean

Mean behavioral-classification index (
A detailed summary of herd-containment time, herd radial distance, and herd area for unsuccessful and successful trials as a function of pair type and herd size is provided in Table 2. Again, the nontrivial differences in the cell size for each herd-size condition prevented the inclusion of herd size as a factor in statistical analysis. Thus, to unpack the differences in herding performance for S&R and COC pairs before and after the first successful trial, we employed 2 (trial type: unsuccessful vs. successful) × 2 (pair type: S&R vs. COC) mixed-designed ANOVAs. These ANOVAs revealed significant Trial Type × Pair Type interactions for herd-containment time, F(1, 28) = 11.62, p = .002, η p 2 = .29, herd radial distance, F(1, 28) = 8.31, p < .01, η p 2 = .23, and herd area, F(1, 28) = 6.19, p = .02, η p 2 = .18 (see Fig. 8). Pairwise comparisons of pair type for successful and unsuccessful trials using pooled-variance error terms and a Bonferroni correction revealed that containment time was significantly shorter for COC pairs than for S&R pairs on unsuccessful trials (p < .05) but significantly longer for COC pairs than for S&R pairs on successful trials (p < .05). In addition, herd radial distance was significantly less for COC pairs than for S&R pairs during successful trials (p < .05), with herd area significantly larger for COC pairs than for S&R pairs during unsuccessful trials (p < .01).
Mean Performance Measures for Search-and-Recover (S&R) and Coupled-Oscillatory-Containment (COC) Pairs
Note: Standard deviations are given in parentheses.
These values exclude data from the COC pair in the three-sheep condition that had no unsuccessful trials (i.e., discovered COC behavior on the first trial and completed a total of only eight trials).

Overall mean herd-containment time, herd radial distance, and herd area. Results for successful trials and for unsuccessful trials prior to the first successful trial (a) are shown as a function of pair type. Results for successful search-and-recover (S&R) and coupled-oscillatory-containment (COC) trials (b) are shown for successful S&R and COC pairs. In all graphs, results are collapsed across herd-size conditions, and error bars represent +1 SEM.
Together, the latter findings suggest that S&R pairs may have been inhibited from discovering the COC behavioral strategy because of an overall better level of S&R performance during early game play compared with COC pairs (particularly with regard to containment time and herd area). In other words, poorer S&R performance appeared to foster the discovery of COC behavior. We also ran t tests examining the differences in containment time, t(28) = 1.98, p = .058, d = 0.75, and herd area, t(22.19) = −2,42, p = .024, d = 0.87, 1 between S&R and COC pairs during unsuccessful trials prior to a pair’s first successful trial. These tests were significant, which provides additional support for this conclusion (there was no effect for herd radial distance). Moreover, during unsuccessful trials, herd-containment time and herd-area scores were significantly better for S&R pairs than for unsuccessful pairs (ts > −2.27, ps < .04, ds > 0.95), whereas there was no significant difference in herd-containment time and herd area for COC and unsuccessful pairs during unsuccessful trials (ts < 1, ps > .35).
It is important to note that although the latter findings further support the possibility that poorer S&R shepherding performance promoted the discovery of COC behavior in COC pairs, the lack of a difference between COC and unsuccessful pairs also indicated that poorer shepherding performance did not fully predict the emergence of COC behavior. Moreover, a close examination of these performance measures for COC pairs just prior to a pair’s first COC trial, as well as other measures not reported (e.g., degree of intrapersonal movement oscillation), revealed no consistent predictor of the emergence of COC behavior.
Finally, although the previously detailed 2 × 2 ANOVAs clearly demonstrated that COC pairs performed better than S&R pairs during successful trials, they did not provide a direct comparison between COC and S&R behavior because some of the successful trials performed by COC pairs were actually classified as predominantly S&R trials (i.e., COC pairs performed an average of 6.12 predominantly COC trials and 1.82 predominantly S&R trials during successful trials). Thus, to directly compare the shepherding performance associated with S&R and COC behavior, between-subjects t tests were conducted to compare herd-containment time, herd radial distance, and mean herd area for the successful S&R trials of S&R pairs and successful COC trials of COC pairs.
Consistent with the previous findings suggesting that COC behavior was significantly more effective than S&R behavior, the results revealed significant differences for containment time, t(26.54) = −6.08, p < .001, d = 2.14, and herd radial distance, t(29) = 5.94, p < .001, d = 2.16; COC behavior enabled pairs to contain the sheep for significantly longer periods and closer to the center, compared with S&R behavior (see Fig. 8b). The difference in herd area between successful S&R and COC trials was not significant, t(29) = 1.48, p > .14, d = 0.54. For comparison purposes, the successful S&R trial performance of COC pairs is also plotted in Figure 8b. Note that many of these S&R trials contained short or intermittent periods of COC behavior but were classified as S&R because they included a greater proportion of S&R than COC activity.
Dynamics of S&R behavior
The overall across-pair average power spectra for successful and unsuccessful S&R trials for each herd-size condition is displayed in Figure 9a. As can be seen, the peak frequency for all successful and unsuccessful S&R trials fell well below 0.5 Hz. For unsuccessful trials, a one-way between-subjects ANOVA revealed no significant difference in mean peak frequency as a function of herd size, F(2, 38) < 1.0, p > .65; there was an overall mean peak frequency of 0.12 Hz (SD = 0.04) for unsuccessful S&R trials. There was, however, a significant effect of herd size on successful trials, F(1, 27) = 3.57, p < .04, η p 2 = .21; Bonferroni post hoc analysis revealed that pairs in the seven-sheep condition had a significantly (p < .04) higher peak frequency (M = 0.38 Hz, SD = 0.24) than pairs in the three-sheep condition (M = 0.18 Hz, SD = 0.12). There was no significant difference between the seven-sheep and the five-sheep condition (M = 0.22 Hz, SD = 0.19) and between the three- and five-sheep conditions (ps > .13). The reason for the slight increase in the mean peak frequency for successful seven-sheep trials, as well as the overall greater mean peak frequency (and lower power) in successful than in unsuccessful trials, was that some of the successful S&R trials included in this analysis came from pairs that actually discovered COC behavior. Thus, some of the successful S&R trials actually included small or intermittent periods of oscillatory behavior above 0.5 Hz. These trials were still classified as S&R because they included a predominance of S&R behavior.

Power spectra (left graphs) and peak frequency (right graphs) as a function of herd size for (a) unsuccessful search-and-recover (S&R) trials, (b) successful S&R trials, and (c) successful coupled-oscillatory-containment (COC) trials. For both measures, overall across-pair averages are shown. Power spectra are grouped in 0.1-Hz bins. The dashed lines highlight the 0.50-Hz cutoff used to distinguish S&R and COC trials. Error bars for power spectra represent ±1 SEM and for peak frequency represent +1 SEM.
One-way within-subjects ANOVAs and Bonferroni pairwise comparisons were also employed to test for differences between the zero-lag cross-correlations calculated to determine whether S&R behavior consisted of participants herding the sheep farthest from the containment region on their side of the tabletop display. A Fisher’s r to z transformation was applied to the cross-correlation coefficient prior to statistical analysis, and all samples in which no sheep was present on a player’s side of the field (when relevant) were excluded. The mean radial-distance and polar-angle correlation coefficients, as well as the results of the statistical analysis, are shown for each sheep time-series type and herd-size condition in Table 3. As can be seen, the results were consistent with the farthest/own-side S&R strategy: Participants’ radial distance and polar angle, taken together, were more highly correlated with the distance and angle of the sheep farthest from the center of the game field on their side of the game space in all three herd-size conditions. Note that the correlations observed for radial distance for the random/own-side, farthest, and random strategies were expected to be relatively high because of the general inward movement of sheep over time as players contained them.
Mean Zero-Lag Cross-Correlation Coefficients for Different Corralling Strategies
Note: Standard errors for the cross-correlation coefficients are given in parentheses. Pairwise comparisons were calculated with respect to the farthest-sheep-on-own-side column using a Bonferroni correction.
p < .001.
Finally, the average zero-lag cross-correlations between the two players’ polar-angle and radial-distance time series were .57 (SD = .12) and .95 (SD = .02), respectively, which indicates that players in S&R pairs were overall more coordinated with the movements of the farthest sheep on their own side of the game field than they were with each other over time (again, polar angle was weighted more strongly in our interpretations given that high radial-distance correlations were expected because of the general inward movements of participants over the course of a trial). Participants were more coordinated with each other during S&R trials at longer time scales. An analysis of the maximum cross-correlation across the time delays between 0 and ±250 samples (i.e., ±5 s) revealed an average maximum cross-correlation for polar angle and radial distance, respectively, of .68 (SD = .10; average time lag of 2.26 s, SD = 0.65 s) and .95 (SD = .02; average time lag of 0.07 s, SD = 0.09 s). This pattern of longer time-scale coordination was not surprising, and it was due to the fact that when one player herded a sheep into the center of the game field from his or her own side of the game space, those (and other) sheep were often repelled into the partner’s side of the game field. On the one hand, this longer time-scale interparticipant correlation was therefore mediated by participant-sheep interactions. On the other hand, this longer time-scale interparticipant correlation was also a functional consequence of the implicit and complementary coordination between participants with regard to who was responsible for which side of the game field.
Dynamics of COC behavior
As detailed previously, 17 pairs discovered the COC strategy (4, 5, and 8 pairs in the three-, five-, and seven-sheep conditions, respectively). With regard to the relative-phase analysis of COC trials, Table 4 shows the percentage of trials averaged across pairs that were classified as in-phase, antiphase, or intermittent in-phase/antiphase, as well as the percentage of trials on which there was no stable relative-phase relationship or some other stable phase relationship (the latter occurred very rarely). Overall, the percentage of trials classified as in-phase was greater than the percentages classified as antiphase, both phase, and any other phase; these results are consistent with previous research on interpersonal and visual rhythmic coordination (e.g., Richardson, Marsh, & Baron, 2007; Schmidt et al., 1990; Schmidt & O’Brien, 1997) and the predictions of coupled oscillatory dynamics known to constrain such rhythmic coordination (e.g., Haken et al., 1985; Kelso, 1995). The greater occurrence of in-phase COC behavior compared with antiphase COC behavior, as well as both-phase and other-phase COC behavior, was particularly evident in the three-sheep and seven-sheep conditions. Although the same magnitude of difference was not observed in the five-sheep condition, the overall low movement frequency of oscillatory movement exhibited during COC behavior (see the next paragraph) could have minimized the relative difference in the stability of in-phase and antiphase behavior, the behavior of pairs in the five-sheep condition reflecting this possibility.
Percentage of Relative-Phase Modes Observed During Coupled-Oscillatory-Containment Behavior
Note: The weighted averages in the bottom row were calculated using the number of successful pairs (trials) in each herd-size condition. Standard errors are given in parentheses, and 95% confidence intervals are given in brackets for the averages.
The across-pairs average power spectra for successful COC trials are displayed as a function of herd size in Figure 9b. Consistent with COC behavior, the peak frequency for all herd-size conditions was above 0.5 Hz. Although there was a greater level of variability in peak frequency (hence flatter average power) for COC trials than for S&R trials and for the seven-sheep condition than for the three-sheep and five-sheep conditions for COC pairs, a one-way between-subjects ANOVA revealed no significant difference in average peak frequency as a function of herd size, F(2, 14) < 1.0, p > .69; the overall mean peak frequency was 0.86 Hz (SD = 0.17) for successful COC trials. There was also no apparent difference in mean frequency as a function of phase mode: in-phase = 0.83 Hz (SD = 0.15), antiphase = 0.83 Hz (SD = 0.19), both phases = 0.73 Hz (SD = 0.24), no or other phase = 0.82 Hz (SD = 0.20). Finally, it is important to appreciate that the flatter average power for the seven-sheep condition resulted from averaging the strong (rather than weak) power of slightly different peak frequencies over trials. That is, the power of the peak frequencies on any given seven-sheep COC trial was equivalent to that observed in three-sheep and five-sheep COC trials.
Discussion
The current study explored the dynamical processes that constrain multiagent coordination using a novel two-player shepherding game. The task required participant pairs to learn to corral small herds of sheep within a circular containment region in the center of a game field. Results revealed that pairs initially adopted an S&R strategy, in which coactors continuously corralled the sheep farthest from the containment region on their own sides of the game field. Of greater significance, a subset of pairs spontaneously discovered a more effective COC strategy, with coactors synchronously moving back and forth in a semicircular in-phase or antiphase manner around the sheep—establishing a “spatiotemporal wall” around the herd.
With regard to what determined whether pairs adopted COC behavior, results indicated that pairs with poorer S&R performance were more likely to discover COC behavior. This is not to say that poor S&R performance always led to the discovery of COC behavior, as exemplified by the poor S&R performance of unsuccessful pairs, but rather that poor S&R behavior resulted in pairs being more likely to seek (consciously or unconsciously) other modes of effective coordination. This is consistent with the general finding that human actors often adopt more obvious, yet suboptimal, modes of behavioral action (embracing a “whatever works” approach) during initial task performance before realizing less obvious, but more effective, modes of behavioral organization after repeated task failure (Davids, Araújo, Hristovski, Passos, & Chow, 2012). Indeed, the emergence of collective behavior is often a direct consequence of human actors needing to realize task behaviors that are beyond the scope of their individual capabilities (Goldstone & Gureckis, 2009; Richardson et al., 2007). This implies that the performance ability of coactors in relation to task difficulty reflects a generic control parameter that pushes individuals in and out of complementary and synchronous patterns of behavioral coordination (Richardson & Kallen, 2015; Roberts & Goldstone, 2011).
The fact that participant pairs were more likely to discover COC behavior when herd sizes were larger further highlights the role of task difficulty in promoting the discovery of COC behavior. It is possible that more pairs would have discovered COC behavior if given more time. However, this would only further emphasize the performance limits of S&R behavior, in which even successful S&R pairs would be expected to eventually adopt COC behavior to maximize task success. A more interesting question is why none of the behavioral measures in the current study predicted the emergence of COC behavior. That is, no single spatial, temporal, or spatiotemporal event appeared to consistently occur prior to the emergence of COC behavior. Rather, the data suggest that the discovery of COC behavior was equifinal and, moreover, reflected a “eureka!”-like event. Irrespective of whether the emergence of COC behavior resulted from spontaneous or strategic reasoning processes, the implication is that both the S&R and COC behavioral modes were inherent in the game’s underlying task dynamics (Saltzman & Kelso, 1987; Warren, 2006).
In support of this latter conclusion, a low-dimensional task-dynamic model of the shepherding game was developed (see Section C in the Supplemental Material). This model not only captured both behavioral modes within the same dynamical system using the prototypical coupled oscillator dynamics of interpersonal rhythmic coordination (Haken et al., 1985; Schmidt et al., 1990), but was also able to flexibly adapt to variations in herd size and sheep-movement perturbations and to spontaneously transition between S&R and COC behavior via a sheep-distance-dependent Hopf bifurcation. 2 Videos demonstrating the effectiveness of this model can be viewed at http://www.emadynamics.org/bi-agent-sheep-herding-game/.
With regard to the tendency of pairs to exhibit in-phase or antiphase patterns of COC behavior, it should be noted that these stable relative-phase modes were a nominal result of the visual coupling existing between coactors (Schmidt & O’Brien, 1997) and were not a functional requirement of successful COC behavior. That is, any relatively stable or intermittent relative-phase relation could have resulted in successful COC behavior. Thus, the propensity for pairs to fall into in-phase or antiphase COC behavior underscores the ubiquity with which copresent interpersonal interaction is constrained by the self-organizing dynamics of coupled oscillators.
Finally, it is important to appreciate that the S&R and COC behaviors observed here are qualitatively consistent with the behavioral patterns that define real-life sheepdog behavior (Bennett & Trafankowski, 2012). Most notably, Strömbom and colleagues (2014) observed that sheepdogs exhibit two modes of herding behavior—collecting and driving. Concisely stated, collecting involves pursuing the farthest sheep from the herd. Once collected, sheepdogs then drive the herd toward a goal location by making side-to-side motions. Similar patterns of pursuit and oscillatory behavior are also observed in team sports (McGarry et al., 2002; Yokoyama & Yamamoto, 2011), which implies that the S&R and COC behaviors observed here are context-specific realizations of the lawful dynamics that define functional shepherding behavior more generally. Accordingly, exploring more complex shepherding tasks (e.g., shepherding agents through an environmental space) not only might help further identify the dynamical principles that define complex multiagent activity, but also could have significant implications for the development of robust human-machine shepherding or crowd-control systems.
Footnotes
Acknowledgements
Thanks to Carl Bou Mansour and Christopher Riehm for help with data collection and to Steven Harrison and Richard Schmidt for helpful comments.
Action Editor
Marc J. Buehner served as action editor for this article.
Declaration of Conflicting Interests
The authors declared that they had no conflicts of interest with respect to their authorship or the publication of this article.
Funding
The National Institutes of Health (R01GM105045) supported this research.
Open Practices
All data have been made publicly available via the Open Science Framework and can be accessed at https://osf.io/7a9tt/. The complete Open Practices Disclosure for this article can be found at https://journals-sagepub-com.web.bisu.edu.cn/doi/suppl/10.1177/0956797617692107. This article has received the badge for Open Data. More information about the Open Practices badges can be found at
.
Notes
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
