Distance Surface
Appearance
Summary
Screenshot
Download Model
Download the .scn, .sel and .lse files by clicking on the following link: File:DistanceSurface.zip
Model Code Exploration
In the following sections we will examine all of the model files for this model. Note that instead of downloading the zip file above, you could just copy the text in the boxes below into a text editor and save it with the appropriate name (Section title). Opening the resulting .scn file in the SELES simulator would run this model.
Dist2Roads.scn
SELES Scenario $gisData$ = ..\..\CaseStudy\gisData\cell StudyArea = $gisData$\StudyArea SrcLayer = $gisData$\roads Model Dimensions: StudyArea Model.sel SimPriority Low Priority SimStart 100000 1
Dist2Streams.scn
SELES Scenario $gisData$ = ..\..\CaseStudy\gisData\cell StudyArea = $gisData$\StudyArea SrcLayer = $gisData$\water Model Dimensions: StudyArea Model.sel SimPriority Low Priority SimStart 100000 1
Model.lse
Seles Model Landscape Events: Distance.lse DEBUG Spatial Constants: StudyArea SrcLayer Global Constants: CellWidth = CELL WIDTH(StudyArea) Spatial Variables: DistanceFromSrc[CellWidth*(NumRows^2 + NumCols^2)^0.5 + 1] <= 0 NearestSrcLoc[-1] <= 0
Distance.lse
LSEVENT: DistanceSurface
DEFINITIONS
LAYER: StudyArea, SrcLayer
LAYER: DistanceFromSrc, NearestSrcLoc
GLOBAL CONSTANT: CellWidth
CLUSTER VARIABLE: StartLocation
CELL VARIABLE: distInc, d
ENDDEF
INITIALSTATE
OVER REGION WHOLE MAP
DECISION (StudyArea > 0)
DistanceFromSrc = CellWidth*(NUMROWS^2 + NUMCOLS^2)^0.5 + 1
ENDFN
// DistanceFromSrc = IF (StudyArea > 0) THEN CellWidth*DISTANCE(LOCATION(0,0), LOCATION(NUMROWS-1, NUMCOLS-1)) ELSE 0
INITIALSTATE = 1
ENDIS
RETURNTIME = 0
EVENTLOCATION
REGION WHOLE MAP
DECISION (StudyArea > 0) AND (SrcLayer > 0)
ENDEL
PROBINIT
PROBINIT = 1
StartLocation = Location
distInc = 0
d = 0
ENDPI
TRANSITIONS
TRANSITIONS = (d < DistanceFromSrc)
DistanceFromSrc = d
NearestSrcLoc = StartLocation
ENDTR
SPREADTIME = distInc
// Spread to the four cardinal neighbours
SPREADLOCATION
REGION CENTRED(1, 1)
DECISION (StudyArea > 0) AND (SrcLayer <= 0) AND (DistanceFromSrc > (CellWidth * DISTANCE(StartLocation, Location)))
ENDSL
SPREADPROB
SPREADPROB = 1
d = ROUND(CellWidth*DISTANCE(StartLocation, Location))
distInc = MAX(0,d - SOURCE d)
ENDSP
Suggested Experiments
To explore this cellular automata model further, try the following: