Agent-Based Modeling : An Application to Natural Resource Management

Computer programs have been categorized as a useful tool to evaluate the complexity of systems. In fact, agent-based modeling (ABM) is considered a new method to model complex systems characterized by the role of independent and interrelating agents. Simulations contribute in estimating and comprehending emerging behaviors that require the development of new regulations for local agents that would make improvements to the system. This paper offers an example of a methodology and a process utilized to develop a simulation model named Befergyonet, an ABM used to conduct computer simulations within a spatio-intertemporal environment. The methodology discussed in this paper is intended solely to stimulate the use of innovative computer programs to simulate complex systems as an approach to represent real world events and may be a methodological guide for readers interested in developing their own ABM.


Introduction
As real-life systems become more complex, so do the analytical techniques necessary to assess and simulate them.Agent-based modeling (ABM) is one such technique.ABM is defined as a number of virtual individuals (or "agents") interacting in an "artificial, experimenter-controlled environment" [1].By enabling researchers to simulate an environment in which the agents or key players in a system can explicitly interact with their surrounding environment, enables us to better understand the system and manipulate it to achieve planning and policy I. R. González  ternally but also with the environment that they are projected to match.A system can be described as a region, an individual, a herd of animals or a nation while a subsystem is expressed as explanatory variables which might be common to some subsystems or restricted to a subsystem.When developing the model, it is important to identify first the calculations or simultaneous equations under consideration since they will be used by the computerized system.
Our agent-based model is more focused on optimizing resources available in a spatial domain in order to intensify the benefits that a diversified industry would bring to the region.For the ABM, the NetLogo platform is employed to simulate the effects of a diversified industry that enhances the environment and society as well as profitability when resources are optimized.Through our model we propose making comparisons between specialized and diversified enterprises to evaluate profitability and the resulting environmental implications within a region for clustering systems.Indeed, economies resulting from clustering and agglomeration are considered in this study as an important element of a sustainable production system.In our model (BET), we define a diversified operation as the farm of interest within the pasture-based beef (PBB) industry with the goal of generating income from beef, energy and carbon offset sales.In contrast, the specialized operation is focused solely on beef production and without explicit recognition of any clustering effect.The main purpose of this paper is to illustrate the application of agent-based modeling and simulation as a cost-effective decision-support and policy tool compared to surveys or experiments.

Agent-Based Models
ABM is considered a new method to model complex systems characterized by the role of independent and interrelating agents [2].They tend to be easier, quicker and less expensive than ordinary experiments [3].In addition, some simulation programs not only provide figures and values as outputs to illustrate the system interaction but also graphical illustrations of the system behavior as a close approach to the reality.Furthermore, ABMs, also known as individual-based simulations, are used to replicate certain scenarios in which individuals interact based on their actions or procedural regulations and distinctive parameters where their acts are tracked through time [4].Simulations contribute in estimating and comprehending emerging behaviors that require the development of new regulations for local agents that would make improvements to the system.In other words, the performance of a system is highly probable to get better when agents' activities are optimized at a local level [5].Thus, the outcomes derived from the agent-based platform such as NetLogo would have the basis to address policy instruments based on system behavior and outcomes.The benefits of ABM over other modeling techniques are best summarized as follows: 1) ABM captures emergent phenomena; 2) ABM provides a natural description  [6].The use of ABM is quite versatile and extends to a variety of different settings, ranging from health care [7] to aerospace [8].However, the spatio-intertemporal approach used here is relatively unique among known applications of ABM.

Model Development
Different simulation models have been developed through computer networks to evaluate real world problems under specific scenarios in order to approach the potential solutions that can be used by business, industry, and/or policymakers.Planners must develop systems that function harmoniously not only internally but also within the environment that they are projected to model.A system can be described as a region, individual, a herd of animals or a nation, while a subsystem is expressed as explanatory variables which might be common to some subsystems or restricted to a subsystem.It is also crucial that models do not violate the assumptions under consideration.In order to simulate management systems for a particular set of social, economic and production scenarios, maximization skills must be taken into account [9].When developing the model, it is important to identify first the calculations under consideration since they will be used by the computerized system.Also, theory, data and program are fundamental in agent-based computer simulation models [3].Moreover, the extendibility of the model is essential for future research purposes since potential users are likely to adapt the model for new applications.This way, an investigator would be able to use an existing model to add a new characteristic in order to find an answer while others may want to adapt the model to better suit their purpose [10].

Language Programming
When considering agent-based modeling, it is essential to keep in mind that procedural languages might be involved.For example, Visual Basic is accessible for spreadsheet programs making it suitable to be jointly used with Excel while having full control of a procedural language using the framework of a simple spreadsheet.This program is very useful when simple ideas need to be tested [10].Other computer programs such as Stella and Model Maker do not require programming languages which helps in saving time that might be spent on programming [3].Others such as Star Logo (a programmable environmental ABM), Pascal, C, Basic and FORTRAN are among the most common programming languages [10].Another AMB is NetLogo which is based on the language programming known as Java.Furthermore, once the system is conceptualized, it can be described either through equations or verbally.In order to describe cause and effect relationships, mathematical models are applied by animal scientists.Let's say, "phenotype of progeny" is a function of dietary requirements as a function of carcass measurements.Other models describe pasture production based on a particular species while still others consider different species, and the consequences of foraging.Since simulation results are the end point of the functions developed for the model, they must be cautiously interpreted.The necessity of conducting production research can be replaced by effective models that simulate production [9].For instance, Carter, along with the US Geological Survey, developed a spatially-explicit model of animal behavior, in which pasture consumption and animal movement were jointly analyzed [4].

