Spreading.lse

Return to Spreading1 model overview

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