Virtualising Space – New Directions for Applications of Agent-Based Modelling in Spatial Economics

Due to enormous technological progress, socio-economic science has gained new possibilities of investigating complex and not well-known socio-economic phenomena. One of the recent promising research approaches is agent-based modelling (ABM) with connection to geographical (GIS) data. ABM is a bottom-up research method concerning individuals that live and interact in the artificial environment. In this type of simulation, evolution of the whole system and macro-level patterns results from individual behaviour of autonomous entities. Combining ABM with GIS data moves the simulation into the real geographical space. Applying this approach provides powerful possibilities of more realistic socio-economic simulations concerning urban and spatial economics, sociology and psychology. Geosimulation also helps to answer questions about dependencies between geographical space and economic performances of modern cities. In this paper, a closer look at this topic is presented. We deal with the problem of implementation of GIS data into agent-based modelling software. In the first step of our research procedure, we compare ABM programming platforms, then we chose three of them which provide GIS data support. In the second step, we implement OpenStreetMap GIS data for one of the districts of Poznań into these programming platforms. Finally, we compare the performance of ABM platforms regarding three major criteria: difficulty of programming, GIS data compatibility and available technical support. Our research is the first step in developing a complex socio-economic urban system under the ABM paradigm.


Introduction
Recently, simulation methods in socio-economic science have become much more sophisticated, complex and realistic (e.g. Crooks, Castle, 2012;Wilensky, Rand, 2015). Computational models in this emerging research field describe our world far more precisely than a few years ago. We can take into account interdependencies that we seek to investigate and understand. In such conditions, conventional research methods in economics may fail to deal with the ultimate complexity of our world (Borrill, Tesfatsion, 2011). Recently Rubinstein (2017) and Blanchard (2018) have criticised classical economic and econometrics models. The economists emphasise that mainstream models describe the world characterised by several unrealistic assumptions, and as a result, they are far from understanding both: human behaviour and the real world.
An answer to this issue may be agent-based modelling (ABM), known as the third way of doing science, which is one of the emerging fields in economics (Macal, North, 2005). ABM is a relatively new simulation approach which allows us to relax discussible assumptions imposed on classical economic models. Gilbert (2008) stresses that ABM is just computational social science that "involves building models that are computer programs". The aim, as in the other modelling approaches, is to present some part of reality in a possibly clear way. In ABM, independent agents make their daily decisions on a basis of programmed behavioural rules.
Agent-based modelling has become a vital research approach also in socio-economic science. The idea of numerous, cooperating individuals whose behaviours can be investigated from the micro and macro level has convinced many scientists. Such an approach in fact is much closer to reality than models showing the economy as a more or less complex system of equations (e.g. Tesfatsion, 2017). In ABM, we can investigate the direct impact of agents' actions on the economy as a whole. The difference between classical models and ABM can be described on a basis of classical paper by Reynolds (1987). He modelled the movement of artificial birds according to three simple behavioural rules: 1) each bird must keep some distance from its neighbour; 2) each bird tries to adjust speed to its neighbour; 3) each bird tries to keep the direction set by the central point of the mass of birds. Macy and Willer (2002) ask the question: "what approach to modelling the flight of birds is closer to reality: trying to create some general models (perhaps based on differential equations) that govern the flight of a flock of birds or just implementing Reynold's rules?". We can ask a similar question in the field of economics: whether to model the economy as a system of abstract general equations or whether to create artificial society and observe the resulting patterns and evolution over time.
However, simulating the movement of imaginary birds is something different than simulating human beings and their complex behaviours which are often perceived as irrational (Akerlof, Yellen, 1987;Ariely, 2008). Due to this reason, social simulation suffers from methodological difficulties and, as a consequence, is characterised by lower precision than biological or psychical models (Adamatti, Dimuro, Helde, 2014). Nonetheless, due to massive evolution of both computer hardware and software, social simulation has gained new powerful possibilities of managing and modelling complexity (e.g. Crooks, Castle, 2012;Wilensky, 2015).
Nowadays, agent-based models can be enriched by several innovative and tempting features which are out of range of classical methods. One of the new simulation fields that IT revolution has opened recently is the technical possibility of simulating artificial individuals (agents) in the real geographical space. The fraction of agent-based models that utilise geographical data was defined as geospatial simulation or just geosimulation (Crooks, Castle, 2012). However, some interesting studies on this topic are already available (e.g. Zia et al., 2013;Torrens, 2018), there are numerous further works in the field of combining the physical sphere and artificial individuals in dynamic economic systems. Simulation experiments conducted inside artificial urban areas are one of the directions of research. Such models may result in particularly interesting conclusions. The reason for this is a straightforward link to city governance and urban planning or, in general, the quality of life in modern cities. Such an approach may be ultimately useful and address vital questions about the relationship between geographical space, decisions made by inhabitants and economic performance of cities. AB city models may provide unique knowledge about dependencies between physical space, human behaviour and socio-economic performance of modern cities which so far has been neglected.
Cities are a workhorse of our economy, at the same time, our cities are far from ideal. The most common problems are connected with governance, transportation system, pollution, segregation, overcrowding, unemployment, as well as allocation of trade and services (Gershenson, 2012). Recently, there has been a lot of talk about smart cities which are often defined as urban areas filled with computers and sensors, producing many data to manage resources more effectively (e.g. Hamblen, 2015). However, no matter how smart a city is, it will not help us understand economic and social rules that drive urban areas. The problem of city management and urban prediction is limited due to the enormous complexity of interactions among city components (Rydin et al., 2012).
The questions arise: "Do we have tools to participate in the changes that urban areas will have to deal with in the future?". We believe agent-based models of real cities 1 will help to address these topical questions and will provide future 1 Recently there has been also a growing discussion about so-called digital twin cities -the virtual replicas of real cities. E.g.: Singapore authorities are working on a 3D city model. When completed, virtual Singapore offers capabilities for virtual experiments (e.g. mobile networks coverage), planning and decision making (e.g. transport/pedestrian flows) and a wide range of scientific research. Such models lack, however, virtual inhabitants or economic analysis. simulated paths of cities' development and simulate what-if modelling to provide an experimental approach in dealing with problems of modern cities. The primary aim of this paper is to contribute to this growing research area and make the first step in developing an agent-based model of Poznań, Poland. We want to implement land-use and land-cover geographical information (GIS) data in selected agent-based programming environments. The secondary aim of our research is to compare the most popular ABM platforms with a focus on GIS data support. The research contributes to socio-economic science and brings closer the understanding of the relationships between humans, city geography and economic performance. Implementation of vector city space in agent-based programming platforms is the initial phase of research whose aim is simulation of human life in an artificial city. The topic is new and knowledge is very limited, thus the paper provides comprehensive expertise on geographical issues in ABM and, as a consequence, could be particularly useful.