Platform Considered
Since the focus of this study is on simulations using an ABM known as NetLogo, it is significant to point out some of its features for a basic understating of the program.This is a free of charge model developed by Northwestern University and suitable for developing complex systems.It provides manuals, dictionary, tutorial and other mechanisms to help users in the development process.Net-Logo provides different alternatives in which the system that needs to be explained can be built up.For instance, the simulation can be performed by adding the codes in the procedures tap and linking them to functional features such as buttons, sliders, monitors, and switches among others available in the interface tab which allow the simulation to begin and stop as well as to modify the conditions or parameters of the system.Simulations can also be done by interconnecting a system dynamic diagram with the codes developed in the procedures tab and with the interface functional features.Depending on the programmer's approach, the system behavior could also be graphically illustrated or viewed in what is called the "view or world window" that is based on coordinates and the codes expressed in the procedures tab in which the boundaries and topology of the world are defined.

An Overview
BET is a simulation model based on agent-based modeling that permits the evaluation of PBB and renewable energy production as well as carbon offsets as a function of environmental variables from a deterministic and stochastic perspective.The model also employs R-extension as a tool to conduct statistical analysis developed by [11].BET allows an approach to compare potential beneficial environmental effects as well as profitability under certainty and uncertainty.The model is composed of two key elements: the supply and the environmental and economic impacts interconnected through high quality beef, renewable energy and carbon dioxide emissions reduction within a specific region simulating the interaction among agents spatially distributed bringing some economic and environmental implications to the whole system.
BET simulates pasture growth as a function of daily precipitation, solar radiation, and temperature; electricity production based on manure generated and its associated carbon offset based on methane captured in an anaerobic digester during the winter season (November to April).The association among methane emissions and CO 2 arises from the fact that methane has 25 times the global warming capacity of CO 2 ; however, when one ton of methane is utilized for energy production, it releases one ton of carbon dioxide.This implies that burning one ton of methane is equal to reducing twenty four tons of CO 2 [12].
Thus, the equivalence to CO 2 emissions in terms of methane is called carbon dioxide equivalent (CO 2 e) emissions.Furthermore, our model interconnects the benefits and costs associated with PBB and renewable energy production and subsequently carbon reductions by maximizing the pasture available in a specific region among farms within a radius of distance in a planning horizon of 15 years under certain and uncertain conditions.BET is an experimental approach that also evaluates potential clustering development in which resources available such as cattle, forage allowance and manure generated within the sector are optimized within a spatially interconnected industry on a yearly basis.We employ 11 assumptions throughout this experimental approach as describe in Table 1.
This ABM is composed of pre-interaction and interaction stages.During the pre-interaction stage, the model simulates pasture growth as a function of daily irradiance, rainfall and temperature as well as latitude based on historical data for 15 years for the deterministic and stochastic approaches in order to obtain the control variable or the optimal stocking rate per year over the entire spatial domain.During the interaction phase, the interactive world becomes active and The farm of interest is a beef supplier under an agreement in which the average stocking rate over the planning horizon is the minimum stocking rate to be sold at the end of each operational year.

Assumption 9
The slope in the contracting farm is flat while in the nearby farms might differ.
Assumption 10 90 percent of the manure in the spatial domain is recoverable.
Assumption 11 Manure is completely mobile across space and collected during winter season.
the interaction among agents takes place generating emerging patterns and data based on their rational behavior.In fact, the model is designed to be run for a total of over 10,900 iterations repeated from 5 to 10 times for each scenario exercised in order to obtain a fair variability from the stochastic simulation.We employed a total of seven scenarios in which every scenario (under the existence/absence of carbon prices and cost-share programs) was tested under six hypothetical clustering systems, specifically from zero to five clustering members as depicted in Table 2.
This simulation experiment was designed to evaluate potential influences from a diversified pasture-fed industry in most counties in WV based on data available as a representation of the Appalachian region.We used Monongalia County for the different scenarios exercised on this simulation; however, the model can be run for any other county to simulate the potential impacts for the proposed industry on each county.
NetLogo allows choosing important elements such as stocks, variables, flows and links to perform the simulation in a dynamic format [13].For instance, each of these elements is identified and linked to each other so it simulates the variables that influence the flows that eventually reduce or increase the stocks values over time.In this model, the daily pasture growth and forage available for grazing and hay, beef production, electricity generation from anaerobic digester, manure production, carbon offset and CO 2 baseline have been categorized as stocks.On the other hand, some variables are represented as values or expressions that would have an effect on inflows and outflows (represented as pipelines) and available through arrows in the system dynamics modeler.In this model, environmental as well as economic variables are integrated in the system dynamics as a form of extraction rates such as forage intake and carbon offset rate as well as costs and net present values associated with the daily interactions.
The advantages of this agent-based software consist of: 1) the capability to integrate routines written in Java language into the model and synchronize language programming with the systems dynamic modeler; 2) the capability to provide instructions to users before, during, and at the end of the simulation; 3) the availability to illustrate the interaction among agents and space through graphs as well as visual representation; 4) the flexibility to export simulation results in different file extensions such as txt and csv for further analysis in other programs as well as during the simulation in its interface view; 5) the ability to develop a control panel to manipulate the initial conditions and parameters of the model; 6) the advantage of importing data to be used in the simulation; 7) flexibility of using extensions (BET employs R-extension) to perform statistical instruments during the simulation.
In our approach, a system dynamic modeler was developed in order to capture the dynamics over time and space expressed through mathematical equations using NetLogo.Figure 1 and Figure 2 present the system dynamic modeler of the concept proposed.In the system dynamic diagram, links allow a value from a variable or stock into a stock or flow making them available from one source to another in order to perform the simulation [13].As we can appreciate in Figure 1, the largest rectangular boxes represent the stocks that are influenced by the pipeline-shapes that store equations composed of values located either in the code tab, the interface view or in the variables presented as green rectangular boxes (smaller boxes) in the diagram while the arrows or links connect values among the previously explained components.Note that some variables are connected to more than one arrow when variables are used in other functions allowing for multi-use and eliminating unnecessary replications of the same variable in the system such as the "Pgr-Temp-Adj" variable that is used by "RGR-ENV" and "RGR-ENV-STOC" depicted in Figure 1.
The stocks are able to change over time due to the influences caused by changes on their flows.The flows are affected by changes in the values of their variables and time making the stocks either to increase or decrease over time.
These variables might be identified as a parameter or value stored in the variable or identified in the interface view under the simulation control panel.Thus, the interactions taking place in the whole system would basically have an impact on stocks that eventually will be reflected on production, profitability among other components of the system.Figure 2 shows a closer view of one of the segments represented in the complete flowchart or diagram.
Additionally, the main simulated equations utilized for the system dynamics are discussed in details under "Simulated Equations and Assumptions".In order to run these simulated equations, the system dynamics needs to be well-synchronized with language programming considering time and space.Figure 3 illustrates part of the code developed for the simulation.This code shows a segment of the first steps to create the agents in BET in which NetLogo identifies as "breeds".The coding section is crucial for ABM developed with NetLogo and requires trials and errors, especially if the model has never been built before.on-line-efficiency, Net-Energy-Content, etc.) that might be identified as a parameter or value stored in the variable or identified in the interface view under the simulation control panel.The flow changes depending on changes in variables during each iteration proving different values over time while the links (arrows) help make values available from one section to another.Then, the energy produced is accumulated in the stock called "Generation".Notice that "Generation" also depends on changes in the flow identified as "Biogas-Production-Head" making this a dynamic system along the planning horizon.
Figure 3. NetLogo-Programming Language in Java.Note: In the coding section, the interacting elements of the "world" such as agents and global variables among other components are created and synchronized with the system dynamics modeler.

