Tuesday, November 01, 2022

Mesa-Geo: ABM and GIS in Python (A Update)

A couple of months ago we had a post about Mesa-Geo but only a short one. Now we want to go into more detail as we (Boyu Wang, Vincent Hess and myself) just presented a paper about it at the 5th ACM SIGSPATIAL International Workshop on Geospatial Simulation (GeoSim 2022). The paper itself was entitled "Mesa-Geo: A GIS Extension for the Mesa Agent-Based Modeling Framework in Python" in which we discuss in detail the need for a python library for creating geographically explicit agents (or GeoAgents) and introduce its architecture. 

In the paper we detail how we have designed Mesa-Geo to handle spatial data (both in terms of raster and vector via GeoSpace), how we have enabled visualization of geographical data and such models along with creating features to export geographical data from the simulations (using Rasterio and GeoPandas). To support this discussion we also provide some explicit examples on how the pieces fit together  range from rainfall flowing over a digital terrain model (DEM) to Schelling types of models using points and polygons as agents, to that of agents using road networks to navigate over an area. Boyu has also put together more details about the examples at: https://mesa-geo.readthedocs.io/en/latest/examples/overview.html (which includes movies of them running).  The actual code for the models and Mesa-Geo can be found at https://github.com/projectmesa/mesa-geo. Just to give you a sense of the paper and what Mesa-Geo can do, below we provide the abstract to the paper, some figures showing the architecture, along with some example applications. While at the bottom of the post you can see the full reference and a link to the paper itself.  

 

Abstract: Mesa is an open-source agent-based modeling (ABM) framework implemented in the Python programming language, allowing users to build and visualize agent-based models. It has been used in a diverse range of application areas over the years ranging from biology to workforce dynamics. However, there has been no direct support for integrating geographical data from geographical information systems (GIS) into models created with Mesa. Users have had to rely on their own implementations to meet such needs. In this paper we present Mesa-Geo, a GIS extension for Mesa, which allows users to import, manipulate, visualize and export geographical data for ABM. We introduce the main components and functionalities of Mesa-Geo, followed by example applications utilizing geographical data which demonstrates Mesa-Geo's core functionalities and features common to agent-based models. Finally, we conclude with a discussion and outlook on future directions for Mesa-Geo.

Class diagram of the Agent, GeoAgent, and Cell classes
Component diagram of GeoSpace and its related classes
Example applications using Mesa and Mesa-Geo: (a) Rainfall model, (b) Population model, (c) GeoSchelling (polygons) model, (d) GeoSchelling (points \& polygons) model, and (e) Agents and networks model.


 If you have any thoughts or comments about Mesa-Geo please let us know.

Full reference:

Wang, B., Hess, V. and Crooks A.T. (2022), Mesa-Geo: A GIS Extension for the Mesa Agent-Based Modeling Framework in Python, Proceedings of the 5th ACM SIGSPATIAL International Workshop on Geospatial Simulation (GeoSim 2022), Seattle, WA. pp 1-10. (PDF)

Friday, October 28, 2022

Modeling Farmers’ Adoption Potential to New Bioenergy Crops

Close on the heals of the last post on farming, we have a new paper co-authored with Kazi Masel entitled "Modelling Farmers’ Adoption Potential to New Bioenergy Crops: An Agent-based Approach" which was presented at the 2022 Computational Social Science Society of the Americas (CSS 2022) Annual Conference. In the paper we explore the potential of farmers to adopt carinata in the state of Georgia. Carinata in an oilseed crop which could be used as a sustainable aviation fuel. Through our agent-based model our results suggest that a viable contract price made by investors could persuade farmers to adopt carinata. If this sounds of interest, below we provide the abstract to the paper along with a movie showing the model running along with some figures of the model logic and an example of one of the results. At the bottom of the post you can find the full reference to the paper and a link to a pdf of it. Similar to our other papers a detailed Overview, Design concepts and Details (ODD) protocol along with the model and the data needed to run the model has been made available at https://www.comses.net/codebase-release/5c2c06f0-3f6d-4f8d-b198-ce24b55feb2f/. This additional material allows for a more in-depth description of the model, as well as facilitates the replication of results or extension of the model.

Abstract: The use of fossil fuels is the primary source of greenhouse gas emissions but there are alternatives to these especially in the form of biofuels, fuels derived from bioenergy crops. This paper aims to determine farmers’ potential adoption rates of newly introduced bioenergy crops with a specific example of carinata in the state of Georgia. The determination is done using an agent-based modeling technique with two principal assumptions – farmers are profit maximizer and they are influenced by neighboring farmers. Two diffusion parameters (traditional and expansion) are followed along with two willingness (high and low) scenarios to switch at varying production economics to carinata and other prominent traditional field crops (cotton, peanuts, corn) in the study region. The paper finds that a contract prices around $9, $8 and $7 can be a viable option for encouraging farmers to adopt carinata in low, average, and high profit conditions, respectively. Expansion diffusion (that diffuses all over the geographical area), rather than centered to the few places like traditional diffusion at the early stage of adoption in conjunction with higher willingness conditions influences higher adoption rates in the short-term. As such, the model can be used to understand the behavioral economics of carinata in Georgia and beyond, as well as offering a potential tool to study similar bioenergy crops.
Keywords: Adoption, Agent-based modeling, Bioenergy Crops, Farming.
County-wise land availability for carinata production
Process, overview and scheduling of the model
Number of farmers who adopt carinata in the rotation years with high profit condition  (carinata yield = 60 bu/acre, carinata production cost = $260/acre)

