City versus wetland: Predicting urban growth in the Vecht area with a cellular automaton model
Melek Tendurus, Atilim Gunes Baydin, Marieke A. Eleveld, Alison J. Gilbert
CCity versus wetland: Predicting urban growth in theVecht area with a cellular automaton model
M. Tend¨ur¨us a , A.G. Baydin b, ∗ , M.A. Eleveld c , A.J. Gilbert c a Faculty of Earth and Life Sciences, Vrije Universiteit Amsterdam, De Boelelaan 10851081 HV Amsterdam, The Netherlands b Department of Applied Physics, Chalmers University of Technology412 96 G¨oteborg, Sweden c Institute of Environmental Studies, Vrije Universiteit Amsterdam, De Boelelaan 10871081 HV Amsterdam, The Netherlands
Abstract
There are many studies dealing with the protection or restoration of wetlandsand the sustainable economic growth of cities as separate subjects. This studyinvestigates the conflict between the two in an area where city growth is threat-ening a protected wetland area. We develop a stochastic cellular automatonmodel for urban growth and apply it to the Vecht area surrounding the cityof Hilversum in the Netherlands, using topographic maps covering the past 150years. We investigate the dependence of the urban growth pattern on the valuesassociated with the protected wetland and other types of landscape surroundingthe city. The conflict between city growth and wetland protection is projectedto occur before 2035, assuming full protection of the wetland. Our results alsoshow that a milder protection policy, allowing some of the wetland to be sacri-ficed, could be beneficial for maintaining other valuable landscapes. This insightwould be difficult to achieve by other analytical means. We conclude that evenslight changes in usage priorities of landscapes can significantly affect the land-scape distribution in near future. Our results also point to the importance of aprotection policy to take the value of surrounding landscapes and the dynamicnature of urban areas into account.
Keywords:
Urban growth, stochastic modeling, cellular automata, wetland,landscape protection
1. Introduction
Landscape is defined, in the European Landscape Convention of the Coun-cil of Europe (2000), as “a zone or area as perceived by local people or visitors, ∗ Corresponding author
Email address: [email protected] (A.G. Baydin)
Preprint submitted to Elsevier November 12, 2018 a r X i v : . [ n li n . C G ] A p r hose visual features and character are the result of the action of natural and/orcultural (that is, human) factors”. While human activity is one of the actors inthe formation of landscapes, it is also a cause of their destruction. Today, thereare unfortunately many landscapes throughout the world that are under seri-ous threat due to factors such as intense use of land, pollution, and insufficientregional planning.Wetlands, the low-lying marshy swampy lands, are a type of landscape underdirect threat by the current pattern of human development. Even though wet-lands have been historically considered as a type of wasteland, their importanceas integral parts of ecosystems has become increasingly realized during the lastfew decades (Whigham et al., 1992). Now it is known that they strongly supportwildlife habitats, improve water quality, buffer storms, and control erosion andflooding (Kusler and Kentula, 1990). Besides their high natural significance,they also have a high economic value as a natural resource and as areas forrecreation. In most developed countries, there are currently many environmen-tal management policies in effect to protect wetlands, while trying to permittheir utilization as a natural resource to continue.In this study we intend to analyze a situation where a developing urbanarea lies very close to a wetland under protection. Urban growth is practicallyinevitable in a sustainable economy (Henderson, 2005). But can a city resistgrowing to protect a wetland? When will the city threaten the wetland or whenwill the wetland threaten the city? For how long will it be feasible to protect thewetland? We investigate and discuss these questions here with a case study ofthe Vecht area in the Netherlands, home to an internationally renowned wetland,and the city of Hilversum lying at the border of the protected area (Fig. 1).Our main aim is to investigate the conflicting dynamics of continuing urbanexpansion and the protection of the local wetland. We present urban growthprojections, based on the current distribution of landscapes and their associatedimportance in terms of natural and economic value, using a stochastic cellularautomaton (CA) model. The model produces quantitative and visual informa-tion on the changing distribution of landscapes in the Vecht area for the nearfuture (up to year 2055) and is used to predict the anticipated date of clashbetween the growing city and the wetland. We also study outcomes of severaldifferent scenarios with different protection priorities. We believe that insightsfrom this and similar models can be significantly valuable in short and long termregional planning works.We provide a brief description of the area in our case study in Section 2.This is followed by the details of the method, employed computational model,and data sources in Section 3, the results of three different runs with the modelin Section 4, and the conclusions drawn in Section 5.
2. The study area
The Vecht area is the floodplain of the river Vecht, forming an importantpart of the delta river system of the Netherlands. It covers a roughly rectangular2 igure 1: Overview of the Vecht area (rectangle), the nearby city of Hilversum, other majorcities of the
Randstad conurbation , and the
Green Heart of the Netherlands (shaded area inthe middle) (Image from Landsat 7. Source: USGS EarthExplorer). area of about 8 km by 20 km and includes wetlands, small lakes, streams, andfen-grassland patches, which create a characteristic flora and fauna with veryhigh biological diversity.The history of the area through the last centuries has been a unique combina-tion of natural and economic processes: early on dominated by peat extractionforming small ponds, transformation of these into larger lakes via erosion, andthe later recovery of the lost land via drainage and regulation of water tables.The area still has a dynamic structure in terms of economy and nature, nowbeing trapped in the middle of the
Randstad conurbation and considered an im-portant part of the National Ecological Network designated by the NetherlandsEnvironmental Assessment Agency.The Randstad (also known as Deltametropool) is a conurbation in the west-ern Netherlands where an increased agglomeration of large cities is underway.It is formed mainly by the cities of Amsterdam, Leiden, the Hague, Rotterdam,Utrecht, and Hilversum. These cities surround the Green Heart of the Nether-lands, a major open space, of which the Vecht area is a part (Van Eck et al.,2005; IDG, 1997). Fig. 1 gives an overview of the location of the Vecht area rel-ative to the Green Heart and the Randstad. While the Green Heart provides avaluable natural environment and an attractive leisure area for the population,the adjacent cities create new jobs and ask for growing urban development.The entire Vecht area is also a part of the “wet axis” of the National Eco-logical Network outlined by the Dutch Nature Policy Plan (LNV, 1997) thataims to connect fragmented natural habitats to improve the region’s ecology.3his work, in turn, forms a part of a larger plan, Natura 2000, of the EuropeanUnion for the protection of seriously threatened habitats and the establishmentof special protection areas throughout Europe (LNV, 2005).The simultaneous high demand for urban development and nature preser-vation make the task of spatial planning of urban areas in the region highlychallenging. Although there are planning decisions applied strictly to keep theenvironmental quality high and the development sustainable, progress is yetinsufficient as noted in the yearly VINEX reports of the Ministry of PublicHousing, Spatial Planning and Environment (VROM, 2003). VINEX statesthat there is a lack of communication and cooperation between municipalities(dealing with construction works) and provinces (dealing with the connectionof natural habitats).
Since Hilversum is located so close to the Vecht area (Fig. 2), it is immedi-ately surrounded by valuable landscapes, comprising not only natural wetlandsand wetlands arranged as recreation areas, but also the Cornebos Forest, whichis an old forest attracting rare birds, and the heathland of Westerheide (VVV,2006). These areas are highly important in terms of their ecological value.Arable lands and pastures nearby also possess economic and ecological impor-tance. Pasturelands, to some extent, form a transition zone between the wetlandand urban areas and provide nesting areas for many bird species.Because of the complex structure of the surrounding landscape, city planningin Hilversum is strict. The city has managed to maintain a stable populationfor the last 10 years to save the protected landscape from harm, but despitelow population growth, the extent of the city keeps growing. The number ofnew housings in a region is suggested as an alternative measure of city growthby Glaeser and Marshall (1994). Fig. 3 shows the data published by StatisticsNetherlands (Het Centraal Bureau voor de Statistiek - CBS), indicating a cleartrend of increase in the number of residential buildings, even though the popu-lation remains more or less steady during the same period. This suggests thatthe phenomenon commonly referred to as “urban sprawl” is in effect in the area,confirming Kasanko et al. (2006).
3. Method
We develop a stochastic cellular automaton (CA) model for urban growth,which is built upon the concept of a total importance value for each landscapeonto which the city may grow. The model is kept as simple as possible at thisstage to examine growth dynamics with clarity. We implement the model inC A simplistic metric summarizing the economic, natural and other values associated witha piece of land. igure 2: The Vecht area and its immediate neighbor, Hilversum (Landsat 7 pseudocolor frombands 1-2-4. Source: USGS EarthExplorer). For making projections with the model, we first need to adopt a reasonableaverage annual rate of urban growth. We assume, by investigating historicalmaps of the Vecht area, one can get a fairly accurate projection of the middle-term growth rate, provided that the maps are sufficiently detailed. For thispurpose, we analyze a collection of topographic maps of the region covering aperiod between 1850 and 1951, with the majority belonging to the 20th century(Table 1). The reason for not including more recent maps is that during mostof this selected period there were no restrictions in place to protect naturalhabitats, and as such, the measured growth rate would reflect unrestrainedfactors affecting the growth. This is favorable because it would reproduce theunbounded growth pattern of the city, while the limiting pressure of landscapeprotection will be dynamically imposed by the CA model in each simulationstep on top of this basis growth rate.For our measurements, we define the area of the city of Hilversum on eachhistorical map by supervised classification using RSI-ENVI 4.1 software. Weconclude that an annual urban growth rate of around 2% is a reasonable valueto assume, after observing trends of growth in historical data and giving more6 able 1: The list of employed spatial data.
Data Source Scale /resolution DateTopographic mapof Amsterdam andHilversum Dienst der MilitaireVerkenningen a TM b a Provided by Geudeke and Zandvliet (1990). b Accessible online ( https://zulu.ssc.nasa.gov/mrsid ) as compressed MrSID TM colorimagery. weight to the trend during the latter half of the 20th century. This value is alsochecked against the short-term projected economic growth rate by StatisticsNetherlands and is consistent.For defining the boundaries of the protected wetland area in our model, weemploy a suggested restoration plan provided by Van den Bergh et al. (2001) andGilbert et al. (2004), which they use to analyze and evaluate land-use scenariosfor wetland areas in the Netherlands, but just taking the present situation intoaccount. While being simple discrete systems of recurrently applied rules, cellular au-tomaton (CA) models have a demonstrated ability to replicate important fea-tures of complexity observed in natural processes, as well as having a number ofadvantages over continuous mathematical models, which are well discussed inCA literature (Schiff, 2008). Using CA models for describing urban growth hasbeen receiving increasing attention in the field of urban planning to study theeffects of growth and to make predictions in diverse geographic settings (Itami,1994; Couclelis, 1997; Torrens and O’Sullivan, 2001). A well-known CA model of7his kind is the SLEUTH (Slope, Land cover, Exclusion, Urbanization, Trans-portation, and Hillshade) model developed by the United States GeologicalSurvey (USGS, 2003), incorporating factors such as the effect of transportationnetworks and slopes, in addition to the spreading of the existing urban area(Jantz et al., 2003).Here, we believe that a simpler model will be sufficient for the purposes ofthis study. The Vecht area is relatively small compared to the scales urban CAmodels are frequently applied to and this means that the effect of excluding ad-vanced features in the model, such as breeding , will be insignificant. Anotherimportant factor is the characteristic flatness of the topography of the Nether-lands, where most of the country including the Vecht area is virtually void ofany hills or slopes (RDG, 1979). This renders factors like slope resistance , avery important part of general urban CA models, irrelevant in this case.In our CA model, we consider the area under study as a grid of cells, whereeach cell is one of 6 types: urban, wetland, heathland, forest, pasture, or water.All cell types except the water type can be urbanized. For initializing the modelwith the current distribution of landscapes in the region, we employ a recentsatellite image (from the GeoCover TM N (cid:48) = r × N (1)where N (cid:48) is the number of new urban cells, r is the annual growth rate, and N is the number of present urban cells. The annual growth rate of urban area A type of growth in urban CA models, in which a new isolated urban cell is occasionallyformed without any adjacent urban cells
8s held fixed during a run, based on the assumption that the expected growthrate of a city should be independent of its size (Cordoba, 2004).
Figure 4: Flowchart of the employed urban growth model.
We take a cautious approach by presuming an ultimate date of reasonableprediction for this model before the year 2055, thinking that calculations cov-ering longer periods would become more diverted by the accumulation of errorsintroduced by assumptions, selected parameters such as the growth rate, andthe intrinsic limitations of the CA modeling approach (Yeh and Li, 2006). Also,the trends and priorities in the Vecht area and in the Netherlands in general arelikely to be changed beyond terms longer than this.
4. Results and discussion
Going back to the questions at the beginning:9 .1. Can the city resist growing to protect the wetland?
This part cannot be answered solely with the aid of the model, but literatureand experiences may help. Economic growth is always desired and has a directinfluence on the growth of cities. A similar situation described by Karen (2001)in Merced County in the United States, an area that has to deal with urbangrowth and wetland recreation simultaneously in California’s Central Valley,exemplifies how complex the situation could become. It has been noted that $27.7 million per year is spent for the maintenance of the wetland recreation area,and the wetland contributes $ 41 million per year back to the local economy andprovides jobs for more than 800 people. The paradox posed by this situationcan immediately be seen: the effort to protect the wetland turns back as acontribution to the local economy, which in turn promotes urban growth andthreatens the wetland.At the same time, wetlands are now recognized globally as a cornerstoneand focal point of economic development in both the developed and developingcountries and ways are sought after that can balance their protection and use.Wetland restoration in the Vecht area presents many valuable economic benefitsto nearby cities, such as income from increased tourism and fishing; and forthe city of Hilversum, economic growth is foreseeable. This growth shouldbe planned in a way which ensures the survival of the wetland and the otherlandscapes in the region.
To answer this question, we design the first run with the model using param-eters thought to represent current policies / priorities in the region. Wetlandimportance value was set to 1.00 (i.e. it is impossible to destroy wetland) tomake sure that it will be protected under all circumstances. Used parametervalues are summarized in Table 2.The main result from our simulation, in addition to the projected spatialdistribution on the map, is the amount of loss in the area of each landscape typepresent. Here, the resulting distribution of different landscapes is summarized inTable 2 for years 2030 and 2055 (as the amount of area lost and as a ratio of theprojected area to the current area) and the projected distribution of landscapesare presented in Fig. 5 from 2015 to 2055 with 20 years interval. Note that theannual urban growth rate during all runs is assumed as 2.0 %, as explained inSection 3.We predict that the clash between the wetland area and the city bound-ary will become significant by the year 2035, well within a timescale to grantconsidering in the current recreation and urban plans of the Vecht area.
The results of the first run in the previous section indicate a deficiency withthat scenario. While the wetland is successfully protected, this comes at thecost of losing other valuable landscapes. The most noticeable is the decrease in10 igure 5: The first run of the model with definite protection for the wetland and decreasingimportance values for heathland, forest and pasture (details in Table 2). Resulting distributionof landscapes is shown between 2015 and 2055 with 20 year intervals.Table 2: Parameters and results for the first run. Definite protection for wetland, decreasingimportance for heathland, forest and pasture a . Landscape Importance 2030 2055Amountlost (km ) Remaining(% of orig-inal) Amountlost (km ) Remaining(% of orig-inal)Wetland 1.00 0 100.0 0 100.0Heathland 0.95 1.39 74.58 3.62 34.03Forest 0.80 5.01 88.22 14.47 66.01Pasture 0.65 10.17 90.82 26.64 72.95 a Annual growth rate is 2.0 %. The simulation starts from year 2005. the total forest area to almost 66% of its original amount by 2055 (Table 2).One may argue that the proximity of the forest to the urban area makes it moreprone to depletion, but it should still be possible to prevent an amount of thisloss by trying to adjust the protection priorities.The other two runs of the model in this section are designed to investigatewhether permitting some loss of wetland helps to save a greater amount ofthe forest. With this purpose, the model was run many times, giving differentimportance values to each type of landscape and observing the results. Here wepresent results from two such runs.Table 3 and Fig. 6 present a situation where the wetland importance param-eter is reduced to 0.90, in an effort to prevent the drastic loss of forest in thefirst run. Surprisingly, it is noticed that with a little sacrifice of the wetland, onehas the potential to save a significant amount of forest: around 82% remainingby 2055, in contrast to the figure of 66% in the first run (compare Table 2 andTable 3).The results of a more radical change in protection policy are presented in Ta-ble 4 and Fig. 7, where we assign wetland, heathland and forest equal protectionpriorities. This results in a situation in which a more even distribution of all11 igure 6: The second run of the model, with the wetland importance reduced to 0.90, in aneffort to prevent the drastic loss of forest in the first run (details in Table 3). The resultingdistribution of landscapes is shown between 2015 and 2055 with 20 year intervals.Table 3: Parameters and results for the second run. The second run with the model, .
Landscape Importance 2030 2055Amountlost (km ) Remaining(% of orig-inal) Amountlost (km ) Remaining(% of orig-inal)Wetland 0.90 0.87 97.30 2.46 92.39Heathland 0.90 1.69 69.27 4.35 20.68Forest 0.85 2.75 93.53 7.69 81.93Pasture 0.65 9.13 91.76 23.55 78.75 a Annual growth rate is 2.0 %. The simulation starts from year 2005. resources is achieved while still maintaining the wetland above others. An issueto recognize here is how this is achieved while the wetland is assigned the sameimportance value as the other landscapes. This is the result of the particulargeographical distribution of landscapes in this region: forest and heathland areunder immediate threat by the growth of Hilversum, while the wetland lies atsome distance, as compared to these.If wetland protection is considered of highest importance in the Vecht area,then the city of Hilversum will totally grow on other landscapes. In this case,these landscapes will be in danger of irreversible loss to keep the wetland safe.The results presented here indicate that setting a conventional, absolute con-straint with the purpose of protecting a type of landscape can lead to otherserious problems as a side effect. We conclude that an environmental man-agement project should take the complex interaction and the unique spatialarrangement of different landscapes in a region into account, instead of sim-ply putting particular regions into protected status according to the immediateperceived threat of the day. 12 igure 7: The third run of the model with equal importance for the wetland, heathland andforest (details in Table 4). Resulting distribution of landscapes is shown between 2015 and2055 with 20 year intervals.Table 4: Parameters and results for the third run. Equal importance for wetland, heathlandand forest a . Landscape Importance 2030 2055Amountlost (km ) Remaining(% of orig-inal) Amountlost (km ) Remaining(% of orig-inal)Wetland 0.80 1.16 96.40 3.38 89.54Heathland 0.80 2.28 58.36 4.35 20.65Forest 0.80 2.33 94.52 6.95 83.67Pasture 0.65 8.69 92.15 23.29 78.98 a Annual growth rate is 2.0 %. The simulation starts from year 2005.
There is another way to protect those landscapes from the threatening urbangrowth in Hilversum, and it is even more effective: promoting a vertical growth(i.e. higher buildings) instead of the current trend of lateral growth. Thissolution can be a very efficient in protecting the valuable landscapes in theVecht area, but there is no indication that this will be happening in the nearfuture.An important insight gained from this study is on the mode of propagationof a growing city in such a configuration of landscapes and the speed at whichthis occurs. This type of information can be very useful in environmental man-agement projects by making it easier to pick which urban areas in the proximityof a protected area to get included in the protection plan (by predicting whetheran urban area will pose a significant threat during the course of the protectionplan).Another issue of importance is how the suggested protection priorities, asrepresented in our model by the so-called importance values, could be imple-mented in reality, while how these priorities should be determined remains aseparate subject. The issue often exceeds environmental considerations and in-13olves other factors such as community demand for each landscape type. Arecent study by Kaplan and Austin (2004) on community preferences aboutneighboring different landscapes, for instance, has shown that there is a consid-erably greater desire for forests than other landscapes, regardless any benefitsthat might be obtained from these.
5. Conclusions
Although urban growth is a dynamic and complex process, significant in-sight can still be gained by experimentation with computational models. Aninvestigation of the Vecht area and the city of Hilversum is particularly usefulin demonstrating this modeling and prediction approach, given the diversity oflandscapes present in the region and the immediate threat posed on these byurban growth.We predict that the pressure to protect the designated wetland area willprobably keep the city away from the wetland until around 2035, after whichthe expected clash between the city and the protection area will occur. But up tothat time, the city would have to grow into other valuable landscapes, includingforests. This leads to our suggestion that, to protect not only the wetland butalso the diversity of other landscapes, the protection pressure on the wetlandshould be reduced to a level bringing the anticipated clash to an earlier date,while still preserving a considerable amount of wetland. This way, we believe,a more even distribution of all resources is achieved while still maintaining thewetland above others. An important aspect to recognize here is how this can beachieved even while the wetland is assigned the same importance value as theother landscapes.It is certain that landscapes will change continuously. But this change shouldbe monitored and controlled in a way that is most beneficial for nature and hu-man society. By investigating this interplay through experiments with differentprotection scenarios, this study shows that even a slight adjustment in the uti-lization priorities of landscapes is capable of achieving important changes in thedistribution of landscapes that we will be depending on in the near future.
6. ReferencesReferences ppendix A. Code for the CA model
Following is the core C namespace HilversumVecht { p u b l i c c l a s s CAModel { p r i v a t e enum CellType { Forest , Heathland , Urban ,Wetland , Water , Canal , Void } // P r e d e f i n e d RGB v a l u e s f o r :// 1 . Reading t h e c e l l t y p e s from t h e i n i t i a l mapp r e s e n t e d t o t h e c l a s s// as a bitmap v i a t h e c o n s t r u c t o r ( Bitmap i n i t i a l M a p ) .// 2 . Producing t h e o u t p u t bitmap w h i l e t h e model i srunning . p r i v a t e s t a t i c Color ModelMapForestColor = Color .FromArgb ( 1 2 1 , 174 , 4) ;p r i v a t e s t a t i c
Color ModelMapHeathlandColor = Color .FromArgb ( 2 1 9 , 198 , 215) ;p r i v a t e s t a t i c
Color ModelMapUrbanAreaColor = Color .FromArgb ( 2 3 1 , 56 , 13) ;p r i v a t e s t a t i c
Color ModelMapWetlandColor = Color .FromArgb ( 1 3 , 111 , 55) ;p r i v a t e s t a t i c
Color ModelMapWaterColor = Color .FromArgb ( 4 6 , 143 , 210) ;p r i v a t e s t a t i c
Color ModelMapCanalColor = Color .FromArgb ( 1 0 7 , 175 , 220) ;p r i v a t e s t a t i c
Color ModelMapVoidColor = Color .FromArgb ( 1 9 5 , 212 , 144) ;p r i v a t e CellType [ , ] ModelMap ;p r i v a t e int
Width , Height ;p r i v a t e f l o a t
ForestValue , WetlandValue ,HeathlandValue , PastureValue ;p r i v a t e b o o l Abort ;p r i v a t e Random rnd ; // The c o n s t r u c t o r o f t h e c l a s s . p u b l i c CAModel ( int width , int h e i g h t , Bitmapi n i t i a l M a p , f l o a t f o r e s t V a l u e , f l o a t wetlandValue , f l o a t heathlandValue , f l o a t p a s t u r e V a l u e ) { Width = width ; Height = h e i g h t ; F ore stV alu e =f o r e s t V a l u e ; WetlandValue = wetlandValue ;HeathlandValue = heathlandValue ; PastureValue p a s t u r e V a l u e ;rnd = new Random ( ) ;ModelMap = ReadModelMap ( i n i t i a l M a p ) ; } // Reads t h e i n i t i a l l a n d s c a p e d i s t r i b u t i o n from t h ebitmap . p r i v a t e CellType [ , ] ReadModelMap ( Bitmap map) { CellType [ , ] r e t = new CellType [ Width , Height ] ; for ( int x = 0 ; x < Width ; x++) for ( int y = 0 ; y < Height ; y++)r e t [ x , y ] = ColorToCellType (map . Get Pixel ( x, y ) ) ; return r e t ; } // Converts a c o l o r i n t h e i n i t i a l l a n d s c a p ed i s t r i b u t i o n bitmap t o a CellType v a l u e . p r i v a t e s t a t i c CellType ColorToCellType ( Color c ) { i f ( c == ModelMapForestColor ) return CellType . F o r e s t ; e l s e i f ( c == ModelMapHeathlandColor ) return
CellType . Heathland ; e l s e i f ( c == ModelMapWetlandColor ) return
CellType . Wetland ; e l s e i f ( c == ModelMapUrbanAreaColor ) return
CellType . Urban ; e l s e return
CellType . Void ; } // Converts a CellType v a l u e i n t o t h e c o r r e s p o n d i n gc o l o r f o r p r o d u c i n g t h e bitmap o u t p u t . p r i v a t e s t a t i c Color CellTypeToColor ( CellType c ) { i f ( c == CellType . F o r e s t ) return ModelMapForestColor ; e l s e i f ( c == CellType . Heathland ) return
ModelMapHeathlandColor ; e l s e i f ( c == CellType . Wetland ) return
ModelMapWetlandColor ; e l s e i f ( c == CellType . Urban ) return
ModelMapUrbanAreaColor ; e l s e i f ( c == CellType . Void ) return
ModelMapVoidColor ; e l s e return
Color . Yellow ; } / Main method f o r running t h e model . p u b l i c void Run( f l o a t growthRate , int s t e p s ) { Abort = f a l s e ; f l o a t i n i t i a l F o r e s t A r e a = CountArea ( CellType .F o r e s t ) ; f l o a t i n i t i a l W e t l a n d A r e a = CountArea ( CellType .Wetland ) ; f l o a t i n i t i a l H e a t h A r e a = CountArea ( CellType .Heathland ) ; f l o a t i n i t i a l U r b a n A r e a = CountArea ( CellType . Urban ); f l o a t i n i t i a l O t h e r A r e a = Width ∗ Height − i n i t i a l U r b a n A r e a − i n i t i a l W e t l a n d A r e a − i n i t i a l F o r e s t A r e a ; int fa , wa , ha , ua ; f l o a t p e r c e n t F o r e s t A r e a , percentWetlandArea ,percentUrbanArea , percentHeathArea ,percentOtherArea ;Bitmap map = new Bitmap ( Width , Height ) ; for ( int i = 0 ; ( i < s t e p s ) && ! Abort ; i ++) { UpdateModelMap ( growthRate ) ;f a = CountArea ( CellType . F o r e s t ) ; wa =CountArea ( CellType . Wetland ) ; ha =CountArea ( CellType . Heathland ) ; ua =CountArea ( CellType . Urban ) ;p e r c e n t F o r e s t A r e a = ( f a / i n i t i a l F o r e s t A r e a ) ∗ ∗ ∗ ∗ ∗ Height − f a − wa − ua − ha ) /i n i t i a l O t h e r A r e a ) ∗ }} // The annual update t o t h e g r i d . p r i v a t e void UpdateModelMap ( f l o a t growthRate ) { int px , py , timeout ; int s t e p s = ( int ) ( ( growthRate / 100) ∗ CountArea (CellType . Urban ) ) ; for ( int i = 0 ; i < s t e p s ; i ++) { // Timeout i n t r o d u c e d f o r performance concerns timeout = 1 0 0 0 0 0 ; hile ( timeout > { px = rnd . Next ( 1 , Width ) ; py = rnd . Next ( 1 ,Height ) ; i f ( ModelMap [ px , py ] != CellType . Urban ) { i f ( UrbanNeighbors ( px , py ) > { i f ( ModelMap [ px , py ] == CellType .Void ) { i f ( PastureValue < = rnd .NextDouble ( ) ) { ModelMap [ px , py ] =CellType . Urban ; break ; }} e l s e i f ( ModelMap [ px , py ] ==CellType . F o r e s t ) { i f ( Fo res tVa lue < = rnd .NextDouble ( ) ) { ModelMap [ px , py ] =CellType . Urban ; break ; }} e l s e i f ( ModelMap [ px , py ] ==CellType . Wetland ) { i f ( WetlandValue < = rnd .NextDouble ( ) ) { ModelMap [ px , py ] =CellType . Urban ; break ; }} e l s e { i f ( HeathlandValue < = rnd .NextDouble ( ) ) { ModelMap [ px , py ] =CellType . Urban ; break ; }}}} timeout −− ; }} // Produces t h e o u t p u t bitmap from t h e c u r r e n t g r i d (v a r i a b l e ”ModelMap ”) . p r i v a t e Bitmap WriteModelMap ( ) { Bitmap r e t = new Bitmap ( Width , Height ) ; for ( int x = 0 ; x < Width ; x++) for ( int y = 0 ; y < Height ; y++)r e t . S e t P i x e l ( x , y , I n t e g e r T o C o l o r ( ModelMap [x , y ] ) ) ; return r e t ; } // Counts t h e number o f urban n e i g h b o r s o f a g i v e nc e l l . p r i v a t e int UrbanNeighbors ( int x , int y ) { //Moore n e i g h b o r h o o d int r e t = 0 ; i f ( ModelMap [ x − − i f ( ModelMap [ x , y − i f ( ModelMap [ x + 1 , y − i f ( ModelMap [ x − i f ( ModelMap [ x + 1 , y ] == CellType . Urban )r e t ++; i f ( ModelMap [ x − i f ( ModelMap [ x , y + 1 ] == CellType . Urban )r e t ++; i f ( ModelMap [ x + 1 , y + 1 ] == CellType . Urban )r e t ++; return r e t ; } // Counts t h e t o t a l number o f c e l l s o f a g i v e nCellType on t h e g r i d . p r i v a t e int CountArea ( CellType c ) { int r e t = 0 ; for ( int x = 0 ; x < Width ; x++) for ( int y = 0 ; y < Height ; y++) i f ( ModelMap [ x , y ] == c )r e t ++; eturn r e t ; }}}}}}