AgModel (1.0.0)
AgModel is an agent-based model of the forager-farmer transition. The model consists of a single software agent that, conceptually, can be thought of as a single hunter-gather community (i.e., a co-residential group that shares in subsistence activities and decision making). The agent has several characteristics, including a population of human foragers, intrinsic birth and death rates, an annual total energy need, and an available amount of foraging labor. The model assumes a central-place foraging strategy in a fixed territory for a two-resource economy: cereal grains and prey animals. The territory has a fixed number of patches, and a starting number of prey. While the model is not spatially explicit, it does assume some spatiality of resources by including search times.
Demographic and environmental components of the simulation occur and are updated at an annual temporal resolution, but foraging decisions are “event” based so that many such decisions will be made in each year. Thus, each new year, the foraging agent must undertake a series of optimal foraging decisions based on its current knowledge of the availability of cereals and prey animals. Other resources are not accounted for in the model directly, but can be assumed for by adjusting the total number of required annual energy intake that the foraging agent uses to calculate its cereal and prey animal foraging decisions. The agent proceeds to balance the net benefits of the chance of finding, processing, and consuming a prey animal, versus that of finding a cereal patch, and processing and consuming that cereal. These decisions continue until the annual kcal target is reached (balanced on the current human population). If the agent consumes all available resources in a given year, it may “starve”. Starvation will affect birth and death rates, as will foraging success, and so the population will increase or decrease according to a probabilistic function (perturbed by some stochasticity) and the agent’s foraging success or failure. The agent is also constrained by labor caps, set by the modeler at model initialization. If the agent expends its yearly budget of person-hours for hunting or foraging, then the agent can no longer do those activities that year, and it may starve.
Foragers choose to either expend their annual labor budget either hunting prey animals or harvesting cereal patches. If the agent chooses to harvest prey animals, they will expend energy searching for and processing prey animals. prey animals search times are density dependent, and the number of prey animals per encounter and handling times can be altered in the model parameterization (e.g. to increase the payoff per encounter). Prey animal populations are also subject to intrinsic birth and death rates with the addition of additional deaths caused by human predation. A small amount of prey animals may “migrate” into the territory each year. This prevents prey animals populations from complete decimation, but also may be used to model increased distances of logistic mobility (or, perhaps, even residential mobility within a larger territory).
If the agent chooses to consume cereals, then they extend time searching for a cereal patch and processing the cereals grains in that patch. Human selection preferences will drive evolutionary processes within the overall cereal population, and the selection rate be altered as a parameterization of the simulation. Two characteristics are selected for: plant morphology (which affects both grain size and ease of harvesting), and patch density (reseeding density). These are generalized into two intrinsic populations of cereals: “wild type,” and “domestic type.” Human harvesting will increase the overall ratio of domestic type cereal plants in utilized patches over time due to artificial selection in patches that are under consistent use. The ratio will begin to decrease in patches that are not used according to a diffusion rate, and the proportion of wild to domesticated cereals in all patches. Morphologically wild cereals produce fewer kcal per seed, has longer handling times, and produces fewer seeds per patch. Thus, as cereal is more frequently used, its desirable traits are enhanced (via selection), and it becomes more profitable. At the same time, however, there is a constant “diffusion” of wild-type characteristics back to patches so that if cereal is consumed less frequently, the proportion of wild type cereals will begin to increase in patches that are not used. Currently, cereal patches are accessed in the same order every year, so humans are assumed to consistently choose the “best” patches first, if/when they decide to consume cereals in a given year. The “size” of individual cereal patches is set by the maximum wild/domesticated cereal patch density values (default values assume patch size = 1 ha).
I have written AgModel in pure Python with the hope of better integration to scientific Python (e.g., pandas, matplotlib) and the open-science movement. The model has a simple graphical interface, or can be run “headless.” Optionally, experiments using parameter sweeps with repetition can be set up to run in parallel on as many available processors as desired. Careful parameterization of AgModel can test scenarios where complex hunter-gatherers engaged in foraging decisions that interacted with plant evolutionary dynamics to artificially increase the prevalence of domestic type plans in the local ecosystem. When the domestic phenotype is most prevalent, we can consider the species to be “domesticated.” The temporal dynamics of the process of domestication, however, are not linear, and the timeline and longevity of the domestication event may differ under changing environmental conditions.
Release Notes
v0.6 to v0.7
* Minor bugfix
* Added ODD Protocol
v0.5 to v0.6
* Removed HunterGathererRatio (allows this to be an emergent property)
* Added Gaussian filter to diet breadth logic
* Added randomization of prey encounter number
* Added Gaussian filter to coevolutionary selection and diffusion rates
v0.4 to v0.5
* Updated variable names for readability
v0.3 to v0.4
* upgraded to Python 3
* changes to GUI and interaction
* selection is now balanced against diffusion in utilized patches.
* diffusion is now density dependent, so that it reduces as the percentage of domestic phenotype in the ecosystem increases.
* added docstrings to classes and functions (no functional changes)
Associated Publications
Manuscript is about to be submitted to Journal of Computing Applications in Archaeology.
AgModel 1.0.0
Submitted by
Isaac Ullah
Published Dec 06, 2024
Last modified Dec 08, 2024
AgModel is an agent-based model of the forager-farmer transition. The model consists of a single software agent that, conceptually, can be thought of as a single hunter-gather community (i.e., a co-residential group that shares in subsistence activities and decision making). The agent has several characteristics, including a population of human foragers, intrinsic birth and death rates, an annual total energy need, and an available amount of foraging labor. The model assumes a central-place foraging strategy in a fixed territory for a two-resource economy: cereal grains and prey animals. The territory has a fixed number of patches, and a starting number of prey. While the model is not spatially explicit, it does assume some spatiality of resources by including search times.
Demographic and environmental components of the simulation occur and are updated at an annual temporal resolution, but foraging decisions are “event” based so that many such decisions will be made in each year. Thus, each new year, the foraging agent must undertake a series of optimal foraging decisions based on its current knowledge of the availability of cereals and prey animals. Other resources are not accounted for in the model directly, but can be assumed for by adjusting the total number of required annual energy intake that the foraging agent uses to calculate its cereal and prey animal foraging decisions. The agent proceeds to balance the net benefits of the chance of finding, processing, and consuming a prey animal, versus that of finding a cereal patch, and processing and consuming that cereal. These decisions continue until the annual kcal target is reached (balanced on the current human population). If the agent consumes all available resources in a given year, it may “starve”. Starvation will affect birth and death rates, as will foraging success, and so the population will increase or decrease according to a probabilistic function (perturbed by some stochasticity) and the agent’s foraging success or failure. The agent is also constrained by labor caps, set by the modeler at model initialization. If the agent expends its yearly budget of person-hours for hunting or foraging, then the agent can no longer do those activities that year, and it may starve.
Foragers choose to either expend their annual labor budget either hunting prey animals or harvesting cereal patches. If the agent chooses to harvest prey animals, they will expend energy searching for and processing prey animals. prey animals search times are density dependent, and the number of prey animals per encounter and handling times can be altered in the model parameterization (e.g. to increase the payoff per encounter). Prey animal populations are also subject to intrinsic birth and death rates with the addition of additional deaths caused by human predation. A small amount of prey animals may “migrate” into the territory each year. This prevents prey animals populations from complete decimation, but also may be used to model increased distances of logistic mobility (or, perhaps, even residential mobility within a larger territory).
If the agent chooses to consume cereals, then they extend time searching for a cereal patch and processing the cereals grains in that patch. Human selection preferences will drive evolutionary processes within the overall cereal population, and the selection rate be altered as a parameterization of the simulation. Two characteristics are selected for: plant morphology (which affects both grain size and ease of harvesting), and patch density (reseeding density). These are generalized into two intrinsic populations of cereals: “wild type,” and “domestic type.” Human harvesting will increase the overall ratio of domestic type cereal plants in utilized patches over time due to artificial selection in patches that are under consistent use. The ratio will begin to decrease in patches that are not used according to a diffusion rate, and the proportion of wild to domesticated cereals in all patches. Morphologically wild cereals produce fewer kcal per seed, has longer handling times, and produces fewer seeds per patch. Thus, as cereal is more frequently used, its desirable traits are enhanced (via selection), and it becomes more profitable. At the same time, however, there is a constant “diffusion” of wild-type characteristics back to patches so that if cereal is consumed less frequently, the proportion of wild type cereals will begin to increase in patches that are not used. Currently, cereal patches are accessed in the same order every year, so humans are assumed to consistently choose the “best” patches first, if/when they decide to consume cereals in a given year. The “size” of individual cereal patches is set by the maximum wild/domesticated cereal patch density values (default values assume patch size = 1 ha).
I have written AgModel in pure Python with the hope of better integration to scientific Python (e.g., pandas, matplotlib) and the open-science movement. The model has a simple graphical interface, or can be run “headless.” Optionally, experiments using parameter sweeps with repetition can be set up to run in parallel on as many available processors as desired. Careful parameterization of AgModel can test scenarios where complex hunter-gatherers engaged in foraging decisions that interacted with plant evolutionary dynamics to artificially increase the prevalence of domestic type plans in the local ecosystem. When the domestic phenotype is most prevalent, we can consider the species to be “domesticated.” The temporal dynamics of the process of domestication, however, are not linear, and the timeline and longevity of the domestication event may differ under changing environmental conditions.
Release Notes
v0.6 to v0.7
* Minor bugfix
* Added ODD Protocol
v0.5 to v0.6
* Removed HunterGathererRatio (allows this to be an emergent property)
* Added Gaussian filter to diet breadth logic
* Added randomization of prey encounter number
* Added Gaussian filter to coevolutionary selection and diffusion rates
v0.4 to v0.5
* Updated variable names for readability
v0.3 to v0.4
* upgraded to Python 3
* changes to GUI and interaction
* selection is now balanced against diffusion in utilized patches.
* diffusion is now density dependent, so that it reduces as the percentage of domestic phenotype in the ecosystem increases.
* added docstrings to classes and functions (no functional changes)