Literature review
The roots of agent-based models in economics can be found in the1970s. In 1971, economist Thomas Schelling developed a model of race segregation. In a simple way, without a computer, the model presented how people choose their living area. In his experiment, Schelling used the paperboard which he marked with zeros and crosses. He made a simple assumption that everybody wants at least half of their neighbours to be of the same race. The result was clusters containing the same neighbours (about 80% of cluster inhabitants were of the same race). This simple, although applied without computers, experiment shows the essence of agent-based modelling: one simple rule applied to single individuals resulted in complex spatial patterns.
Although some papers appeared in the 1980s (e.g. Axelrod, Hamilton, 1981;Reynolds, 1987), the real rise of agent-based modelling started in the 1990s. At that time, the StarLogo programming language was developed at prominent Massachusetts Institute of Technology, Cambridge. StarLogo was the first framework that contained routines supporting agent-based modelling. Later other ABM software was launched (Swarn, NetLogo and Repast). Some interesting papers that appeared in those days in the field of socio-economic science included stock market simulations by Palmer et al. (1994) or Brock and Hommes (1999) who presented dynamics in an asset pricing model where agents made their decision according to the potential risk.
Also in 1999, the first comprehensive guide to agent-based modelling in social sciences by Gilbert and Troitzsch was published. This practical handbook shows step by step how to understand social and economic problems through the lens of agent-based systems. The book documents also some early technical aspects of developing agent-based models. As computer and software evolution progressed, applications of agent-based modelling became more and more sophisticated and realistic. One of the new research fields that appeared in the early 2000s was simulation of real geographical systems. Agents started to interact in the real physical sphere. This new growing fraction of agent-based models combined with geographical data was defined as geospatial simulation or just geosimulation (Crooks, Castle, 2012). Geosimulation is a young research method, however, its applications are much diversified. Applications include environmental and medical research (e.g. contamination of the environment by the mining industry - Suh et al., 2017), historic reconstruction (e.g. Yang et al., 2014), urban research concerning transportation issues (Boyce, Williams, 2015), urban growth (Tan et al., 2016), and energy distribution (Resch et al., 2014).
The earliest applications of geosimulation were models of crowd and pedestrian movements in urban systems. Haklay et al. (2001) have developed the STREET model in which agents decide how to move along an artificial streets system. Agents create the sequence of locations they have to visit applying the shortest path algorithm and move to the planned destination. The authors build space on a basis of GIS data, however, with no application to a real city. Agents are characterised by a variety of characteristics such as speed, visual range, and fixation. The model is modular and can be enriched with several other features such as buildings or group behaviours.
Among others, early papers of Benenson and Torrens (2006) developed the definition of geosimulation. They simply defined it as object-based spatially-ex-plicit modelling of dynamic systems. They divide geosimulation into two classes: Cellular Automata (CA) and Multi Agent Systems (MAS). While CA are based on dynamically updated lattice of cells, MAS reflect the behaviour of humans within the geographical environment (Marceau, Benenson, 2011).
The first comprehensive handbook which deals with spatial issues of an agent-based system is Heppenstall et al. (2011). The authors provide a set of papers on various and vital ABM topics. In this handbook, Castle and Crooks (2011) have developed a chapter which concerns GIS and agents problems. The authors emphasise that static GIS technology is something opposite to the dynamics of ABM. As a result, it is difficult to combine physical space with agents into one evolving and interacting system that reflects complex social phenomena.
In turn, Crooks, Hudson-Smith and Patel (2011) in their paper present some early developments in combining GIS data with an agent-based framework in a 3D model. In fact, 3D models are hardly visible in academic applications because visualisation is not an important issue in scientific models. The authors mention also other reasons for a lack of 3D data and the fact that ABM platforms cannot take advantage of an additional dimension. Such models can be extremely useful while modelling pedestrians movements and designing urban public spaces (Schelhorn et al., 1999).
One of the pioneering papers is a paper by Zia et al. (2013). The authors simulate urban mobility in the European city of Linz using high-performance parallel computing (HPC) and the cellular automata approach. They represent the geographical space and replicate the full population of the city (200.000 agents) to investigate different evacuation scenarios. In the field of socio-economic sciences, geosimulation may be both a very attractive (also visually) and very powerful research method. However, its development is at a very early stage. As an illustrative example, Tseng et al. (2017) are invoked. They simulate human life in one of the districts of New York City to investigate interactions between the inhabitants of the artificial city and the space. Their 3D model makes a great impression, however, it is very general and voided of the human-space connection. Although complex and comprehensive, it lacks in-depth statistical and econometric analysis of output data. In addition, the linkage with urban economics or behavioural sciences is very tiny. The authors emphasise also that the model is limited and in the future some further developments are necessary.
If we look closer at the recent history of geosimulation, a paper by Lyu, Han and Vries (2016) is also worth mentioning. The authors focused on a transportation problem in a hypothetical urban area. The model consists of three layers of population and three levels of hierarchy of road networks and land use within five popular classes (residence, industry, office, commerce, and open & green). The presented model is in the early stage of development so it produces a general urban layout. In the next steps, the authors will enrich the model with a more complex road network and introduce traffic.
Among other studies, we should not miss a recent, visionary paper by Torrens (2018) where the author develops an urban sandbox to study a city damage scenario. The author used the data of Salt Lake City (USA) to test the model. He induced an earthquake in the model physics and observed the escape-paths of 2000 human automata who inhabited the affected district. He focused on the study how a shift in one person's behaviour can affect others and found out that one individual could significantly affect others and change their behaviours in the case of emergency.

