Computational code for wild camelids territorial expansion and competition

Published: 24 September 2026| Version 1 | DOI: 10.17632/byc5w9jxjs.1
Contributor:
Tomás Ignacio González

Description

Here, we present the original algorithms developed to simulate territorial organization in male wild camelids. The model is based on resource distribution within the habitat and individual behavioral strategies to optimize energy balance. This balance accounts for locomotion costs—determined by body mass, walking speed, and territory border patrolling—as well as energetic costs associated with confrontations with neighboring males. The first function “Sowing” is the model for the definition of the resource matrix, well described in the manuscript and Supplementary material. This function considers four arguments: N = The number of sowing points of maximum resource richness (equal to 1), placed at random locations in an initially empty matrix, Size = The dimention of the matrix, α = The propagation parameter, ranging from 0 to 1, that controls the spatial propagation of resources from these sowing points, Seed = The initial state defined for posterious stochastic process. This function returns the resulted resource matrix, for its posterior use in the simulation. The second function “LC” (Locomotion cost) is the empirical equation defined by Taylor and Heglund, based on 73 terrestial avian and mammalial species, which express the allometric relation between energetic costs of locomotion and body mass. This function considers only two arguments: m = The animal body mass, V = The locomotion speed. This function returns the total amount of energy requiered per kilogram of body mass per second of locomotion. The third function “Sim” is the main model of our research, which generates the simulation for territorial organization of wild camelids. This function takes seven arguments: Size = The dimention of the matrix, M = The total number of males considered for the simulation, T = The number of iterations, C = The energetic cost of a confrontation, u = The energetic intake per unit resource, Rat = The resource matrix (previously mated through the “Sowing” function). Seed = The initial state defined for posterious stochastic process (same as the used for the “Sowing” function). This function returns a list of states (graphs) for iteration of the simulation (G_list), as well as the body mass distribution of the males (Mass). The outcomes derived from this code will be soon featured in the publication "Energy, space and competition: A model of territorial organization in camelids" authored by González T., Abramson G. and Laguna M.F.

Files

Steps to reproduce

The user must first run the script in a Python console or platform. Then, the user only needs to call the sowing function (Sowing), the Locomotion Cost function (LC), or the simulation function (Sim), including the corresponding arguments (the selected variables and parameters).

Categories

Ecology, Animal Behavior, Animal Territory, Interdisciplinary Physics, Territoriality, Ecological Modeling Development, Animal Ecology, Biological Mathematics

Licence