World
The NetLogo simulated world consists of a 49 by 49 grid of coordinates with a patch size of 3 (world landscape) in which agents ("turtles" and "patches") interact based on the resources available throughout space.In our ABM, dynamic and static agents are identified as farmers, farms, stocking rates, vegetation, tractors, manure storage, anaerobic digesters, manure transporters, silage hauling trucks, pasturelands (green) and roads (gray).The interaction among these agents on the system is eventually reflected in the production of final products as well as returns to the farm of interest.In fact, it is intended to simulate a realistic model of plan-animal interaction based on entrepreneur decisions within an emerging PBB industry.

Farm Locations and Farmers
There are a total of nine farms spatially distributed.Every farm in the spatial domain relies on 93 acres of pastureland which is divided into 6 paddocks of approximately 15 acres each where10 patches represent one acre in NetLogo terms [14].Figure 4 shows the interactive system developed as a representation of the system to be simulated.The farm of interest is a stocker farm identified with the color red surrounded by adjacent cow/calf farms (gray), stocker farms (brown) and one silage farm (blue) within a radius of approximately 20 miles derived from the interaction among participating farms in the clustering system and invoked by the farm of interest.Farms are distributed throughout a grid of patches identified by their coordinates allowing the simulation to measure their distances when the clustering system is activated.On the other hand, the model also simulates farmers' interaction with the livestock during the grazing season by rotating it from one paddock to the next within an intertemporal context.This interaction provides a close to reality representation of a PBB industry where the land resources are optimized.This occurs when the forage system fits with the total amount of livestock as an approach to undertake appropriate pasture management techniques [15].

Stocking Rate
It is assumed that the daily pasture intake per head is 3 percent of its body weight [14] [16] [17] with a daily weight gain of 1.5 and 0.87 pounds on a daily basis during grazing (May to October) and winter (November to April) seasons, respectively [18] [19] [20].It is also fundamental to point out that we employ a daily pasture intake of 3 percent of body weight as an approach to get high individual animal performance.In fact, the increase of grazing intensity would cause a competition effect between forage nutritive value and quantity [21].Thus, the relationship between forage nutritive value and quantity of pasture available is taken into account when the stocking rate is optimized.Furthermore, the livestock grazes 2/3 of the paddocks while 1/3 is used for hay or silage for winter feed each year based on expert opinion.The livestock is composed of an Angus breed with an initial weight of 500 pounds [14] [22].Purchasing at the end of April from adjacent cow/calf farms and grazing is assumed to start in early May and moved to a building during the winter season where animals are fed and manure is collected.In fact, BET identifies the closest cow/calf farms and the amount of livestock (calves) available to fit the maximum sustainable stocking rate needed in the contracting business creating a clustering between the farm of interest and cattle suppliers each year.
The stocking rate is derived during the first stage of the simulation and randomly distributed on paddocks by the farmer during the second phase of the modeling.During the grazing season, animals are rotated between paddocks for optimal forage consumption.After reaching approximately 900 lbs.In April, when the animals are sold for slaughtering, a new stocking rate is introduced to begin the annual operational cycle over again.It is important to mention that beef prices are seasonal which tends to reach the highest during April compared to October with a difference of approximately 5 percent [23] making appealing to beef producers to sell during this particular season.However, our approach employs annual average prices. 1)Manure Hauling Trucks.These trucks simulate the manure haulers transporting the manure from adjacent cow/calf farms to the farm of interest during the winter season.The manure collected during this period of time is used to generate electricity and carbon offsets in the contracting business.
2) Silage Transporters.These trucks simulate silage transportation from the closest silage supplier to the farm of interest and nearby stocker farms.This occurs when the forage production on these farms are limited to satisfy the amount of animals purchased on an annual basis.
3) Carbon Offset Counter.It is a static agent with the purpose of explicitly illustrating the amount of the current CO 2 equivalent reductions that have been reduced during the winter season.Although this static agent does not move, it indeed depends on the carbon offset stock developed in the system dynamics modeler for execution. 4)Lagoon.This static agent simulates a manure lagoon or pond to explicitly show the CO 2 e baseline that would be generated from manure during the winter season if it were deposited into a pond instead of using it for electricity generation.This agent depends on CO 2 e emissions generated in the system dynamics. 5)Manure Collection Counter.This agent is the manure storage in the farm of interest.This is another static agent with the main function of illustrating the amount of manure collected during the winter season in the interacting world. 6)Anaerobic Digester.This agent represents the daily electricity generated from the manure collected during the winter season.This agent is located at the contracting farm in the simulated world. 7)Paddocks.Paddocks play an essential role in the PBB industry since it contributes in optimizing the amount of pasture available.In other words, they represent the grazing area in which animals are exposed to a natural environment for approximately 180 days. 8)Pasture.The forage is represented through green patches that interact with the stocking rate when consumed.In our model, pasture is represented as tall fescue-clover mix that, once it is consumed at the stated stocking rate, takes approximately 30 days to grow back. 9)Roads.This is the area in which manure, silage and cattle trucks transport their inputs from nearby farms to the farm(s) making the request for beef and electricity production.These are basically patches designed to represent the pathways for the mobilization of the resources needed within the region. 10)Winter Building.The structure in which the stocking rate is placed for the winter season is fed with forage.Also, it is the location for manure collection which is transferred to the adjacent anaerobic digestion system. 11)Trees.This simulates the typical surrounding vegetation in a PBB farm representing seasonal changes during an operational year.As a result of intertemporal changes, trees change color as a representation of the four seasons in WV based on current temperature. 12)Links.Links are useful agents with the main purpose of connecting the clustering system during simulation.They also measure the average distance in miles among the members of the cluster during the interaction phase. 13)Silage Tractors.These tractors simulate hay collection for winter season.
They collect forage only on 1/3 of the total acreage or 2 paddocks out of the 6 paddocks in which the area is fertilized approximately a month before pasture collection.Also, these agents are invoked by the farm of interest at the end of Spring and Summer seasons every year throughout the planning horizon. 14)Fertilizer Applicators.It is assumed that the fertilization season starts in April at a rate of two paddocks per month.This agent is also invoked by the farm of interest and takes place during the interaction stage. 15)Cattle Hauling Trucks.These trucks simulate the supply of cattle from the cow/calf farms to the farm of interest.This event occurs at the beginning of each operational year before grazing season starts.

