Distance Surface: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
==Screenshot== | ==Screenshot== | ||
[[Image: | [[Image:DistanceSurface.gif]] | ||
==Download Model== | ==Download Model== | ||
Download the .scn, .sel and .lse files by clicking on the following link: [[Image: | Download the .scn, .sel and .lse files by clicking on the following link: [[Image:DistanceSurface.zip]] | ||
==Model Code Exploration== | ==Model Code Exploration== | ||
| Line 14: | Line 14: | ||
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. | 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 | SELES Scenario | ||
$gisData$ = ..\..\ | $gisData$ = ..\..\CaseStudy\gisData\cell | ||
StudyArea = $gisData$\ | StudyArea = $gisData$\StudyArea | ||
SrcLayer = $gisData$\water | |||
Model Dimensions: StudyArea | Model Dimensions: StudyArea | ||
Model.sel | Model.sel | ||
SimPriority Low Priority | SimPriority Low Priority | ||
SimStart 100000 1 | |||
===Model.lse=== | |||
Seles Model | Seles Model | ||
Landscape Events: | Landscape Events: | ||
Distance.lse DEBUG | |||
Spatial Constants: | Spatial Constants: | ||
StudyArea | StudyArea | ||
SrcLayer | |||
Global Constants: | |||
CellWidth = CELL WIDTH(StudyArea) | |||
Spatial Variables: | Spatial Variables: | ||
DistanceFromSrc[CellWidth*(NumRows^2 + NumCols^2)^0.5 + 1] <= 0 | |||
NearestSrcLoc[-1] <= 0 | |||
===Distance.lse=== | |||
LSEVENT: DistanceSurface | |||
DEFINITIONS | DEFINITIONS | ||
LAYER: StudyArea, | LAYER: StudyArea, SrcLayer | ||
GLOBAL | LAYER: DistanceFromSrc, NearestSrcLoc | ||
GLOBAL CONSTANT: CellWidth | |||
CLUSTER VARIABLE: StartLocation | |||
CELL VARIABLE: distInc, d | |||
ENDDEF | ENDDEF | ||
INITIALSTATE | INITIALSTATE | ||
OVER REGION WHOLE MAP | OVER REGION WHOLE MAP | ||
DECISION StudyArea > 0 | DECISION (StudyArea > 0) | ||
DistanceFromSrc = CellWidth*(NUMROWS^2 + NUMCOLS^2)^0.5 + 1 | |||
ENDFN | ENDFN | ||
// DistanceFromSrc = IF (StudyArea > 0) THEN CellWidth*DISTANCE(LOCATION(0,0), LOCATION(NUMROWS-1, NUMCOLS-1)) ELSE 0 | |||
INITIALSTATE = 1 | |||
ENDIS | ENDIS | ||
RETURNTIME = 0 | |||
EVENTLOCATION | |||
REGION WHOLE MAP | |||
REGION | DECISION (StudyArea > 0) AND (SrcLayer > 0) | ||
ENDEL | |||
PROBINIT | PROBINIT | ||
PROBINIT = 1 | PROBINIT = 1 | ||
StartLocation = Location | |||
distInc = 0 | |||
d = 0 | |||
ENDPI | ENDPI | ||
TRANSITIONS | TRANSITIONS | ||
TRANSITIONS = (d < DistanceFromSrc) | |||
DistanceFromSrc = d | |||
TRANSITIONS = ( | NearestSrcLoc = StartLocation | ||
ENDTR | 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== | ==Suggested Experiments== | ||
To explore this cellular automata model further, try the following: | To explore this cellular automata model further, try the following: | ||
Latest revision as of 16:56, 14 November 2006
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: