Model code

Spreading.scn
SELES Scenario

Model Dimensions: 100, 100 Model.sel SimPriority Low Priority

Model.sel
Seles Model Time Units: Step KiloStep 1000 100 Landscape Events: Spreading.lse DEBUG

Spatial Variables: DistanceFromSrc[(NumRows^2 + NumCols^2)^0.5+1] Visited[1]

Global Variables: SpreadType = 0

Spreading.lse
LSEVENT: SpreadingTypes

DEFINITIONS LAYER: DistanceFromSrc, Visited

GLOBAL VARIABLE: SpreadType

CLUSTER VARIABLE: StartLocation CELL VARIABLE: distInc, d ENDDEF

RETURNTIME RETURNTIME = 0 DistanceFromSrc = (NUMROWS^2 + NUMCOLS^2)^0.5 ENDRT

EVENTLOCATION REGION LOCATION(LOCATION(NUMROWS/2, NUMCOLS/2)) ENDEL

PROBINIT PROBINIT = 1 StartLocation = Location distInc = 0 d = 0 ENDPI

TRANSITIONS TRANSITIONS = (d < DistanceFromSrc) Visited = 1 DistanceFromSrc = d ENDTR

SPREADTIMESTEP = distInc

SPREADLOCATION maxD = IF (1 <= SpreadType <= 3) THEN 1.5 ELSE 1 REGION CENTRED(1, maxD) DECISION DistanceFromSrc > (DISTANCE(StartLocation, Location)) ENDSL

SPREADPROB SPREADPROB = 1 d = ROUND(DISTANCE(StartLocation, Location)) distInc = CLASSIFY(SpreadType) 0: 1              1: 1               2: DISTANCE(Location, SOURCE Location) 3: MAX(0,d - SOURCE DistanceFromSrc) ENDFN ENDSP