Selections: Buttons, Choosers, Switches and Monitors
1) Buttons.The first buttons under the "Simulation Control Panel" (SCP) are categorized as "System Setup", "Simulation" and "Simulation by Step".They have been designed to setup and refresh the initial conditions, run the simulation continuously until reaching the planning horizon and run the model step by step or one iteration at the time.
2) Clustering System.The model allows selecting the composition of the clustering system for manure supply by changing the number of farms in the system from the chooser "Clusters" under the SCP.This allows users to perform the simulation under different clustering systems for sensitivity analysis generating some economic and environmental impacts within the region.It allows users to select from 0 to 5 clusters to simulate their interaction and their influences within the system or world.
3) Distance Factor.The "Distance-Factor" permits users to select an estimated radius distance from the farm of interest with respect to adjacent farms.For the purpose of our experimental model, the system measures a radius distance of approximately 20 miles [24] by using a distance factor of 0.5.The distance factor has been created to provide some flexibility to potential users that might desire to choose different mile distances within the clustering system.In fact, users have the option to select 0.4, 0.5, 0.8, 1 or 1.2 to represent an approximation of 15, 20, 30, 40 or 50 radius mile distance between farms, respectively. 4)County Selection.The "Country-WV" permits county selection to execute the simulation based on specific county data in order to identify the potential environmental and economic impacts in a specific region.Due to lack of data, most of the counties in WV can be simulated in BET.
5) Initial Weight.The "Initial-Weight" option allows selecting the initial weight per head at time zero.In this experimental study, we define 500 lbs.as the initial weight based on a survey conducted of farmers in the pasture-fed beef industry at the national level [22] and reach a final weight of approximately 900 lbs. at harvest.However, this chooser permits users to select an initial weight between 400, 450, 500 or 550. 6)Carbon Price.The "Carbon-Prices-List" provides a list of the commonly used carbon prices [12] [25] in order to perform a sensitivity analysis based on changes in carbon prices assuming the existence of a carbon market.In fact, it is expected that pressure to decrease greenhouse gas emissions could begin increasing in the future; therefore, carbon prices would eventually rise significantly.However, uncertainty still exists with regard to the carbon offset market in a cap-and-trade framework [12].This is one of our parameters for policy recommendations.
7) DM-Intake-List.Although our default dry matter intake is 3 percent, BET provides the option of changing this percentage.This was done for the benefit of prospective users of the model providing some flexibility in simulation performance. 8)Switches.Switches displayed in the SCP, like for example, "Show-Weight?","Show-Manure?","Show-CO 2 -Baseline?","Show-CO 2 -Offset?", "Show-Electricity?" and "Show-Profitability?" are used to either activate or deactivate stocking rate weight, manure production, CO 2 baseline generation, carbon offset, electricity production on a daily basis while the business economic performance is shown at the end of the simulation, respectively.The values are explicitly presented as tags or labels in some of the dynamic (animals) or static (manure storage, anaerobic digester, pond or manure lagoon and the carbon offset counter) agents while the interaction is simulated. 9)Monitors.Monitors were incorporated in our model since they keep us updated about the state of the simulation.For instance, "Transportation Frequency" shows the number of trips manure hauling trucks need to execute during the winter season (from adjacent farms to the farm of interest) and being requested by the farm of interest.The "Average Radius Miles" shows the average miles between nearby farms and the farm of interest when the clustering system is active.Also, the "Pre Interaction: Days" and "Interaction: Days" are monitors able to keep track of the days or iterations before the world and during the world interaction.The "Slope Range: Farm of Interest" and "Slope Range: Nearby Farms" represent the slope range on these areas based on the data collected from the Web Soil Survey [26].In this model, we use the average slope which is prompted through the SLOPE-ADJUSTMENT variable in BET based on coordinates identified on the Web Soil Survey and monitored under the "Terrain Slope" section in the interface view.The sloping factor is based on slope ranges for specific locations in which slopes within ranges between zero to ten percent, eleven to thirty and thirty one to sixty are adjusted as 1.0, 0.7 and 0.3, respectively.Furthermore, the death loss percentage is monitored under both certainty and uncertainty simulations.The county location is also displayed through the "Latitude" monitor under the "County Selection". 10)Cost-Share Program.The "Cost-Share-Program" selection provides a list of percentages that can be hypothetically considered as a policy development tool in order to share the costs associated with the initial capital investment needed to afford the anaerobic digester in the PBB industry.This allows users to choose from different cost-share options, especially when conducting sensitivity analysis toward profitability.