Data
According to Zia et al. (2013), there are three approaches to represent space in agent-based models. The first way is to create a network between the agents -the network represents the walkable space. The second approach is via cellular automata, where cells are both space and agents. Movementis represented by changes in the state of given cells. The third and the most interesting approach is combining Geographical Information Systems data with ABM. At present, GIS data are more and more popular in economic research where space is an important factor that influences the evolution of the whole system (Brunsdon, Singleton, 2015). In a geographical sense, a city is a large-scale construction in space. This construction consists of blocks which are paths, edges, districts, nodes, and landmarks that Lynch (1960) explicitly represented through layers of vector data. GIS data are, however, static in nature, which significantly impedes implementation in highly dynamic Agent-Based Systems (Castle, . Large-scale geospatial ABM models combining various functional layers of the urban structure are in the conceptual phase.
The GIS data for Poznań, Poland were chosen for implementation and testing -we aim at creating an artificial representation of one of the city's districts. Poznań is situated in the Wielkopolska Region in North-western Poland. The Poznań agglomeration is one of the largest urban areas in Poland. Almost 1 million citizens reside within this area of 13.125 square miles. The region is known for its good situation on the labour market and it belongs to one of the richest regions in Poland.
Our implementation area was the Old Town district. We obtained the GIS data from the OpenStreetMap platform and converted them to the vector format. Our data source was the ESRI shapefile that is a popular geospatial data format. The shapefile spatially describes vector features, which are points, lines, and polygons enhanced with vector geographical coordinates. These features represent spatial patterns such as roads, rivers, lakes, buildings, green areas, etc. that can be accessed through the several functional layers of shapefile. Connection of these lay-ers provides a complete portrait of the given geographical space (Figure 2). In our case, it was Poznań's Old Town district 2 . Physically the shapefile is not a single element but rather a set of files which consists of a geometry file, an index of geometry, and a list of attributes for each shape. Shapefiles contain several additional information. In our case, it was mainly the land class attributes that were assigned to each shape. Several other pieces of information came with the file downloaded from OpenStreetMap (thousands of addresses, names of specific places, etc.).

ABM software
In the next step, we identified and tested software dedicated to developing Agent-Based Models and geosimulation purposes. As a result, we recognised about 20 different ABM platforms at various stages of life-cycle and development. Some of these platforms are freeware/open-source, while others are commercial. These environments are often very distinct from one another in terms of logic and applications. Enthusiasts from a given scientific field developed some of them. Most of the environments are based on one of the common programming languages (mainly JAVA, C++ or Python). Some platforms rely on specific languages that were designed only for ABM purposes. Finally, we have also some platforms with graphical user interface (GUI). The last group is the most suitable for educational purposes, developing simple or exemplary models.
The main advantage is that these platforms are equipped with specific functions, libraries, classes and routines that support developing ABM models (Abar et al., 2017). Such elements support visualisation, creation of agents and their behaviours (e.g. movement, memory, characteristics). However, implementation still 2 Data sets can be downloaded with other materials supplemental to this paper from: https:// github.com/wozniak2/GAUSES may be a tricky issue and needs to be done from scratch. As a result, the model consists of several files filled with code that need to be compiled and executed. In most cases, it can be done from the application level or in one of the popular Integrated Development Environments such as Eclipse or NetBean. In Table 1, we present the results of our investigation -a set of available ABM platforms. The important conclusion of our review is that agent-based programming platforms dynamically evolve. Among the identified systems, some are already dead (e.g. Breve, which is no longer maintained since 1998), some have appeared just recently (e.g. Behaviour Composer was presented for the first time in 2010), some are designed for specific applications (e.g. Altreva is designed only for financial market modelling). A few of these ABM platforms have also the possibility of working with GIS data, however, the availability of exemplary models is limited and often focused on biological examples.
In the next step, we focused only on platforms with GIS capabilities, as our main aim was to work with GIS land-use and land-cover data. Among 20 identified ABM platforms, we focused on six with theoretical GIS support: AnyLogic, Behavior Composer, Framestick, Netlogo, MASON, and Repast. From this list, we removed AnyLogic due to an expensive commercial licence; Behaviour Composer because it is a rather simple online educational tool, and Framestick, as it seems to better handle simulating smaller 3D structures (such as machines, cells or parts of the body).
As a result, for further tests and comparisons, we were left with three agent-based platforms with declared GIS support: NetLogo (version 6.0.2), MA-SON (version 18), and RePast (version 2.5). These platforms differ in terms of many major issues (e.g. the difficulty level of programming, community support, and the availability of additional resources such as packages or tutorials) and minor ones (installation, compilation and execution of models, other software dependencies).
Finally, we implemented shapefiles as geographical projections of two layers (roads and buildings) in MASON, RePast and NetLogo. It was a challenging task as these three platforms relyon a different approach to GIS data and programming logic. As a result, we wrote three different scripts from scratch, separately for each environment 3 .

Repast Simphony
Repast (Recursive Porous Agent Simulation Toolkit) Simphony is probably the most common agent-based programming platform in the field of social science. Repast is free and open-sourced. Initially developed by a team of scientists from the University of Chicago in 2002, now maintained mainly by Argonne National Laboratory in the USA. Repast is an integrated, interactive, Java-based modelling system and can be run under the whole variety of operating systems(Linux, Windows and Apple OS).
Usage of the full functionality of Repast requires strong JAVA programming skills. Repast has tools for visual model development, visual model execution, automated database connectivity, automated output logging, and results visualisation (Berryman, 2008).
Repast is the one among the presented platforms that has a High-Performance Computing (HPC) version. It means that computation can be parallelised and executed by several processors (in clusters or supercomputers). Such possibility can be especially useful when dealing with a large-scale simulation. The execution time of an agent-based model can be significant, especially if multiple repetitions of simulation are necessary. In that case, parallelising computations makes execution time much shorter.

NetLogo
Netlogo is a popular programming platform for multi-agent simulation. It has been under development since 1999. Netlogo is used among a wide range of scientific disciplines. Users can create simulations easily and run them under different setup parameters. Large emphasis was put on programming simplicity and a low-entry level for new users (Wilensky, Rand, 2015). In NetLogo, it takes a few minutes to develop a simple simulation. As a successor of StarLips and Logo language, NetLogo names single agent as a "turtle". Something that distinguishes NetLogo from Mason and Repast is that it is a standalone application and can run on every popular platform. Its authors and community guaranteed a rich library of exemplary models. There are about 150 prebuilt simulations which are available instantaneously once NetLogo is installed. Thousands of additional models are available on Internet websites devoted to agent-based modelling (e.g. comses.net) or on programmers' community websites (e.g. stackoverflow.com). Its authors emphasise the fact that Net-Logo is both: a standalone application and a programming language itself. Thus, we do not need to install or use any other applications that are required if working with the next two environments.

Mason
Mason is a discrete-event simulator entirely written in JAVA. Mason was developed to handle computationally expensive large-scale simulations. The system can produce models including millions of agents (Luke et al., 2005). Mason is an open-sourced environment which was developed at the George Mason University Computer Science Department and George Mason University Center of Complexity. The system was developed to primary deal with social and biological issues, mainly economics, land use, politics, and population dynamics. The authors' aim was to create a fast and stable platform which deals with many repetitions of simulations. The authors of the system underline the following design goals (Luke, Cioffi-Revilla, Panait, 2005): 1) a small, fast, easily understood, and easily modified core; 2) separate, extensible visualisation in 2D and 3D; 3) production of identical results independent of the platform; 4) checkpointing any model to disk such that it can be resumed on any platform with or without visualisation; 5) efficient support for up to a million agents without visualisation; 6) efficient support for as many agents as possible under visualisation (limited by memory); 7) easy embedding into larger existing libraries, including having multiple instantiations of the system coexisting in memory. To start using MASON, it is necessary to install the Java Development Kit and the integrated programming environment (IDE) such as Eclipse or NetBeans. Then one has to download MASON libraries and compile them into workspace. As a result, we start building our model as a pure JAVA application in which we can use MASON classes and routines.

Brief comparison of NetLogo, Repast and MASON
We have identified the three most suitable environments that support GIS data and offer the possibility of developing complex socio-economic models in the real geographical environment. These platforms are NetLogo, Mason and Repast Simphony (details described in Table 2). We want to highlight key conclusions from GIS capabilities: 1) all tested platforms are powerful, enabling stable work with GIS, and are well-suited for our purposes; 2) each platform differs in execution time and possibility of parallelising computation (in fact, only RePast has its HPC version); 3) we devoted the most time to the MASON implementation of GIS data, also the RePast model was time consuming and strongly dependent on external JAVA libraries; 4) both RePast and Mason, if used with GIS, need good JAVA programming skills (complicated syntax and system of classes); in turn NetLogo is based on the much easier LOGO language; 5) none of the tested platforms is ideal. NetLogo's weakness is longer execution time, while MASON and RePast are faster but demand low-level programming skills.

