Remarks on the Behavior of an Agent-Based Model of Spatial Distribution of Species

: Agent-based models have gained considerable notoriety in ecological modeling as well as in several other fields yearning for the ability to capture the emergent behavior of a complex system in which individuals interact with each other and with their environment. These models are implemented by applying a bottom-up approach, where the entire behavior of the system emerges from the local interaction between their components (agents or individuals). Usually, these interactions between individuals and their enclosing environment are modeled by very simple local rules. From the conceptual point of view, another appealing characteristic of this simulation approach is that it is well aligned with the reality whenever the system is composed of a multitude of individuals (behavioral units) that can be flexibly combined and placed in the environment. Due to their inherent flexibility, and despite of their simplicity, it is necessary to pay attention to the adjustments in their parameters which may result in unforeseen changes on the overall behavior of these models. In this paper we study the behavior of an agent-based model of spatial distribution of species, by analyzing the effects of the model parameters and the implications of the environment variables (that compo se the environment where the species lives) on the models’ output. The presented experiments show that the behavior of the model depends mainly on the conditions of the environment where the species live, and the main parameters presented in life cycle of the species.


Introduction
Agents have their own behaviors and act in order to accomplish a purpose. Agent-based models (ABM) describe individuals (agents) as a unique and autonomous entities that normally interact with each other and their environment [1]. ABM are considered computational models that show how the dynamics of a system have emerged resulting from the interactions of its entities (agents) in a shared environment [2]. ABM have been applied in several areas such as ecology, biology, engineering, climate change, and many other fields [3][4][5]. In the ecological modeling field, agent-based models (also referred as individual-based models) are simulation models that consider agents or individuals as unique and discrete entities with proprieties that change during its life cycle [6]. Normally, four classification criteria are taken into account to distinguish classical models and agent-based models in ecology: (1) the individuals life cycle reflected in the model, (2) the considered resources (like food, www.aetic.theiaer.org habitat quality), (3) the representation of population size, (4) the variability of individuals of the same age that is considered [7]. Agent-based model (ABM) brings to the ecological modeling field the ability to simulate ecological phenomena (such as distribution of species) in more realistic ways [8], allowing management and conservation of species more suitable. Several studies have shown how ABM have helped ecological modelers to create and simulate species distribution models in certain study areas analyzing and comparing its results [9][10][11]. However, uncertainty related to the ABMs outputs and the production of more realistic models output remains a challenge for modelers [3].
This paper presents the results of the analyses performed to study the effects that model parameters have on the behavior of an agent-based modeling approach which has been designed to study spatial distribution of species in actual and foreseen environmental scenarios. With that purpose, a series of simulations are run by modifying colonization scenarios in a simple heterogeneous environment.
The remaining of this paper is organized as follows: In the second section we characterize our model by describing the model purpose and behavior, as well as the life cycle adopted by the model; In the third section we perform three experiments in order to analyze and compare the results of the model in three different scenarios that mimic common real situations; In the fourth section we discuss the results of our study and present the main conclusions.

Characterization of the Model
Agents can represent several entities that have behaviors and react according to their states and their environment in different granularities (different levels of observation of the environment) [12]. A single agent from the outside of a system could be used to define a set of agents. For example, when simulating a complex system composed with another small systems, each small system can be defined as an agent, but internally representing a set of agents.
This study considers an agent as a colony of individuals (instead of one particular individual or species), that depends on the suitability of the environment to establish itself. Notice that the purpose of this model is to analyze the spatial distribution of species in a heterogeneous habitat. Suitable environment can be seen as places (habitat units) with appropriate environmental conditions and enough resources for the species to survive and reproduce. The environment consists of habitat units or cells characterized by their location (x,y) coordinates, the quantity of species in that location, and a suitability value of the cell. The suitability value of each cell has values between zero and one. Cells with values close to one are more suitable for the specie to survive and reproduce. An artificial environment was set in a grid, with a dimension of 200 × 200. From the practical point of view, characteristics of agents can be defined as follows [13][14]: -An agent is an identifiable, discrete, or modular individual with a set of characteristics and rules that drive his behavior and decision-making ability. Since we are interested in studying the spatial distribution of species, we conceptualized the agent as a square area in a geographical map. Each area has a number (may be zero) of individuals of a given species. Each species has a number of attributes such as birth rate, death rate and spread rate.
-An agent is autonomous and self-directed. An agent can function independently in your environment, and interacting with other agents, for a limited range of situations of its interest. In our model, the agents interact with their environment (habitat units or grid cell) in a way that a percentage of the species population is transferred to their neighboring cells (agents) in each iteration.
-An agent is social, interacting with other agents. Agents have interaction protocol as well as communication between agents. Agents have the ability to recognize and distinguish the particularities of other agents. In our model each agent (cell) has access to the suitability of the neighboring cells as well as to what amount of the cells are filled with the species population. Each agent exchanges material with its neighbors.
-An agent is situated in an external environment with which it interacts, in addition to other agents. In this work the agent's interaction with the environment is closely coupled with the maps of environmental variables that determine the suitability of the external environment.
www.aetic.theiaer.org -An agent can be directed by objectives, having goals to achieve in relation to his behavior. This allows an agent to compare their results with the goals they want to achieve. In our model the main objective of the agent is mostly encoded in the spread rate of the species: a greater value means that the species tries to colonize the entire environment whereas a smaller one means that the species wants to establish colonies and settle in place.
-An agent is flexible in the sense of having the ability to learn and adapt his behaviors based on experience (this requires some kind of memory). On the other hand, an agent may have rules that modify its behavior. In our model the rules of behavior depend entirely on the values of the environmental variables. Those determine the suitability of the surrounding environment hence species tend to survive and reproduce more widely in locations (cells) considered suitable. In the less suitable locations, the content of the cell will be depleted. During the implementation we followed the ODD (Overview, Design concepts, Detail) protocol [15][16][17] for the description of the model. Some of its main components are briefly presented in the following.