Full Reference:

Ullah, K. and Crooks A.T., (2022), Modelling Farmers’ Adoption Potential to New Bioenergy Crops: An Agent-based Approach, The 2022 Computational Social Science Society of Americas Conference, Santa Fe, NM. (PDF)

Thursday, October 27, 2022

Water reuse adoption by farmers & the impacts on local water resources using an ABM

In the past we heave explored a how farmers might sell their land but not how they might adapt new technologies or farming practices such as water reuse. But this has now changed with a new paper co-authored with Farshid Shoushtarian and  Masoud Negahban-Azar entitled "Investigating the micro-level dynamics of water reuse adoption by farmers and the impacts on local water resources using an agent-based model" which was recently published in the journal Socio-Environmental Systems Modelling. In the paper we introduce the WRAF  (water  reuse  adoption  by  farmers) model which explores how farmers might adopt water recycled water (reuse) practices. Using the model, results suggest that it might be possible through freshwater shortage or groundwater withdrawal regulations could increase recycled water use by farmers. If this sounds of interest, below we provide an abstract to the model, some figures from the agent logic (i.e., decision making), an overview of simulation results and the  full reference to the paper. Along with the paper, we have also provided more details  about the WRAF  model following the Overview, Design concepts, Details, and Decision-making (ODD) protocol along with the  NetLogo source code which can be found at https://www.comses.net/codebase-release/cc6d551e-cf0f-472e-a54b-28591cd39b4d/.


Abstract: Agricultural water reuse is gaining momentum to address freshwater scarcity worldwide. The main objective of this paper was to investigate the micro-level dynamics of water reuse adoption by farmers at the watershed scale. An agent-based model was developed to simulate agricultural water consumption and socio-hydrological dynamics. Using a case study in California, the developed model was tested, and the results showed that agricultural water reuse adoption by farmers is a gradual and time-consuming process. In addition, results also showed that agricultural water reuse could significantly decrease the water shortage (by 57.7%) and groundwater withdrawal (by 74.1%). Furthermore, our results suggest that recycled water price was the most influential factor in total recycled water consumption by farmers. Results also showed how possible freshwater shortage or groundwater withdrawal regulations could increase recycled water use by farmers. The developed model can significantly help assess how the current water reuse management practices and strategies would affect the sustainability of agricultural water resources.

Keywords: Water reuse; agent-based modelling; agricultural water management; recycled water for irrigation


(a) WRAF framework; (b) Farmers' decision-making flowchart

(a) Water reuse adoption sub-model framework; (b) Wastewater treatment plants flowchart

Representative simulation results: farmers’ water resources distribution in year one (a) andyear84(b);  available recycled water in the storage ponds of Modesto (c) and Turlock (d)wastewater treatment plants; total recycled water used by farmers in year two (e) and year 84(f)

Full Reference:

Shoushtarian, F., Negahban-Azar, M. and Crooks A.T. (2022), Investigating the Micro-level Dynamics of Water Reuse Adoption by Farmers and the Impacts on Local Water Resources using an Agent-based Model, Socio-Environmental Systems Modelling, 4: 18148. Available at https://doi.org/10.18174/sesmo.18148. (pdf)


Wednesday, September 21, 2022

Mitigation of Supply Chain Disruptions by Criminal Agents

Since the outbreak of COVID, the role of supply chains has been brought front and center in many aspects of our daily lives. For example, the disruption to supply chains can significantly influence the operation of the world economy and this has been shown to permeate and affect a large majority of countries and their citizens. However, it is not just diseases outbreaks that can affect them, but also criminal agents. To this end at the 15th International Conference on Social Computing, Behavioral-Cultural Modeling & Prediction and Behavior Representation in Modeling and Simulation (or SBP-BRiMs for short), Abhisekh Rana, Hamdi Kavak, Sean Luke, Carlotta DomeniconiJim Jones and myself have a paper entitled "Mitigation of Optimized Pharmaceutical Supply Chain Disruptions by Criminal Agents."

The paper presents some initial results from a model that explores the disruptions to supply chains by a criminal agent and possible mitigation strategies. We construct a model of a typical pharmaceutical manufacturing supply chain, which is implemented via discrete event simulation. The criminal agent optimizes its resource allocation using a CMA-ES algorithm to maximize disruption to the supply chain. CMA-ES is part of a family of sample-based optimization techniques collectively known as evolutionary algorithms.  Broadly speaking, CMA-ES starts with a sample of random candidate solutions to optimize.  It then iteratively assesses the quality of each candidate solution, then performs resampling based on their quality to produce a new sample of candidates. By combining our supply chain model with our criminal agent, and by leveraging CMA-ES, we attempt to identify the main bottlenecks and the most vulnerable points in the pharmaceutical supply chain. Our findings show criminal agents can cause cascading damage and exploit vulnerabilities, which inherently exist within the supply chain itself. We also demonstrate how basic mitigation strategies can efficaciously alleviate this potential damage.  If this sounds of interest, below we provide the abstract to the paper, along with some of the key figures and at the bottom of the post the full reference and a link to the paper.

