MEASURE LANDSCAPE DIVERSITY WITH LOGICAL SCOUT AGENTS

The Common Agricultural Policy reform of the EU focuses on three long-term objectives: viable food production, sustainable management of natural resources and climate action with balanced territorial development. To achieve these goals, the EU farming and subsidizing policies (EEA, 2014) support landscape heterogeneity and diversity. Current paper introduces an agent-based method to calculate the potential of landscape diversity. The method tries to catch the nature of heterogeneity using logic and modelling as opposed to the traditional statistical reasoning. The outlined Random Walk Scouting algorithm registers the land cover crossings of the scout agents to a Monte Carlo integral. The potential is proportional with the composition and the configuration (spatial character) of the landscape. Based on the measured points a potential map is derived to give an objective and quantitative basis to the stakeholders (policy makers, farmers).


INTRODUCTION 1.1 Landscape diversity
Landscape diversity, sustainability and other ecological aspects have been given a lot of public attention and support from local and regional authorities.Landscape designers however, mostly focus on functionality and aesthetic criteria, ecology and energy balance is not really considered in design.Hence, the sustainability of the area in the long term is rather questionable.It is relatively simple and costless to examine the possible long term effects and outcomes of a new regulation concerning land use change without ruining or irreversibly altering nature using computer simulation (i.e.agent-based modelling).Our area of investigation is a randomly chosen region in the Great Hungarian Plain, which can be considered a typical Hungarian area.This area however, faces all the targeted criteria of EU regulations (lack of water, depleted soil, extensive farming) that require strategic intervention.Hence, because of its size, it would be essential to find possible scenarios of revitalization that can be converted from atomic scale (individual level) and effectively aggregated into a regional action plan.

Agent-based modelling
The term agent-based modelling (ABM) refers to the use of computational methods to investigate processes and problems viewed as dynamic systems of interacting agents.An example might be attempting to model crowd behaviour in a football stadium using computational agents to represent individuals in the crowd (de Smith, M.J. et al., 2015).Agents are beings that can follow instructions.Each agent can carry out its own activity, all of them simultaneously.Some ABM environments can be categorised by their licensing policy (Castle and Crooks, 2006)   NetLogo was chosen for simulating purposes, which is a multiagent programmable modelling environment (Wilensky, 1999).
The model installation consists of the agents and the patches.The agents are the actors of the models, generally the dynamic elements.The patches are the cells that are being visited by the agents i.e. it is usually the static part.However, both follow rules determining their behaviour.

Extended functionality
We can find terms indicating a closer relationship between GIS (Geographical Inforrmation System) and ABM like geosimulation (Benenson and Torrens, 2004) or gisagents.
We have chosen the QGIS software to cut out the workspace located in Great Hungarian plain.In addition to this we used a Python script file that could be parameterised to cut out the given test area in proper format.This method could be extended to any other randomly chosen area considered for similar investigation purposes.In the next step, the raster image obtained with GDAL (Geospatial Data Abstraction Library), an open-source GIS function library was loaded into NetLogo through its 'gis' extension.
The information products were created with a link (Bakshy and Wilensky, 2007) to Wolfram Mathematica program, as agentbased modelling environments generally have a basic unrestricted appearance (Kornhauser et al., 2007).

Selection of the study area
Our aim was to provide a general method for mapping the landscape diversity potential using ABM on an environmentally problematic region (i.e.land affected erosion, flood, aridity, depletion).This justifies the selection of the Great Hungarian Plain which possesses the all the main features of a typical Hungarian and Eastern European landscape.It also extends into eastern Croatia, northern Serbia, and western Romania and the Ukraine.Its total area is about 100,000 square km, out of which about 52,000 square km lies within Hungary

METHODOLOGY: RANDOM WALK SCOUTING (RWS)
Our agents (landscape scouts) are performing a stochastic random walk by making a parameterized step in a random direction.The cells consist the land cover values derived from the Corine Land Cover nomenclature (Corine, 2015).This is a random, stochastic simulation (Monte-Carlo method) on a study area such that at each time period (t) the land cover values of a visited cell are recorded and being compared to the land cover values of the cell visited by the same agent in the previous time period (t-1).The cells represent the static part, while the agents are the dynamic part of the model.If there is a difference in the land cover values of an agent between the t th and the (t-1) st periods, it means that the land cover changed in the observed agent epoch (t) compared to the previous year (t-1), so the agent stepped to a new type of land.In this case the value of the landscape potential is increased by one.Since the agents move independently, the landscape potential will be the cumulative sum of those agents "who" observed a change in land cover during the consecutive years.The time interval (number of "ticks") can also be increased.Due to the static world and the randomness of algorithm and increasing certain parameters (time and agents) we can reach a quasi-deterministic value, which can truly approximate the diversity potential of landscape.(See pseudocode at appendix.)

