Game-Theoretic Optimal Resource Allocation and Defense Strategies in Herbaceous Plants
Empirical evidence suggests that the attractiveness of a plant to herbivores can be affected by the investment in defense by neighboring plants, as well as investment in defense by the focal plant. Thus, allocation to defense may not only be influenced by the frequency and intensity of herbivory but also 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. Our model builds on a stochastic dynamic programming model that accounts for metabolic cost of maintenance of stored resources when predicting optimal resource allocation to growth, reproduction, and storage; this cost is not commonly accounted for in previous models. For both annual and perennial plants, our model predicts an evolutionarily stable proportion of cooperators and defectors (mixed stable strategy), but the proportion of cooperators is higher in a population of perennial plants than in a population of annual plants. We also show that including a metabolic cost of maintaining stored resources does not change the proportion of cooperators but does decrease plant fitness and allocation to overwinter storage.
Steps to reproduce
Software versions and packages used: The code for this project was written on a local machine running Python 3.9.12. The stochastic dynamic programming optimization and calculations were performed in and obtained from a virtual environment on a computer cluster running Python 3.10.4. The packages used are listed in Table 1 with associated versions if the libraries are not built into Python. We also denote the libraries that are not used in the local (or the virtual environment) as `N/A'. Table 1: Package Name | Version (local) | Version (virtual) ___________________________________________ numpy | 1.21.5 | 1.22.4 ___________________________________________ pandas | 1.3.5 | 1.4.2 ___________________________________________ hexalattice | 1.2.0 | N/A ___________________________________________ scipy | 1.7.3 | 1.8.1 ___________________________________________ matplotlib | 3.5.1 | 3.5.1 ___________________________________________ random, math, multiprocessing, pickle, copy | built-in Workflow instructions: NOTE: 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 1. Run parallel example file (parallel_h180_f1_A5_p.py) if you want to create the .txt file with the optimal resource allocations (stored in mod_alloc_h180_f1_A5_p.txt.zip). This step is not necessary as all .txt files are in the included .zip file. Note that the output will be approximately 2 GB. The file takes at least 20 minutes to run on a super computer. 2. Unzip the simulation_data_files.zip file. These files take up a lot of memory 3. Select the spatial driver file you want (e.g., spatial_game_annual.py) 4. Run each code cell to generate the spatial evolutionary results 5. 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 .txt files is set up so that the h value, f value, and A value are listed, followed by p if the output is specific to perennial plants and p_c0 if the output assumes metabolic maintenance cost of storage of c=0. If neither of these are present, the output is specific to annual plants. - Unzipping the simulation_data_files.zip folder will take around 50 GB of memory. In order to see what an example of the data looks like if you don't need all of the data, you can unzip the mod_alloc_h180_f1_A5_p.txt.zip folder. This will contain the data for one particular parameter combination (h = 180, f = 0.1, A = 5). Unzipping the mod_alloc_h180_f1_A5_p.txt.zip folder will take around 2 GB of memory.
National Science Foundation