Skip to main content

Source code and data from: Foraging personalities modify effects of habitat fragmentation on biodiversity

Cite this dataset

Rohwäder, Marie-Sophie; Jeltsch, Florian (2022). Source code and data from: Foraging personalities modify effects of habitat fragmentation on biodiversity [Dataset]. Dryad.


Habitat loss undeniably poses a substantial threat to biodiversity, but whether fragmentation per se drives the loss of species is still widely debated. While negative consequences from fragmentation are often anticipated, many empirical studies report positive effects. However, the intrinsic mechanisms governing species’ persistence in fragmented landscapes are not yet understood. In this study, we investigated consistent personality-dependent differences in foraging behavior among individuals as a possible mechanism underlying the discrepancy of reported fragmentation effects. We devised a mechanistic individual-based model simulating the home range behavior of a competitive small mammal community based on the availability of a shared resource. Thereby, an individual’s risk-taking behavior dictates its foraging decisions at risky habitat edges, an inherent property of fragmentation per se. Our simulations show that differences in risk-taking while foraging are potentially a further mechanism contributing to reconciling the fragmentation debate. The first scenario considering risk-seeking communities showed a neutral response towards fragmentation, while the second scenario featuring risk-avoiding communities confirmed the negative effects of fragmentation. Notably, the third scenario, simulating behaviorally diverse communities including risk-avoiding and risk-seeking individuals, demonstrated a positive influence of fragmentation on biodiversity. Intraspecific differences in behavior could also enhance the temporal species coexistence (coviability) of communities threatened by an ongoing habitat loss. Our study highlights the importance of recognizing the behavioral composition of populations and communities for estimating fragmentation effects, because differences in risk-taking can influence the coping abilities of animal communities in light of fragmentation.


This repository provides the source code for the implementation of a dynamic and spatially-explicit individual-based community model as well as the used input file to derive our results. The dataset was simulated using the individual-based community model and is provided as csv-files. Their visualization, as in the paper, is included as R-Scripts.

Usage notes

The data files do not require a specific software. The model can be compiled using a C++ compiler, the setup und usage of the model are explained in the respective README. Required are a C++ compiler (e.g. clang from XCode) and Qt (, min. version 4.


Deutsche Forschungsgemeinschaft, Award: DFG‐GRK 2118/1