Outcome from Emerging Patters: Results Generation
Besides the interaction within the system illustrated in the interactive world, BET has been conveniently programmed to provide simulation results in several forms. 1)Plots.Plots are graphical representations of the system interaction in which stocking rate, pasture growth rate and average temperature and precipitation rate and depicted over time during the first simulation stage.Others plots are illustrated such as daily beef production, renewable energy generation and carbon offset as well as CO 2 emissions during the second phase of the simulation performance.
2) Output.The model also provides results of the stocking rate based on the system interaction in the interface window below the "Simulation Results" box during the two phases of the simulation.Although complete outcomes are stored in a spreadsheet, this allows users to have a quick view of some of the results.
3) Total Outcomes.Outcomes from the ABM can also be exported to a spreadsheet for further evaluation once the simulation is completed.This way, a more comprehensive database is generated that can be accessed through a program such as MS-Excel for comparison purposes and further analysis.In order to perform this task, a window providing instructions appears before the simulation takes place right after the "System Setup" button is clicked.After this task has been executed, it is just a matter of choosing the conditions explained under section "Selections" and by clicking either "Simulation" or "Simulation by Step" button to perform the simulation.

Simulated Equations and Assumptions
Since the BET model is a dynamic model that interacts based on interconnected equations as well as coding, we present the main equations (Equations 1 to 37) used for the simulation illustrated below.However, the Java code or language program developed in NetLogo provides complete information of the entire combination of equation and the code required to perform the simulation.The complete model has also been made available at the NetLogo User Community Models website at http://ccl.northwestern.edu/netlogo/models/community/BEFERGYONET%20MODEL as a contribution for researchers and other parties interested in either using, extending or learning more about the model.As an initial condition at time zero, we are assuming that an initial pasture mass is 1400 pounds per acre [17] [27] while the soil organic matter value has been identified as 6800 Kg/acre.As a way of simplifying the complexities described in our theoretical approach, our soil organic matter assumption is based on a 2 inches soil layer with a 3 percent organic matter in which 58 percent is composed of carbon or 7900 Kg [28].In fact, under acceptable management practices, state variables would reach equilibrium when the control variable is under optimal conditions and the time horizon is sufficient.In other words, the system is intended to reach a productive pattern that can be sustained by keeping it under a stable operation [29].Nonetheless, the use of manure as fertilizer may differ among the literature reviewed.For instance, the implications of using tall fescue grass and clover mix as the primary diet for animals might require approximately 200 lbs.per acre on an annual basis [30] [31] to assure the nutrients needed in the soil for plant growth.In fact, the percentage composition of manure produced by beef cattle is typically 0.54, 0.18 and 0.39 with an approximation of 3:1:2 in terms of nitrogen (N), phosphorus (P) and potassium (K) (Rayburn et al., 2006).On the other hand, approximately 1025 pounds per acre of biosolids from anaerobic digestion systems can be applied in tall fescue fields [32].Thus, in order to assure that the pasturelands acquire the necessary nutrients, 620 pounds of digested manure are applied per acre annually which might not a limitation since in the contracting farm over 1500 lbs. is produced per head annually.Assumption 1: Initial pasture mass is 1400 lbs.per acre while soil organic matter is 6800 Kg/acre.In our approach is also assumed that the daily pasture intake per head is 3 percent of its body weight [14] [16] [17] with a daily weight gain of 1.5 and 0.87 pounds on a daily basis during grazing and winter seasons, respectively [18] [19] [20].Furthermore, the livestock grazes 2/3 of the paddocks while 1/3 is used for hay or silage for winter feed each year based on expert opinion.
Assumption 2: Dry matter intake per day is 3 percent while daily weight gain during grazing and winter season are 1.5 and 0.87, respectively.Assumption 3: 2/3 of the paddocks are for grazing while 1/3 is used for winter feed.
In our model, pasture is represented as tall fescue-clover mix that, once it is consumed at the stated stocking rate, takes approximately 30 days to grow back.

Pasture Growth
The pasture growth equation is a dynamic equation intended to estimate relative plant growth rate of forage crops based on daily solar radiation, precipitation events, coordinates as well as minimum, average and high temperatures simulated in NetLogo based on expert opinion (Ed Rayburn, Forage Extension Specialist, West Virginia University) [33] [34] [35].This equation is crucial in our simulation model since the optimal consumption of the pasture available mainly determines the optimal stocking rate for each year and eventually, beef and electricity production as well as a carbon offset.In addition, our simulation considers a rest interval of approximately 30 days for tall fescue-clover mix to regrow after grazing as well as silage collection [17] [30] since "erect-growing forage species" have been identified as best to be used also for silage or hay due to their high yield potential [36] which are frost seeded every three years in order to supply a considerable component of the cattle's diet.In fact, a survey conducted of PBB producers at the national level identified cool season grass-clover as an extremely important component of the forage system [22].Furthermore, studies in which the grass-legume mixture as tall grass-clover has been compared to other grass-legume mix (tall-grass alfalfa and bluegrass-clover), have demonstrated that tall grass-clover presents faster growth rate on average than other mixtures [37].In BET, every farm in the spatial domain relies on 93 acres of pastureland which is divided into 6 paddocks [14].
Assumption 4: Pastureland in the PBB industry is predetermined.Assumption 5: Forage is a tall fescue-clover mixture.

Daily PA RGR ENV RGR MAX = *
(1) The daily pasture growth rate per acre (Daily PA) is defined as relative growth rate associated with the total environmental interaction (PGR ENV) times the expected maximum pasture growth rate (PGR MAX) in which PGR MAX is assumed to be constant with a value of 60 (lbs./acre).