Basic example
We are going to introduce two raster worlds with box topology.In the Round Forest and Quadratic Forest raster model shows two types of land cover: the forest and the arable land around it.Figure 3.A circle and a square shaped forest in the same extent and resolution, 400 x 400 cells.
After the world setup -which is the static part -the dynamic part follows.We distribute a certain number of agents randomly on the world.They are elementary, only have one property, a cache memory which contains the land cover of their current position.So every time there is just one string value in their brain ('forest' or 'arable land').The latter property is an increasing list, which consist the coordinates of their routes.After the simulation the cumulated landscape diversity potential can be read out, in the case of Figure 4. it is 3.The value of 3 means the sum of land cover border crosses.In the case of those worlds where only two coherent land cover type occurs the potential is proportional with the perimeter of the formation, otherwise it is rational with the sum of borderlines.On the worlds introduced in Figure 3. we can approximate the value of Pi with the ratio of the calculated potentials on them (circle and square shaped forests).

Mathematical context
During the wandering we register the land cover border crossings of each agent.Each agent (marked as 'i') has its position by coordinate pairs at each epoch (t): There can be a finite land cover type in the investigated worlds: Then we calculate the Monte Carlo integral with the 'P' function, which sums up the total changes as a diversity potential: where a is the number of scout agents and d is the duration of simulation.In the introduced example the a parameter was 7 and the d was 5, and the result, P was 3.

APPLICATION OF THE METHOD
The workspace is a 200 km x 200 km area on the Great Hungarian Plain, which was subdivided into smaller 10 km x 10 km subspaces (worlds).In our case a world contains 100 x 100 cells (See Figure 5.), and one cell represents 100 x 100 meters (1 hectare) on the ground.We picked 1 600 random worlds on the workspace (3.figure).The worlds were cut out from the CORINE Land Cover (CLC) 2012 raster data model and grid codes were converted to land cover names according to the 2-level CORINE nomenclature label.
Figure 5. Visualization of a picked world on the Great Hungarian Plane.The black urban area is Jászkarajenő village, between Szolnok and Kecskemét county seats.
Table 2.The land cover composition of Figure 5.
After 5 000 scouts were set up, and by following their movements the land cover border crossings were registered into a common sum.
Figure 6.Agents on the world (5 000 scouts), we analysed their paths through 20 time epochs.The agents step size length was fixed to one cell width.
Figure 7.Some random worlds of the workspace, only three raster are displayed at scale 1:600 000 with Landsat TMS (Tile Map Service) on the background.

ROBUSTNESS OF THE METHOD
The change of the parameters (number of agents and simulation duration) results in different potential values.The potential is directly proportional to the number of parameters.The error of the prediction shown in Figure 8. indicates that as the number of agents or the time periods are increasing, the model becomes a deterministic one.In the case of 10000 agents and 10 epoch simulation interval the accumulated mean potential was 12 503.7, the lower confidence interval border point was 12 195 and the upper was 12 687, the half of the range it is approx.250.
Table 3. Outputs on different parameter setups on a 10 length sample.M: mean; MD: mean deviation; RMD: relative mean deviation; P: potential.The computation times refer to one core of an Intel® Core™ i3-2350M CPU @ 2.30Ghz.

THE RESULT
After the collection of diversity potential points a potential contour map (Figure 9) was created with the GIS component mentioned earlier.The RWS integral yields the diversity potential.The darker green colour means that the given area possesses a higher potential value, which implies more heterogeneity.On the other hand, lighter colours will correspond to the low landscape diversity, which means that the area is problematic.The interventions by authorities or farmers are necessary on the lower potential fields (areas with light colours).
The relative mean deviation of the workspace (The Great Hungarian Plain) was tested by running the simulation 50 times on a 10 length sample collection of random worlds with 5000 agents and 20 simulation time parameters (500 simulation together).The mean of the relative errors was 2 %.
The created landscape diversity potential map can display the heterogeneous areas of the plain, which can be a base of an intervention.The developed RWS Monte Carlo method can yield a value proportional to the sum of borders (perimeters, surfaces), if the agent (scout) does not have any extra ability.The method can be extended with the implementation of other attributes i.e. speed or memory of agents (the agent-speed could depend on land cover type, forest-slow; or "remember" the landscape values for longer time intervals).In this case the result gets complicated and needs further analysis or investigation.
As a conclusion, we can say that by using a simple agent-based method, we could obtain a landscape diversity map of a chosen area.This method is likely to be extended to a more complex situation, but it requires more elaborate methodology.
Figure 10.The pseudocode of the Random Walk Scouting algorithm.

Figure 1 .
Figure 1.Red and blue coloured agents over white and yellow patches (cells) If the model consists only altering patches we talk about a cellular automata or cellular automaton (CA), else it is an agent-based model: Patches Agents Terminology Not Changing Not installed Raster Changing Not installed Cellular automata Not Changing Installed, Acting Agent-based model Changing Installed, Acting Agent-based modelTable 1. Modelling ways, interaction is always possible between patches and agents

Figure 2 .
Figure 2. The world types of NetLogo: box, horizontal cylinder, vertical cylinder, torus

Figure 4 .
Figure 4. Setting up 7 agents and simulating their wandering through 5 epochs with step size 50.

Figure 8 .
Figure 8. Rerunning the RWS algorithm with different parameter settings on Figure 5's world 10 times.The vertical points represents from bottom: lower 95% confidence interval boundary; mean potential; upper 95% confidence interval boundary

Figure 9 .
Figure 9.The landscape diversity potential map of the Great Hungarian Plain with isopotential lines.The shown potential values are normalised (divided by 100)