Process Overview
The goal of the species is to move and establish itself (survive and reproduce) in more suitable places, where the suitability values are closer to one. In this process three main parameters are taken into account: birth rate, death rate and the spread rate. These three parameters are independent of each other. However, the composite effect of these parameters on the model's output is observed. Algorithm 1 emphasizes the species' life cycle and how it was implemented in this work.
Underlying the model, it is assumed that there is a description of the suitability of the environment, its determination (a modeler's task) is outside the scope of this article. After setting the parameters of the model, the environment is initialized with the map of suitability. Similarly, the population of species is initialized. In this specific case, a random number of species is set in a randomly chosen cell. In each iteration (tick) is applied a birth and death rates for each quantity of species in each cell. The birth and death of a species are affected by the suitability of the cell. Therefore, the quantity of species in suitable places (higher suitability) grows in greater quantities compared to the places with low suitability having the same birth rate. Likewise, the death rate has a higher incidence in less suitable places. After that, the species tries to expand and colonize the neighboring cells. Each neighbor cell will receive a percentage of the quantity of species (determined by the spread rate).

Design Concepts
The species life cycle consists of three main steps: (1) at each time (tick) the species reproduce according to the birth rate and the conditions of its cell (suit-ability value); (2) an amount of species dies according to the death rate and the suitability of the cell (low suitability, more death); and (3) neighboring cells receive each one an amount of individuals according to the spread rate, see  The model uses as input data, environmental variables (maps) that influence the behavior of the species. These environmental values are disposed in a grid of cells, that contains in each cell a value normalized to the unit interval. The suitability map will be composed by these environmental variables, see Figure 2.

Selected Experiments and Results
In the reported experiments only one cell in the environment is initialized (species' origin), with a random quantity of species, the remaining cells are depleted of individuals. The location of the origin is randomly chosen between the cells with suitability values close to one (places where the species have more probability to survive and reproduce). The model considers 1000 as the maximum relative quantity of species in each cell.
Before drawing any conclusions regarding the model's behavior, several parameters combination will be tested, and its results will be compared. Combinations are made between birth rate, death rate and spread rate. For the birth and death rates the following values were chosen: 0.1, 0.3, 0.5, 0.7 and 0.9, and for the spread rate: 0.03, 0.05, 0.07, 0.09.
Three different experiments are reported. The first experiment presented in [18] shows the effects of the main parameters of the model in a setup where only one environmental variable is considered as the determinant for the species' suitability. The environment is assumed to be smoothly changing from an area of high suitability (a level next to 1) towards a hostile area (a suitability level next to 0). Departing from a small population in a suitable area, the propagation in the environment is compared to the suitability map after an equilibrium states reached.
The next experiment introduces a second environmental variable as a way to mimic the presence of migratory routes or otherwise corridors which are propitious to the development of a given species.
The third setup shows the combined effect of two environmental variables, each one with a graduation from suitability to non-suitability in different directions. It worthwhile to mention that these environmental variables are artificial, and were created only for experimental purposes, however their distribution, at least at a local level, are not far away from some situations that occur in the real environments. Due to the high number of simulated scenarios, only a selected set of results is presented.
One fundamental aspect related to these experiments was the exact time to stop each simulation (stop criteria). We run several simulations in order to find the point where the system reached the stabilization -no noticeable change be-tween two consecutive states of the model. We analyzed the differences between two sequential states of the system (time t and time t-1). In our model, the difference between one state of the system and another, lies in the quantity of species presented in each cell. Thus, we calculate the sum of the Cell-by-Cell differences in these sequential states of the www.aetic.theiaer.org system. The simulation was interrupted when this difference was maintained below a small threshold for several ticks. Figure 2 depicts an environment that is gradually changing from an area of high suitability (a level next to 1 in the bottom) towards a non-suitable area (suitability level next to 0 over the top). After randomly placing the origin of species in a suitable environment, the simulation starts with a random quantity of individuals and then the model evolves according to their life cycle. In the following we present the results off our simulations scenarios varying the spread rate for values equals to (A) 0.03, (B) 0.05, (C) 0.07 and (D) 0.09 and keeping fixed the birth rate (0.7) and the death rate (0.1). These values were used not only for illustrative purposes, but also to analyze the effect of the spread rate on the results of the model. Figure 3 shows the output of the model for different spreading ratios after reaching stability. As can be seen in Figure 3, species tend to establish themselves in locations where the environmental conditions are suitable to them in order to survive and reproduce. Excluding the scenarios where the species cannot survive neither re-produce, model outputs often follow the same pattern, although the capacity of species to expand varies according to the three parameters (birth rate, death rate and spread rate). In a first approach, doing a visual comparison between these results ( Figure 3) and the suitability map (Figure 2), it is possible to verify similarities between them. Model www.aetic.theiaer.org output follows the transition (gradation) presented in the environment map. However, a visual comparison is not enough to draw conclusions related to the model's behavior. Often, species did not survive when the values of birth rate and death rate are equal, and in scenarios where the value of birth rate is less than death rate. In order to analyze the output of the model in these different parameters' combination, Figure 4 depicts the comparison of the model's output in all scenarios with the suitability map (see the environment map in Figure 2). We converted the model output to the same scale (0, 1) of the environment map to facilitate comparison. The overall comparison technique adapted from [19] was performed for each model output. In Figure 4 it is possible to observe the scenarios with the lowest differences. The combination (birth rate = 0.5, death rate = 0.1, spread rate = 0.09) presented the lowest difference, followed by the combination (0.9, 0.3, 0.09), and the combination (0.5, 0.1, 0.07) in the same order of the rates. According to Figure 4 for values of death rate greater or equal than 50% even with a birth rate of90% the chances of the species to survive are remote. On the other hand, at a birth rate less than 20% species have few chances to survive and expand. In this regard we can say that for higher spread rates -subsumed to the hypothesis on the suitability of the species -the model can achieve a more consentaneous filling of the environment. Figure 5 shows the number of iterations necessary to reach a stability state for four different spread rates (everything else being equal). Observing the Figure 5 we notice that at the beginning of the simulation the difference between two sequential states increases very quickly. We verify the increase of the difference until a certain number of iterations and then these differences start to decrease to the point that it stabilizes. Another interesting finding is that in our model a higher spread rate promotes a quicker stability.

Conceptualization of a Suitability Corridor
For this experiment we considered the synthetic environmental variable presented in the previous section, see Figure 6-A, and we introduced a second environmental map, Figure 6-B, representing a suitability corridor (we can think of it as a migratory route, for instance). The combined suitability cell values were obtained by summing up the values of the two environmental variables and sequent normalization to the unit interval, see Figure 6-C.   According to Figure 7 species tend to colonize all the environment. Unlike the previous maps (Figure 3), where there were no conditions for the species to expand on the top, in this particular case, there are a set of suitable cells that allows species do expand. Another factor that influences the expansion of the species to the top of the map is the suitability corridor (the vertical line). This www.aetic.theiaer.org corridor allows species to reach to the less suitable locations. The difference between birth rate and death rate (0.7 and 0.1) also has a significant impact in the colonization effect, and we can observe a larger filling of the map when the spread rate is lower, see Figure 7-A. Comparing Figure 7 with the suitability map (Figure 6 C) we can observe the same pattern between them. The transition (gradation) and the vertical line presented in suitability map are also observed in the model results. Figure 8 shows the Cell-by-Cell comparison between the model output (smooth gradation + suitability corridor) and the environment map. These model results were converted in the scale (0, 1) in order to facilitate the comparison with the suitability map ( Figure 6). Doing the comparison between each simulation results (output) and the suitability map (Figure 8), we can verify that the combination (death rate = 0.1, birth rate = 0.5, spread rate = 0.09), presented the lowest difference, followed by the combination (0.1, 0.3, 0.03), and the combination (0.1, 0.5, 0.07) in the same order of the rates. Observing Figure 8, at death rate greater or equal than 70% species do not survive, even with a birth rate greater or equal than 90%. At the birth rate less than 20% the chances for the species to survive are remote. Contrary to the first experiments, the three best results were obtained with different spread rates namely: 0.09, 0.03 and0.07.
Different of the first experiment, the best results were obtained in different spread rate (0.09, 0.03, 0.07). Figure 9 shows the number of iterations necessary to reach a stability state for four different spread rates. As in the first experiment, we observe in Figure 9 that the differences between two sequential states start to grow quickly, until reach its peak. These differences start to decrease until the point of stabilization. Comparing with the previous experiment, this experiment takes longer to converge due to a greater heterogeneity of the environment resulting from the combination of two environment variables. These results show that the simulation with spread rate equal to 0.03(A) takes much longer to converge; It allows a larger filling of the map when the combination of birth rate and death rate is suitable for the species (for example: birth rate equal to 0.7 and death rate equal to 0.1).

Compound Effect of two Environmental Variables
In this experiment we consider the environmental variable presented in the first experiment, see Figure 10-A, and we introduced a second variable by rotating 90ºthis map resulting in a similar gradation but with different orientation, see Figure 10-B. The suitability map was obtained by combining these two environmental variables, see Figure 10-C.  In Figure 11 species occupy the most suitable places for them to stabilize and reproduce. Species tend to disappear in locations where the suitability values are low. We can observe in each Figures  (A, B, C and D) the gradation pattern presented in suitability map. The impact of the spread rate is highly noticeable. In the resulting suitability map (Figure 10-C) the least suitable places for the species to survive are located at top left. Therefore, species do not reach these places. As we saw in previous experiments, species colonize in more abundance for the scenarios where the spread rate is lower. www.aetic.theiaer.org Figure 12 shows the Cell-by-Cell comparison between the model output (compound effect of two environmental variables) and the environment map. The simulations results allow us to verify that for this experiment, the combinations (death rate = 0.1, birth rate = 0.5, spread rate = 0.09) presented the lowest difference with respect to the suitability map, followed by the combination (0.1, 0.5,07), and the combination (0.3, 0.9, 0.03) in the same order of rates. In Figure 12 we can verify that there are no chances for the species to live neither reproduce at birth rate equal than death rate. The lowest differences can be observed for the four spread rates: 0.03, 0.05, 0.07 and 0.09. Figure 13 shows the number of iterations necessary to reach a stability state for four different spread rates. As the simulation proceeds, the differences between two sequential states gradually increase until reach its pick. Then, the differences start to decrease until reach a point in the simulation where the differences remain in a very low range, that corresponds to the stabilization point, see Figure 13. As we observed in the previous experiments, the lower the spread rate, the longer the simulation will take to converge. www.aetic.theiaer.org

Concluding Remarks
In this study we analyzed the effects of an agent-based model's parameters in the spatial distribution of species, by implementing an ABM able to deal with a heterogeneous environment represented by a combination of (environmental)variables of interest. We performed a parametric study in order to find the parameters combination that fits the purpose of our model. The results showed that in addition to the environmental conditions, the combination of the model parameters has a significant impact on its results. Our study is limited in the sense that the environment of our model was not real, however the initial conditions of the presented experiments are well aligned with a number of real local environmental constraints that we intend to explore in future studies for the prediction of the geographical distribution of biological species (both flora and fauna) with economical interest in a setup of environmental uncertainty. Model behavior and model outputs are deeply coupled with the chosen parameters and the selected environment. The parameters of the reported model are completely independent of each other in the sense that any adjustment made to any parameter does not affect the value of the remaining parameters. However, any small change in a subset of parameters can result in drastic changes on the overall behavior of the model; the same happens if we change the environmental conditions.
In order to better understand the model's behavior, it is necessary to perform a thorough parameter analysis, and verify which are the environmental variables that compose the environment and its values. It is a well-known fact that com-prehensive analysis of the output to input variability is an important step during the development of an agent-based model [20]. Model parameterization allows the model to produce more realistic results [21]. Parameters analyzed in our study have each one its effect in the model. However, we cannot consider only these parameters individually but instead we must consider the effect that the combination of the different parameters has in the model's output. Discarding the effect of either one of the parameters will jeopardize the ability to explain the output of the model.
One of the aspects to take into account is the distinction between birth rate and death rate. In order to observe reproduction, it is important to have a significant distinction between birth rate and death rate, fixing the values of birth rate al-ways greater than death rate. This is the only case that the species can survive and reproduce. However, without spread rate there is no way for the species to expand (colonize) to other cells in the environment. Once chosen the birth and death rates, the spread rate determines if the species have propensity to consolidate the occupied places or if instead, they have a greater predisposition to colonize new territories.
The choice of parameters will always constraint the desired results. When using a model as the one described in this work one must analyze several scenarios in order to find the parameters' combination that answers the purpose of the reference model.