RGR ENV RGR TEMP RGR DL RGR H O
The RGR ENV depends on the relative growth rate due to mean air temperature (RGR TEMP) times relative growth rate based on day length multiplied by expected maximum pasture growth rate (PGR MAX) and the relative growth due to available soil water (RGR-H 2 O) in which RGR TEMP is defined as follows: where UPCT is defined as Upper Critical Temperature and UPOT is as Upper Optimum Temperature.
However, if TAVE < LCT; then RGR TEMP = 0.In order to estimate daily evapotranspiration or the movement of water to the air from sources such as soil, the following equations are employed to measure solar radiation on a given day of the year (DOY).

LATRAD PI LAT 180
= * ( ) LAMBDA represents the solar longitude which depends on D, the number of days following the vernal equinox (March 21), as follows.
If D is greater than 186; then LAMBDA equals D -186; otherwise, LAMBDA is equal to 180 times D divided by 186. ( D DOY 80 = − Furthermore, R is the radius vector which is basically defined as the ratio of the earth-sun distance and its mean that also depends on LAMBDA. ( ) ) On the other hand, SP characterizes the daily total of potential solar radiation on a horizontal surface at a given location while H represents the hour angle.It is important to mention that SP is identified as an extremely valuable parameter due to the fact that its flux density is highly correlated with the standard

ASW PREVIOUS ASW PRECIPITATION PREVIOUS EFF ET ASW MAX
In addition, the available soil water at the current day (ASW) takes the following form.

If PREVIOUS ASW + PRECIPITATION -PREVIOUS EFF ET > ASW MAX;
then ASW = ASW MAX; otherwise ASW is defined as PREVIOUS ASW + PRECIPITATION -PREVIOUS EFF ET.
Likewise, the amount of rainfall available on a daily basis plays a crucial role in our model.Despite the fact that other variables such as temperature and coordinates are fundamental in our pasture growth model, rainfall is the key player in our equation and it is introduced through the PRECIPITATION variable.Actually, changes in climatological conditions between years cause forage fluctuations significantly in which inadequate rainfall induces a reduction on pasture growth [31] [37] [38].
Also, the PREVIOUS ASW is the lag of the variable ASW or the available soil water from the previous day while PREVIOUS EFF ET is the previous day's evapotranspiration based on ASW-PCT (the available soil water today expressed as a percentage of ASW MAX or ASW divided by ASW MAX) in which ASW MAX is the maximum available soil water that the soil can hold that has been defined as: ( ) In this equation, RYE represents the soil realistic yield expected which is defined as a constant equal to 4.
On the other hand, EFF ET, the effective evapotranspiration due to ASW PCT = 0 when ASW PCT ≤ 0. In addition, when the variable ASW PCT equals 0; then EFF ET takes the following form: Here, the EVOTRANS vs PANEVAP variable represents the ratio ET to weather station pan evaporation for cool-season forages (such as tall fescue) with a value of 0.79.( ) In addition, when DOY (day of the year) = 1, REL CUM GROWTH, the variable representing relative cumulative pasture growth is set to zero.On the other hand, when DOY > 1 this variable takes the following form: REL CUM GROWTH = PREVIOUS REL CUM GROWTH + RGR ENV; in which the PREVIOUS REL CUM GROWTH represents the lag of REL CUM GROWTH or the REL CUM GROWTH of the previous DOY.The other variable employed is the CUM GROWTH which is basically the growth accumulated over time defined as: For the stochastic pasture growth, some of the previous equations were modified as an approach to integrate stochastic precipitation in order to provide a better representation of the climatological events in real life.In our approach, we use precipitation due to the fact that pasture yield relies heavily on rainfall [39].
In fact, we employ the same fifteen years of daily historical weather data utilized for the deterministic simulation [31].Our approach for the stochastic daily rainfall is based on the mean weekly precipitation and its standard deviation from normal distribution [40].
Another variable incorporated in our simulation is the death loss based on percentages employed in previous studies [14] [41] [42].In our ABM, this variable has been set up as two percent every year under certainty while the stochastic variable is a random number up to three percent that changes on an annual basis throughout the planning horizon.
Assumption 6: Death loss is 2 percent under certainty while under uncertainty differs annually.

Stocking Rate
The amount of steers for the annual operation depends on the forage capacity grown on the farm on a yearly basis and the slope of the terrain.In order to identify the maximum sustainable amount of animals on each farm in the entire region in our ABM, our approach is based on [34] [35] [38] [43].In fact, the management decision of using rotational grazing induces stocking rate to utilize more of the pasture available resulting in increased animal grazing days per acre [17].The optimal stocking rate is bounded by the pasture availability and the average slope [26] identified for specific locations and implemented in the model based on sloping factors [38].In effect, the slope in the farm of interest is assumed to be flat as suggested in our theoretical model while in adjacent locations may vary depending on the specific data for that particular location at the county level.Furthermore, since the model maximizes the pasture available within the entire simulated system, the farm of interest would not need to interact with adjacent silage farms because the maximum sustainable stocking rate depends only on the forage available at the farm of interest; however, it might not reflect reality.
In order to incorporate the interaction among the adjacent silage suppliers in our interactive model, the average stocking rate throughout the entire planning horizon is assumed to be the minimum amount of cattle required by the buyer at the end of each operational year in both stochastic and deterministic simulations.Thus, when the optimal stocking rate in the contracting farm (farm of interest) is expected to be lower than the amount agreed with the final product purchaser due to pasture limitations, the farm of interest requests the adjacent silage farm to supply the silage needed in order to satisfy the forage demanded by the minimum amount of livestock agreed.This emerging pattern allows our simulation to have a closer approach to real agent interaction.In fact, BET has been programmed to measure the average stocking rate throughout the entire planning horizon which represents the minimum number of livestock to be sold at the end of each operational year.This permits the interaction between stocker farms and the silage provider solely when the maximum sustainable stocking rate is below the average stocking rate.
Assumption 7: Hay is completely mobile across space.Assumption 8: The farm of interest is a beef supplier under an agreement in which the average stocking rate over the planning horizon is the minimum stocking rate to be sold at the end of each operational year.
Under the assumption that the precipitation does not vary between the farm of interest and adjacent farms and the slope in the farm of interest is flat while in nearby farms might differ, we identify the maximum sustainable stocking rate as follow: ( ) where total usable TOTUSFOR is Total Usable Forage is defined as the total forage production per acre times the total amount of acres available (ACRES) in where, WH is Weight Head, DMDI is Dm Daily Intake and DI is Days Intake.
WV is characterized by hilly terrain that might cause grazing limitations to animals.This limitation is captured by integrating the SLOPE ADJUSTMENT variable.In fact, the spatial distribution of forage influences intake rate that eventually affect productivity and sustainability [44].Furthermore, stocking rate for the stocking rate [38] [44].In order to identify the optimal stocking rate in locations were the terrain is not flat as a representation of the region, the slope cannot be ignored.
Assumption 9: The slope in the contracting farm is flat while in the nearby farms might differ.

