Our study was built around a simple simulation constructed within the HexSim modeling environment (Schumaker and Brookes 2018). HexSim is a user-friendly, spatially-explicit, individual-based, demo-genetic modeling environment. We modeled a simulated species, and parameterized its life history, demographics, genetic traits, and an interaction between habitat type and genetics (described below). We created a minimally-complex landscape structure that varied episodically throughout our simulations. Each epoch (1,000 simulation time steps) included unique barriers, barrier gaps, or habitat types. We varied behavior (dispersal distance), strength of selection, and barrier gap permeability for a total of eight treatment combinations, and tracked individual genotypes, per-capita homozygosity, per-patch population size, and the number of dispersers moving between the patches in each treatment. Through the use of this single model, we were able to probe expected outcomes of the four focal disciplines, and test the anticipated behaviors of this eco-evo modeling approach.
Landscape Structure
Our landscape was composed of six adjacent habitat patches (two small, two medium, two large) built up from multiple hexagonal cells of uniform quality (Fig. 1). Two large adjoining patches (1326 hexagons each) lie at the landscape center. Two medium-sized patches (200 hexagons each) and two small patches (50 hexagons each) abut the large patches, but not each other. Patch dimensions expressed as columns × rows, were 26 × 51, 10 × 20, and 5 × 10. Collectively, the six patches were assembled from 3152 individual hexagons. Our simulated individuals were never allowed to enter the surrounding non-habitat matrix. Movement barriers were used, at times, to isolate the patches from each other. At other times, small semi-permeable openings in the barriers allowed limited dispersal between neighboring patches. The total size of the barrier gaps between adjacent patches was identical, ensuring individuals had a uniform potential for crossing all patch interfaces.
Individual Ecological Characteristics
Our simulations ran for a series of time steps, each corresponding to a year, with a sequence of life history events and species-landscape interactions performed at each step. In brief, the life cycle consisted of (a) resource acquisition, (b) pair formation, (c) reproduction, (d) juvenile dispersal, and (e) survival. The individuals making up our population included both sexes and two age classes (juvenile and adult), and our simulations began with the landscape being saturated with adults (3152 individuals spread uniformly across all patch hexagons). Adult females reproduced only if they could pair exclusively with an adult male located nearby (neither females or males had multiple mates). Reproductive rates were normally distributed, with means based on individual resource allocation, which introduced a density-dependent feedback that was further modified by the requirement for pair-formation. Individuals acquired resources from a roughly-circular neighborhood of 37 hexagonal cells, and resources were shared equally by all individuals attempting to utilize them (scramble competition). Juveniles dispersed from their natal site in the year of their birth, and transitioned to adults at the start of the subsequent year. Adults did not move. Dispersal path lengths were drawn from one of two uniform distributions, either “short” (1–5 hexagon steps) or “long” (5–25 hexagon steps). Dispersal paths were set at 75 on a scale of 0 (completely random) to 100 (perfectly linear), and thus were moderately auto-correlated. Individual dispersers took a series of steps from hexagon to adjacent hexagon, and stopped when their path length had been reached. Yearly survival probability was based on stage class (juvenile = 0.500, adult = 0.885), but individuals with less than 20% of their resource goal experienced an additional 10% probability of mortality. Our simulations included a period during which survival decisions were also based on genetic adaptation. In these cases, mortality rates became jointly determined by stage class, location, and genotype (see below).
Individual Evolutionary Characteristics
Our simulated individuals were diploid with ten loci and zero linkage between loci. Each locus was assigned five alleles labeled A1-A5. The starting population’s allele assignment was governed by locus-specific initial allele frequencies (Table 2). Initial allele frequencies were not spatially stratified, and we did not simulate mutation. Offspring genotypes were assembled by drawing a single allele from each parent at each locus. Individuals possessed five purely neutral loci (L1-L5), and five loci (L6-L10) containing at least one allele capable of conferring a fitness advantage. These locally adaptive alleles imparted a survival benefit to juveniles when they were in the habitat type to which they were genetically pre-adapted. The survival benefit (S) per adaptive allele was either strong (S = 0.10) or weak (S = 0.01). Modeled this way, selection was a predictable process because genotype dictated the mean juvenile survival probability. Selection was initiated at time step 3000. All ten loci were utilized for all genetic analyses described below, with the exception of adaptation, for which only L6-L10 were employed.
Table 2
Initial allele frequencies for 10-locus genotypes.
LOCUS
|
ALLELE
|
INITIAL ALLELE FREQUENCY
|
LOCAL ADAPTATION
|
1
|
1–5
|
0.20, 0.20, 0.20, 0.20, 0.20
|
Neutral
|
2
|
1–5
|
0.30, 0.25, 0.20, 0.15, 0.10
|
Neutral
|
3
|
1–5
|
0.10, 0.15, 0.20, 0.25, 0.30
|
Neutral
|
4
|
1–5
|
0.01, 0.04, 0.15, 0.30, 0.50
|
Neutral
|
5
|
1–5
|
0.50, 0.30, 0.15, 0.04, 0.01
|
Neutral
|
6
|
1
|
0.20
|
Neutral
|
2
|
0.20
|
Locally Adapted - Habitat Type A
|
3
|
0.20
|
Neutral
|
4
|
0.20
|
Locally Adapted - Habitat Type B
|
5
|
0.20
|
Neutral
|
7
|
1
|
0.30
|
Neutral
|
2
|
0.25
|
Neutral
|
3
|
0.20
|
Neutral
|
4
|
0.15
|
Neutral
|
5
|
0.10
|
Locally Adapted - Habitat Type A
|
8
|
1
|
0.10
|
Neutral
|
2
|
0.15
|
Neutral
|
3
|
0.20
|
Neutral
|
4
|
0.25
|
Neutral
|
5
|
0.30
|
Locally Adapted - Habitat Type B
|
9
|
1
|
0.01
|
Locally Adapted - Habitat Type A
|
2
|
0.04
|
Neutral
|
3
|
0.15
|
Neutral
|
4
|
0.30
|
Neutral
|
5
|
0.50
|
Neutral
|
10
|
1
|
0.50
|
Locally Adapted - Habitat Type B
|
2
|
0.30
|
Neutral
|
3
|
0.15
|
Neutral
|
4
|
0.04
|
Neutral
|
5
|
0.01
|
Neutral
|
Progression of Landscape Change
All of our landscapes were binary, consisting of habitat patches embedded within a non-habitat matrix. Our initial landscape was continuous and free from movement barriers. This landscape, hereafter referred to as Continuous, persisted for the first epoch of 1000 simulation time steps (Fig. 1). We anticipated that Isolation by Distance (IBD) would be the predominant evolutionary force in this landscape. To simulate the effect of drift alone, we then imposed absolute movement barriers that isolated subpopulations into six separate landscape patches (two each, of three different sizes) for the subsequent 1000 simulation time steps. We refer to this epoch as Isolated Patches.
Following patch isolation, we created small gaps in the movement barriers, allowing infrequent migration between the previously isolated sub-populations. Barrier gaps varied in permeability (high = 0.70 transmission probability per encounter, low = 0.02 transmission probability per encounter), affecting the likelihood that individuals would cross the barrier when they encountered a gap during dispersal. We refer to this third epoch of 1000 time steps as Semi-Connected. During the final 1000 time steps, the patches were each assigned one of two “habitat types” that conferred increased fitness to juveniles with specific genotypes. We refer to this landscape as Semi-Connected with Local Selection.
Treatments and Observable Responses
Individual dispersal behavior (long vs. short), strength of selection (strong vs. weak), and barrier gap permeability (low vs. high) together formed eight treatment combinations. Each treatment was repeated in ten replicates. For each treatment, we tracked individual genotypes, per-capita homozygosity, per-patch population size, and the number of dispersers moving between the patches. We did not track individual pedigree information. Upon completion of the simulations, we used HexSim’s report generator to create files suitable for input to the genetic software package STRUCTURE (Pritchard et al. 2000), which we subsequently used for some of our analyses.
Adult females in our model could reproduce each time step until their death, thereby producing overlapping generations. We measured generation time as the observed average age of reproducing females (Hamilton 1966). Migration rates between patches were measured during the Semi-Connected epoch. To qualify as a migrant, individuals had to cross through a barrier gap and subsequently reproduce somewhere other than their natal patch. Our migration data thus intentionally excluded non-breeders and individuals that reproduced in their natal patch after making a temporary excursion elsewhere.
Landscape Genetics
Isolation by distance (IBD) produced by dispersal limitations (Wright 1943) is a core concept in landscape genetics. We used results from the Continuous epoch to illustrate the degree of IBD for our short and long-distance dispersal treatment groups. We constructed dispersal kernels by plotting the frequency of observed dispersal distances for all individuals in all replicates, from time step 1 to 1000. We visually assessed the degree of IBD using correlograms generated by the application Alleles in Space (Miller 2005), where the average genetic distance between individuals is plotted for varying distance classes. We also plotted the frequency of observations for each distance class, to ensure that the inter-individual genetic distances were not due to underlying distribution of individuals on the landscape.
We calculated inter-individual genetic-distances resulting cumulatively from each landscape history. For ease of illustration, we subset our results as follows: for each treatment group, we randomly selected a single replicate simulation. From the selected replicate, we extracted genotype reports from the last time step of each of the four landscape epochs. From those reports, we randomly selected 25 individuals from each of the six patch locations. For those 150 individuals, we calculated a simple metric of pairwise genetic distance (number loci for which alleles differ between individuals / total number loci) using the “ape” R (v3.2.2) package “dist.gene” function with “percentage” method (Paradis et al. 2004; R Core Team 2013). We visualized the 150x150 pairwise genetic distances as triangular matrices.
Population Genetics
We used a Bayesian clustering method, implemented by the program STRUCTURE (v 2.3.4), to analyze population genetic structure (Pritchard et al. 2000). At the end of each landscape epoch, we collected genotype information stratified by putative population (patch), and imported these data into STRUCTURE. Unequal sample sizes (small patches ≈ 25 individuals, large patches ≈ 1000) interfered with the assessment of the number of subpopulations and assignment probabilities. This known limitation of the software (Pritchard et al. 2010) was easily overcome by randomly drawing a fixed number of individuals (n = 25) from each patch for analysis. In cases where there were fewer than 25 individuals extant in a given patch, genotypes were randomly selected for inclusion more than once until each patch had a sample of 25, for 150 total individuals.
We expected the number of unique genetic clusters (commonly referred to as “K”) to vary from 1 to 6 based on landscape structure. Therefore, following convention, we tested possible values of K ranging from 1 to 20. All STRUCTURE analyses were run with a burn-in period of 10,000 iterations, with an additional 10,000 analysis iterations. We performed 20 replicate trials for each possible K value using the default settings of the admixture model and correlated allele frequencies. The best supported K values were identified using two methods: 1) plotting the replicate average Ln P(D|K), and visually determining the minimum K of the curve’s asymptote (Pritchard et al. 2010), and 2) using Evanno’s ∆K method (Evanno et al. 2005). When there were close ties between supported K values from the competing methods, we considered them all for individual assignment analyses.
Conservation Biology
We calculated Per-capita Homozygosity as the percent of homozygous genotypes across all alleles and individuals within a given landscape patch. Large values of Per-capita Homozygosity could result from a few highly inbred individuals or from many slightly inbred individuals. We also examined the effect of patch isolation on allele frequencies from data collected at the ends of the Continuous and Isolated Patches epochs. We calculated three metrics of genetic degradation for each locus in each subpopulation using output from the “‘diveRsity” R package “divBasic” function (Keenan et al. 2013), as described below:
1) Allelic richness = the number of unique alleles per locus. All ten loci began with 5 alleles each.

For each metric, we calculated the mean and standard deviation across all replicates within the same patch size (small, medium, or large) and of the same initial allele frequency (equal, unequal, or rare) for each of the two time points of interest (at the end of the Continuous and Isolated Patches epochs).
Evolutionary Ecology
Population size was tracked for each patch across all time steps to facilitate measuring the response to adaptation. Additionally, we computed the change in frequency of adaptive alleles within each patch during the Semi-Connected with Local Selection epoch. L6 contained two adaptive alleles and 3 neutral, while L7-through L10 each contained one adaptive allele and 4 neutral. L6-A2, L7-A5 and L9-A1 were adaptive in half of the patches, while L6-A4, L8-A5 and L10-A1 were adaptive in the other half. Tracking allele frequencies in L6 allowed us to examine the effect of local adaptation on allele frequency in combination with asymmetric migration from adjacent patches, where the opposite allele was advantageous.
Computational Effort and Model Availability
All 80 simulations were run on a Dell PowerEdge R820 server. Individual model runs took roughly four hours of processing time to complete. Our simulations could likely be replicated at a higher speed on a modern desktop or laptop computer, and use of the server simply made it possible to run all simulations simultaneously. Both the HexSim application and the simulation models described here are available at www.hexsim.net.