A Spatially Explicit Game-Theoretic Model of Optimal Defense Strategies in Herbaceous Plants with Herbivore Movement

Published: 25 October 2023| Version 2 | DOI: 10.17632/kk6jsjcvsx.2
Molly Creagar,


Insect behavior has been demonstrated to be influenced by the presence of certain chemicals in herbaceous plants. In particular, host plant choice by insect herbivores has been shown to depend on the the presence and odor of chemical in the plant. Thus, if the chemical plume reaches far enough, allocation to defense may also be influenced by defense strategies employed by other plants in the environment. We incorporate a neighborhood defense effect by applying spatial evolutionary game theory to optimal resource allocation in plants where cooperators are plants investing in defense and defectors are plants that do not. We use a stochastic dynamic programming model, along with ideas from game theory, to examine how defense strategies in individual plants influence population outcomes in herbaceous plants. We incorporate an individual-based model for the herbivore population and allow the herbivores to move between plants. In this case, defense is only a neighborhood benefit, and this approach yields the possibility of a population evolving to consist of only cooperators or only defectors (pure stable strategy), as well as the possibility of a mixed stable strategy. We show that our model offers a theoretical explanation for the neighborhood effect seen in empirical evidence. This research was done as part of MC's thesis. Data was obtained entirely through simulation and modeling. All code was written by MC, and all analysis, data visualization, and simulation was completed by MC. See the `steps to reproduce' for usage instructions.


Steps to reproduce

See the README file for all details. - Class files: - Hex.py ~ A class file to create a hexagonal grid and neighborhood lists - Square.py ~ A class file to create a square grid and neighborhood lists - Game_ldw.py ~ A class file to create a game object - Simulation files: - sdp_ann_h25_hm.py ~ An example of the files used to create the data stored in the pickled text files in 'simulation data_files SDP.zip' - mvmt_ann_combo9_lowLP.py ~ An example of the files used to create the data stored in the pickled text files in 'simulation data_files_SEG.zip' - Data files: - simulation_data_files_SDP.zip ~ Zip file containing the data generated from SDP simulations - simulation_data_files_SEG.zip ~ Zip file containing the data generated from SEG simulations - sdp_ann_h25_hm.txt.zip ~ Zip file containing one set of SDP simulation results - mvmt_ann_combo9_lowLP.txt.zip ~ Zip file containing one set of SEG simulation results - Other: - function_plots.py ~ File to re-create the figures in the methods section of the manuscript Packages used: numpy, pandas, matplotlib, hexalattice, scipy, random, math, copy, pickle, multiprocessing, pysal, libpysal, splot Workflow instructions: You will need to check that the files are in your Downloads folder. If working on a Windows machine, the path strings may need to be changed 0. Make sure you have the above libraries installed on your computer 1. Run the example file (sdp_ann_h25_hm.py) if you want to create the .txt file with the optimal resource allocations (stored in sdp_ann_h25_hm.txt.zip). This step is not necessary as all .txt files are in the included .zip file. 2. Unzip the simulation_data_files_SDP.zip file. These files take up a lot of memory (about 2GB), so be prepared 3. Select the spatial driver file you want (e.g., mvmt_ann_combo9_H1_lowLP.py). 4. Running the file should create a pickled txt file that can be unpickled and analyzed. 5. Changing the sdp files to the 'per' versions will give perennial plant results. Also need to change the xi_0 value in the Game class definition to -4 instead of -0.5. 6. Changing the psi() function changes the scenario for landing probability. Changing the zeta() function changes the leaving probability (From low to high, e.g.) Other: - Use the function_plots.py file to generate the plots in the Methods section Notes: - If an error occurs that says there is no such file by the name you are trying to load, check the path string - The naming designation of the SDP .txt files is set up so that the h value/toxicity is included along with the designation 'ann' or 'per' for annual or perennial, respectively -The naming designation of the SEG .txt files is set up so that the scenario 'number' is in the name, along with lowLP if leaving probability is low (nothing if it is high), the initial mean herbivore count (H1 being h_init = 1), and the same 'ann' or 'per' designation. A list of all scenario numbers is below.


University of Nebraska-Lincoln


Mathematics, Computational Mathematics, Applied Ecology, Biological Mathematics


National Science Foundation