Electricity Generation
The source of energy generated is identified as renewable, due to the fact that it comes from a constantly available flow of input [45].The energy generation equation for our simulation was based on [35] composed of the DAILY POUNDS PER HEAD times a biogas production factor with the value of 0.03440.

Carbon Offset
The use of anaerobic digesters also provides potential GHG emissions reduction to livestock producers (in this particular case, the PBB industry) when capturing methane from the manure generated as a sustainable management practice [25].
In fact, these reductions on methane emissions can be sold to greenhouse emitters who might either willingly desire to reduce their own emissions or encounter emissions caps [12].
CARBON OFFSET DMETHPROD 24 = * The CARBON OFFSET equation is influenced by the DMETHPROD (Daily Methane Production) × 24.This is because methane has around 25 times the heat trapping capacity of CO 2 or global warming of CO 2 ; however, once it is captured through the anaerobic digester, 1 ton of methane used for energy is equivalent to removing 24 tons of CO 2 .
The variable METHCONF (Methane Conversion Factor) is a percent with a value of 0.698 specifically for the state of West Virginia while VS (total volatile solids) for high pasture-diet cattle is 10.1 [51].Furthermore, the maximum methane producing capacity, MMPC, is valued 0.00384 and MD (methane density) is defined as 0.041 while TPD (daily ton factor) is a constant as 0.0005 or 1/2000 [52] [53].

Manure Production
As mentioned earlier, under the assumption that each animal is purchased (in the farm of interest) at 500 lbs.and reaches approximately 900 lbs.before it is taken to the slaughterhouse and 1000 lbs.cow in cow/calf farms across space; DMP or daily manure production in NetLogo is defined under the assumption that only 90 percent of the production is recoverable [34] [35] [51].Assumption 11: Manure is completely mobile across space and collected only during winter season as an approach to enhance clustering systems in the region.

Cost of Investment (Anaerobic Digester)
As the number of head increases (as clustering members), the costs associated with the anaerobic digester increases at a decreasing rate.Based on another approach [12] and using data from case studies [47], the cost parameters are estimated in NetLogo when the following log-log functional form is employed: in which K represents the observed capital cost of the technology and construction, N is the number of heads while the estimated parameters α equals ( ) êxp α and β equals β .In order to obtain the cost of investment, the esti- mated parameters are used in the following equation: It is assumed that the technology employed is a plug-flow digester since it is the typical technology used in Pennsylvania [54].The cost associated with the technology comprises the design and construction of the pump as well as construction observation and assistance, hydrogen sulfide filter, utility charge, power lines, electric generator, effluent holder, solid separators, building, pit heating and so forth [12] [54].

Net Present Value
A PBB farm considering investing in an anaerobic digester has the options of either investing in a diversified business or maintaining its current sustainable business.In order to identify the farm of interest profitability, we use the net present value or discounted cash flow approach.In fact, the net present value (NPV) is a formal approach that condenses ecological and economical evaluations of a managing process within a planning horizon predetermined in which every contribution (net revenues) throughout the time under consideration is discounted up to the present day given a certain interest rate [29].The NPV would help us in evaluating the motivation behind venturing a diversified enterprise or continue under a specialized pasture based beef business from a profitability standpoint.The following presents our profitability approach based on [12] [55] and programmed in NetLogo [34] [35], under the assumption that the farm of interest is faced with diminishing returns: 1) If the NPV of the diversified business is positive ( NPV 0 BEC > ) and the NPV of the PBB business ( NPV 0 B > ), the investment into the anaerobic diges- ter should be considered.
2) If the NPV 0 BEC < and NPV 0 B > ; then, the investment on the anae- robic digester is an unacceptable option and solely PBB enterprise is profitable.is employed; however, the specialized business is solely a PBB farm.
Additional details of how to use ABM to set-up and solve resource management problems can be found in [56] [57].

Data Sources
The data used for the discussion and equations for the development of BET is based on several sources.Climatological and WV county data, like for example, precipitation, temperature and average slopes are compiled from NOAA Soil Surveys.On the other hand, the number of acres of pastureland per beef farm is an averaged value identified in previous studies conducted by [58].Moreover, costs associated with beef production such as pasture production per acre and costs of production per head are based on [14] [42] while cattle prices are based on [23] [59].Costs and prices were adjusted for inflation.Also, it is assumed that the price of purchased silage is $88 per ton [60].Furthermore, the daily pasture intake per animal and the sloping factor data have been compiled from [16] [17] [38].Also, energy prices are commercial prices based on historical data [47] and forecasted using the trend method based on cyclical trends since the value of electricity is volatile and might continuously vary [45].Furthermore, the selected discount rate and the average costs associated with the maintenance and monitoring of the anaerobic digester as well as the planning horizon for the NPV estimation are based on [12] [25].Moreover, costs related to manure collection are based on [24] [61] which includes manure base charges, transportation costs per mile and cost of manure per ton.On the other hand, the capital costs associated with the anaerobic digester are based on case studies identified by [47] and parameters are derived using the approach in [12].

