DOI: 10.5061/dryad.bzkh189jh
title: Mate-choice copying accelerates species range expansion

description: Mate-choice copying is a type of social learning in which females can
 change their mate preference after observing the choice of others. This
 behaviour can potentially affect population evolution and ecology, namely
 through increased dispersal and reduced local adaptation. Here, we
 simulated the effects of mate-choice copying in populations expanding
 across an environmental gradient to understand whether it can accelerate
 or retard the expansion process. Two mate-choice copying strategies were
 used: when females target a single individual, and when females target
 similar individuals. We also simulated cases where the male trait singled
 out by females with mate-choice maps perfectly onto their genotype or is
 influenced by genotype-by-environment interactions. These rules have
 different effects on the results. When a trait is determined by genotype
 alone, populations where copier females target all similar males expand
 faster, and the number of potential copiers increases. However, when
 preference is determined by genotype-by-environment interactions,
 populations where copier females target a single male have higher
 dispersal and also expand faster, but the potential number of copiers
 decreases. The results show that mate-choice copying can accelerate the
 expansion process, although its adaptiveness depends on the information
 animals use in different contexts.
description: # **Mate-choice copying accelerates species range expansion**
 [https://doi.org/10.5061/dryad.bzkh189jh](https://doi.org/10.5061/dryad.bzkh189jh) This database contains the code used to run the individual-based simulations used to study the effects of mate-choice copying in a population expanding through an environmental gradient. These simulations show that different preference rules and mate-choice copying strategies can affect the speed of population range expansion. ## **Description of the data and file structure** The simulation code is contained in 5 different files: * **main.c**: This is the main file for the simulation. It contains the fixed parameters for the simulation (described in the comments of the code itself), the link to all the other files, and the main code to run each generation loop and the simulation itself. * **input.h**: This is the file with the parameters that were changed during the different simulations. The file also contains a description of each parameter as a comment. * **initialize.h**: This part of the code controls the initialization of the simulation, namely the declaration of the different parameters, the creation of the environmental gradient, and the creation and placement of the individuals in the environment. This part of the code also controls memory allocation and free space management. * **output.h:** This part of the code controls the sampling of the variables and the creation of the output files. The output files are described below and in the file itself. * **dynamics.h:** This part of the code controls the population dynamics within each generation. This file contains all the code related to individual viability, dispersal, mate choice, and reproduction. After running the simulations an output folder will be created. Note that some of the folders may not be created depending on the options set on **input.h**. The name of the output folder is also set in this file. The code attributes a number to each simulation within the same output folder starting with 0001. If simulation 0001 is already present, the simulation will create simulation 0002, and so on. This number is checked from the log file, so changing the filename of the log file will override the output. The output has the following structure, with **** representing the four-digit simulation number: Column -&gt; Folder for the variables by column (x coordinate)             Copy_sim_s****.txt -&gt; Column mean copy allele             Disp_sim_s****.txt -&gt; Column mean dispersal allele             Population_n_sim_s****.txt -&gt; Adult population size per column             Pref_sim_s****.txt -&gt; Column mean preference allele             Sex_sim_s****.txt -&gt; Column mean sex ratio: 0 = female; 1 = male)                     Trait_sim_s****.txt -&gt; Column mean trait allele Local -&gt; Folder for the variables by patch             Copy_sim_s****.txt -&gt; Patch mean copy allele             Disp_sim_s****.txt -&gt; Patch mean dispersal allele             Population_n_sim_s****.txt -&gt; Adult population size per patch             Pref_sim_s****.txt -&gt; Patch mean preference allele             Sex_sim_s****.txt -&gt; Patch mean sex ratio: 0 = female; 1 = male)             Trait_sim_s****.txt -&gt; Patch mean trait allele Main -&gt; Main raw output sampling all individuals - each line in the file is a sampled generation)             Coord_sim_s***.txt -&gt; Individual's positions             Copy_sim_s****.txt -&gt; Individual's copy allele             Disp_sim_s****.txt -&gt; Individual's dispersal allele             Pref_sim_s****.txt -&gt; Individual's preference allele             Sex_sim_s****.txt -&gt; Individual's sex: 0 = female; 1 = male)             Trait_sim_s****.txt -&gt; Individual's trait allele Environment_sim_s****.txt -&gt; Environmental matrix Log_name_s****.log -&gt; Log file Summary_sim_s****.log -&gt; Summary statistics for each generation ## **Code/Software** The current code is written in C and runs in Cygwin with GNU scientific library 2.3 (GSL). Instructions to run the simulations: 1\)      Install Cygwin and GSL 2\)      Change the input.h file 3\)      Get to the directory where the file is stored and type the following code in the console: gcc -c main.c -lm gcc main.c -lgsl -lgslcblas -lm -o main.exe main.exe