Conclusions
Agent-based modelling and geosimulation are seen as a vital research method that has powerful tools to explore complex socio-economic phenomena. In this paper, we have focused on new directions for applications of agent-based modelling in economics. We have highlighted the fact that these new and powerful research fields are connected with Geographical Information Systems data. The geographical space is an often underestimated "missing piece" of mainstream large-scale economics models (e.g. Garretsen, Martin, 2010), however, the research suggests that the micro-scale physical space is an important factor that may influence markets, people's behaviours, their lives and opportunities (Perrons, 2017). In this context, space should be understood not only as a matter of distance and location but rather as a complex interacting system of many physical and human factors. The integration of geospatial (GIS) data within agent-based models provides a framework for modelling daily lives of individual agents at a micro-scale to observe large-scale phenomena. Computational agent-based models have been present in economics since the classical paper of Axtell and Epstein (1996), however, their roots reach Schelling's (1971) model. Also space-focused urban modelling has a long tradition that began with models of urban density developed in the mid-1950s. However, technological evolution has only very recently opened up artificial worlds for integration with geographical (GIS) data (mentioned in Crooks, Castle, 2012).
One of the possibilities of application of GIS-based ABM may be the economic investigation of interconnections between economic performance of modern cities and their physical structure. Such exercise may answer vital questions about determinants of cities' growth and decline. In this paper, we have taken the first step towards achieving this aim. Our research procedure was to implement into selected AB programming platforms two geographical urban spaces based on land-use and land-cover GIS data. We focused on the implementation of the Old Town district in Poznań. Then we compared the performances of ABM programming platforms regarding GIS data functionality, programming difficulty, and the availability of tutorial materials and models.
The results clearly show that three of the available ABM programming platforms can be easily used for developing GIS ABM models. The main differences regard the difficulty of implementation, the availability of tutorial models, and the execution speed of simulation.