Conclusion
As we can appreciate, the development of an agent-based model using language-based computer platforms such as NetLogo might depend on not only data and simulated equations but also an understanding of the system to be represented in a graphical view.Although the programming part of the model might take time, these models tend to be easier, quicker and less expensive than ordinary experiments [3].In fact, the replication of real world scenarios on a computerized simulation would contribute in predicting scenarios that in traditional experimentations might have a significant budget impact.As we anticipated, the methodology discussed in this paper is intended to awaken the universe of possibilities of venturing innovative approaches in agent-based modeling as part of researchers' tool pack for conducting researches and investigations in order to identify solutions to our real world problems.

Figure 1 .
Figure 1.NetLogo-System Dynamics Modeler Used for Simulation: Complete Flowchart.The figure above shows the system dynamic modeler used in BET model.The largest rectangular boxes represent the stocks that are influenced by the pipeline-shapes that store equations composed of values located either in the code tab, the interface view or in the variables presented as green rectangular boxes in the diagram while the arrows or links connect values among the previously explained components.Note that some of variables are connected to more than one arrow since that variable might be used in other functions.Figure2shows a segment of the complete flowchart for a more specific explanation.

Figure 2 .
Figure 2. NetLogo-System Dynamics Modeler: A Segment.Note: The flow (pipeline) named "Electricity-Generation" stores an equation composed of the variables (e.g.on-line-efficiency, Net-Energy-Content, etc.) that might be identified as a parameter or value stored in the variable or identified in the interface view under the simulation control panel.The flow changes depending on changes in variables during each iteration proving different values over time while the links (arrows) help make values available from one section to another.Then, the energy produced is accumulated in the stock called "Generation".Notice that "Generation" also depends on changes in the flow identified as "Biogas-Production-Head" making this a dynamic system along the planning horizon.

( 4 )
Latitude radians (LATRAD) are influenced by PI or 3.1415 times the latitude (LAT) divided by 180.length of a particular day of the year (DOY) and DEC measures the declination of the earth's axis to the sun.DEC basically determines the angle at noon of the sun light hitting a horizontal surface on the earth at a given latitude.In addition, the relative growth rate based on day length (RGR DL) is represented as follows: less than MIN DAY LENGTH; then RGR DL is 0; otherwise, RGR-DL equals DL-MIN DAY LENGTH / MAX DAY LENGTH-MIN DAY LENGTH ; where MIN DAY LENGTH and MAX DAY LENGTH are 9.15 and 14.85, respectively.
EVAP is the pan evaporation for a particular weather station in a specific county.The equation PAN EVAP is limited by setting PAN EVAPD = 0 when PAN EVAP is negative in order to have positive values; specifically: If PAN EVAP < 0; then PAN EVAPD = 0; otherwise, PAN EVAPD carries the value of PAN EVAP.
units of pounds while FORDEM which is Forage Demand is based on the daily animal weight (WEIGHT HEADS) times the daily dry matter intake (DM DAILY INTAKE) multiplied by the days of grazing and winter feed (DAYS INTAKE) as follows:

2 CO
same reasoning, CO 2 BASELINE is equal to DAILY METHANE PRODUCTION times[25] [34][35] [50].This model is able to estimate the amount of CO 2 equivalent emissions (or methane emissions) baseline based on total methane generated.The methane production is based either on the amount of heads spatially distributed in the entire interactive world on a yearly basis when a clustering system is taken into account or by the amount produced only by the farm of interest under the absence of an anaerobic digester in which manure is deposited into a manure lagoon allowing emissions to be released into the atmosphere.In fact, the CO 2 BASELINE represents the carbon dioxide emissions generated by the cows in the cow/calf farm and the steers on the farm of interest (stocker farm) under certainty and uncertainty, respectively.On the other hand, the CARBON OFFSET shows their respective CO 2 equivalent emissions reduction from deterministic and stochastic points of view.DMETHPROD DAILY POUNDS PER HEAD METHCONF VS MMPCA MD TPD DAILY POUNDS PER HEAD METHANE CONVERSION FACTOR VS MMPCA MD TPD

AAW (daily average
animal weight) is influenced by the IW (incoming weight plus (OW) outgoing weight divided by 2 or AAW = (IW + OW)/2 which fluctuates on a daily basis throughout the simulation.On the other hand, the variable BHFDM represents the high forage diet manure production by a beef cattle which is a constant with an average value of 10.1 pounds per 1,000-lbs.of animal.This is multiplied by the stoking rate (STK) during that particular year.Assumption 10: 90 percent of the manure in the spatial domain is recoverable based on NRCS (1995).

NPV
BEC is composed of the present value receipts, of revenues generated from PBB and electricity production as well as carbon offsets over the planning horizon in which i is the discount rate or the value of money, t represents indexes time and T is the planning horizon and lifespan of the anaerobic digester.In other words, it reflects the discounted value of expected net receipts. of discounted expenditures or costs associated with the PBB production, energy generation and carbon emissions reduction based on capital and variable costs with regards the entire operation.the other hand, NPV B is defined as the present value receipts, PV B R , minus the present value expenditures, PV B E , associated with the PBB production only during the planning horizon in which PV et al.
DOI: 10.4236/jep.2018.99062992 Journal of Environmental Protection goals.Planners must develop systems that function harmoniously not only in- ABM is flexible.It is clear, however, that the ability of ABM to deal with emergent phenomena is what drives the other benefits González et al.DOI: 10.4236/jep.2018.99062993 Journal of Environmental Protection of a system; and 3)
growth starts decreasing due to water shortage).For cool-season grasses, ASW ABOVE is about 50 percent or 0.5.In contrary, if ASW PCT < ASW ABOVE, RGR H 2 O takes the following form: Moreover, RGR H 2 O, the relative growth rate due to available soil water, equals to 1 if ASW PCT > ASW ABOVE (available soil water percentage at I. R. González et al.DOI: 10.4236/jep.2018.990621009 Journal of Environmental Protection which plant González et al.tends to gather and graze more in flat or less steep slopes since the steeper the slope the less pasture in the site is consumed decreasing the grazable land area [48][47][48].