Abstract: 

Disruption to supply chains can significantly influence the operation of the world economy and this has been shown to permeate and affect a large majority of countries and their citizens. We present initial results from a model that explores the disruptions to supply chains by a criminal agent and possible mitigation strategies. We construct a model of a typical pharmaceutical manufacturing supply chain, which is implemented via discrete event simulation. The criminal agent optimizes its resource allocation to maximize disruption to the supply chain. Our findings show criminal agents can cause cascading damage and exploit vulnerabilities, which inherently exist within the supply chain itself. We also demonstrate how basic mitigation strategies can efficaciously alleviate this potential damage. 

Keywords: Pharmaceutical supply chains, Criminal agents, Evolutionary computation, Mitigation.

A simplified version of a typical pharmaceutical supply chain.

Design of the criminal agent.
Sample simulations for the baseline model, without any disruption, and attacks at the five main disruption points in the supply chain.

Summary statistics and sample simulations for CMAES optimized disruptions with and without mitigation in place.

Full Reference:

Rana, R., Kavak, H., Crooks, A.T., Domeniconi, C., Luke, S. and Jones, J. (2022), Mitigation of Optimized Pharmaceutical Supply Chain Disruptions by Criminal Agents, in Thomson, R., Dancy, C. and Pyke, P. (eds), Proceedings of the 2022 International Conference on Social Computing, Behavioral-Cultural Modeling, & Prediction and Behavior Representation in Modeling and Simulation, Pittsburgh, PA., pp 13-23. (pdf)

 

Monday, September 19, 2022

Information propagation on cyber, relational and physical spaces about covid-19 vaccine

It seems that its been a quite some time that we posted about geosocial analysis but in a recent paper with  Fuzhen Yin  and Li Yin entitled "Information Propagation on Cyber, Relational and Physical Spaces about Covid-19 Vaccine: Using Social Media and the Splatial Framework" published in Computers, Environment and Urban Systems we revisit this line of work while at the same time linking it to Covid and vaccination debates. 

Specifically we examine the interaction between cyber, relational (i.e, networks between objects), and physical spaces using the Splatial framework. Through our analysis focused on New York State, we find that non-polarized vaccination debates were observed in cyber, relational, and physical spaces. Furthermore,  we found that while physical space users had less anti-vaccine stance than relational and cyber space users there were strong interactions are observed between physical–relational, and relational-cyber spaces.If this sort of thing interests you. Below we provide the abstract to the paper along with some figures which show the study area, our methodology and some of the results. While at the bottom of the post we provide the full reference and the link to the paper.

Abstract:

With the advent of social media, human dynamics studied in purely physical space have been extended to that of a cyber and relational context. However, connections and interactions between these hybrid spaces have not been sufficiently investigated. The “space-place (Splatial)” framework proposed in recent years allows capturing human activities in the hybrid of spaces. This study applies the Splatial framework to examine the information propagation between cyber, relational, and physical spaces through a case study of Covid-19 vaccine debates in New York State (NYS). Whereby the physical space represents the regional boundaries and locations of social media (i.e., Twitter) users in NYS, the relational space indicates the social networks of these NYS users, and the cyber space captures the larger conversational context of the vaccination debate. Our results suggest that the Covid-19 vaccine debate is not polarized across all three spaces as compared to that of other vaccines. However, the rate of users with a pro-vaccine stance decreases from physical to relational and cyber spaces. We also found that while users from different spaces interact with each other, they also engage in local communications with users from the same region or same space, and distance-based and boundary-confined clusters exist in cyber and relational space communities. These results based on the Splatial framework not only shed light on the vaccination debates but also help to define and elucidate the relationships between the three spaces. The intense interactions between spaces suggest incorporating people’s relational network and cyber presence in physical place-making.

Keywords: Covid-19, Vaccination, Social media, Social network analysis, Community detection, Urban informatics
Schematic representation of the three spaces: cyber, relational and physical spaces.

Map of study area (NYS) with the primary road system. Red dots denote collected vaccine-related tweets in NYS.

Research workflow to investigate the propagation of different opinions between three spaces: cyber, relational and physical spaces.

Network visualization of the eight top large communities in relational space. (A) Visualization of communities using ForceAtlas layout. (B) Project communities into physical space. Nodes without location information are placed outside of NYS.

The hybrid space network shows the information propagation between physical and relational spaces. (A) shows the network of all tweets, (B) shows the pro-vaccine tweets, and (C) shows the anti-vaccine tweets.
 
Full Reference:

Yin, F., Crooks, A.T. and Yin, L. (2022), Information Propagation on Cyber, Relational and Physical Spaces about Covid-19 Vaccine: Using Social Media and the Splatial Framework, Computers, Environment and Urban Systems. Available at: https://doi.org/10.1016/j.compenvurbsys.2022.101887.  (pdf)