Jump to content

Simple empirical fire model: Difference between revisions

From SELESwiki
No edit summary
No edit summary
Line 15: Line 15:


===Fire.scn===
===Fire.scn===
Seles Model Information
  initialTimeSinceFire = ..\gisData\cell\initialTSF1
  initialTimeSinceFire = ..\gisData\cell\initialTSF1
  Model Dimensions: initialTimeSinceFire
  Model Dimensions: initialTimeSinceFire
Line 28: Line 29:
   Succession.lse
   Succession.lse
   Fire.lse
   Fire.lse
  ReportResults.lse
  Variable-Input View Maps:
  Variable-Input View Maps:
  Species = initialSpecies
   TimeSinceFire = initialTimeSinceFire
   TimeSinceFire = initialTimeSinceFire
  Variable-Output View Maps:
  Variable-Output View Maps:
  Species
   TimeSinceFire
   TimeSinceFire
  Global Constants:
  Global Constants:
   MaxTSF = 200
   MaxTSF = 200
  rAspen = 1
  rPine = 2
  rSpruce = 3
  rBalsam = 4
  Aspen = 1
  Pine = 2
  Spruce = 3
  Balsam = 4


  Output Model Bounds:
  Output Model Bounds:
   TimeSinceFire: MaxTSF
   TimeSinceFire: MaxTSF
  Species: 4
  Global Variables:
  Global Variables:
   ForestSize = 250000
   ForestSize = 250000
Line 56: Line 44:
   FireCycle = ForestSize /(MeanFireSize * MeanFiresPerYear)
   FireCycle = ForestSize /(MeanFireSize * MeanFiresPerYear)
   oldFireCycle = FireCycle OFF
   oldFireCycle = FireCycle OFF
Output Frequency: 365.250000


  PatchBased = TRUE
  SProbAspen2Spruce = 0.1
  SProbPine = 0.01
  SProbPine2Spruce = 0.5
 
  RecordResults = TRUE
Output Frequency: 365.250000


===Fire.lse===
  SEVENT: SimpleFire


===consumer.lse===
  // Process based definition for  consumber behaviour in producer/consumer  model
LSEVENT: Consumder
  DEFINITIONS
  DEFINITIONS
  LAYER: LSState, PrevLSState
  LAYER: TimeSinceFire
  GLOBAL CONSTANT: Uncolonised, Producer, Consumer
  GLOBAL VARIABLE: ForestSize, MeanFireSize, MeanFiresPerYear, FireCycle, oldFireCycle
  GLOBAL VARIABLE: pInitialConsumer,  pSpreadConsumer, pDeathConsumer //,  SpreadRateConsumer
 
  CLUSTER VARIABLE: Extent
  ENDDEF
  ENDDEF
  // Just start once
 
RETURNTIME = 0
  RETURNTIME
// Initialize in an empty cell
  RETURNTIME = 365.25
PROBINIT = IF LSState EQ Uncolonised THEN  pInitialConsumer ELSE 0
 
TRANSITIONS
  // In case the user tries to change this...
   // Decide if this cell survives
  ForestSize = NUMCELLS
  Dies = UNIFORM(0,1) < pDeathConsumer
 
  // If the consumer is dying
  impliedForestSize = MeanFireSize * MeanFiresPerYear * FireCycle
  IF Dies
 
      LSState = Uncolonised
   IF (impliedForestSize NEQ ForestSize)
      // If the user didn't change fire cycle: adjust it.
      IF oldFireCycle EQ FireCycle
        oldFireCycle = FireCycle
        FireCycle = ForestSize / (MeanFireSize * MeanFiresPerYear)
        DISPLAY RECORD
            DECISION (oldFireCycle NEQ 0) OR (FireCycle NEQ 0)
            ForestSize: ForestSize
            impliedForestSize: impliedForestSize
            ratio: impliedForestSize/ ForestSize
            oldFireCycle: oldFireCycle
            newFireCycle: FireCycle
        ENDFN
        oldFireCycle = FireCycle
 
      // Otherwise, the fire cycle was changed so adjust num fires instead
      ELSE
        oldFireCycle = FireCycle
        oldMFPY = MeanFiresPerYear
        MeanFiresPerYear = ForestSize / (MeanFireSize * FireCycle)
        DISPLAY RECORD
            ForestSize: ForestSize
            impliedForestSize: impliedForestSize
            ratio: impliedForestSize/ ForestSize
            oldMeanFiresPerYear: oldMFPY
            newMeanFiresPerYear: MeanFiresPerYear
        ENDFN
      ENDFN
   ENDFN
   ENDFN
  TRANSITIONS = !Dies
ENDRT
  LSState = Consumer
 
  ENDTR
 
  SPREADTIMESTEP = 1 //SpreadRateConsumer
  // Pick number of fires
  SPREADLOCATION
  // with random ignition
   REGION CENTRED(0,1, WRAPPED)
  NUMCLUSTERS
ENDSL
   NUMCLUSTERS = ROUND(NEGEXP(MeanFiresPerYear))
SPREADPROB
 
   // Always spread to the same cell  (self), and spread probabilistical to  neighbouring producer cells
   // For each pick a size
  SPREADPROB = IF Location EQ (SOURCE  Location) THEN 1
  Extent = ROUND(NEGEXP(MeanFireSize))
              ELSE IF PrevLSState EQ  Producer THEN pSpreadConsumer
  ENDNC
              ELSE 0
 
ENDSP


===producer.lse===
// Process based definiton of producer  behaviour in producer/consumer model
LSEVENT: Producer
DEFINITIONS
  LAYER: LSState, PrevLSState
  GLOBAL CONSTANT: Uncolonised, Producer,  Consumer
  GLOBAL VARIABLE: pInitialProducer,  pSpreadProducer, pDeathProducer //,  SpreadRateProducer
ENDDEF
// Just start once
RETURNTIME = 0
// Initialize in an empty cell
PROBINIT = IF LSState EQ Uncolonised THEN  pInitialProducer ELSE 0
  TRANSITIONS
  TRANSITIONS
  // Decide if this cell survives
  // Make a transition only if there is still extent to be burned
  Dies = UNIFORM(0,1) < pDeathProducer
  // AND if the stand didn't just burn during this event
   // If the producer is dying
  TRANSITIONS = (Extent >= 1) AND (TimeSinceFire > 0)
   IF Dies
 
      LSState = Uncolonised
   // Set the time since fire to 0
  ENDFN
   TimeSinceFire = 0
  TRANSITIONS = (!Dies)
 
  LSState = Producer
  // Decrement the number of cells remaining to burn for this opening
  Extent = Extent - 1
  ENDTR
  ENDTR
  SPREADTIMESTEP = 1 //SpreadRateProducer
 
 
// Spread time not relevant
  SPREADTIMESTEP = 0
 
 
/* Allow spread to the 4 cardinal neighbours: up, down, left and right  */
  SPREADLOCATION
  SPREADLOCATION
  notEaten = PrevLSState EQ Producer //  check that the producer wasn't eaten  during the last step
   REGION CENTRED(1,1)
   REGION CENTRED(0, 1, WRAPPED)
    DECISION TimeSinceFire > 0
      DECISION notEaten // don't spread if  eaten (i.e. stop process)
  ENDSL
  ENDSL
SPREADPROB
  // Always spread to the same cell  (self), and spread probabilistically to  empty neighbouring cells
  SPREADPROB = IF Location EQ (SOURCE  Location) THEN 1 // spread to same cell
              ELSE IF PrevLSState EQ  Uncolonised THEN pSpreadProducer
              ELSE 0
ENDSP


===update.lse===
NUMSPREADRECIPIENTS
// Event to update time step
  /* Mid-Complex shapes. This is the number of neighbours to */
LSEVENT: Update
  /* spread to from a burning cell. Lower mean gives more complex shapes. */
DEFINITIONS
  /* Higher standard deviation gives more variety of shapes. */
  LAYER: LSState, PrevLSState
  NUMSPREADRECIPIENTS = CLAMP(NORMAL(0.5,1), 1,3)
ENDDEF
  ENDNR
RETURNTIME
  RETURNTIME = 1
  PrevLSState = LSState
  ENDRT
NUMCLUSTERS = 0


==Suggested Experiments==
==Suggested Experiments==


To explore this cellular automata model further, try the following:
To explore this cellular automata model further, try the following:

Revision as of 15:49, 14 November 2006

Summary

Screenshot

Download Model

Download the .scn, .sel and .lse files by clicking on the following link: File:SimpleFireModel.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.

Fire.scn

Seles Model Information
initialTimeSinceFire = ..\gisData\cell\initialTSF1
Model Dimensions: initialTimeSinceFire
FireModel.sel
Minimize Initial State
Tile

Model.sel

Seles Model Information
Time Units: Day Year 365.25
Landscape Events:
 Succession.lse
 Fire.lse
Variable-Input View Maps:
 TimeSinceFire = initialTimeSinceFire
Variable-Output View Maps:
 TimeSinceFire
Global Constants:
 MaxTSF = 200
Output Model Bounds:
 TimeSinceFire: MaxTSF
Global Variables:
 ForestSize = 250000
 MeanFireSize = 100
 MeanFiresPerYear = 10
 FireCycle = ForestSize /(MeanFireSize * MeanFiresPerYear)
 oldFireCycle = FireCycle OFF
Output Frequency: 365.250000


Fire.lse

 SEVENT: SimpleFire
DEFINITIONS
 LAYER: TimeSinceFire
 GLOBAL VARIABLE: ForestSize, MeanFireSize, MeanFiresPerYear, FireCycle, oldFireCycle
 CLUSTER VARIABLE: Extent
ENDDEF
RETURNTIME
  RETURNTIME = 365.25
  // In case the user tries to change this...
  ForestSize = NUMCELLS
  impliedForestSize = MeanFireSize * MeanFiresPerYear * FireCycle
  IF (impliedForestSize NEQ ForestSize)
     // If the user didn't change fire cycle: adjust it.
     IF oldFireCycle EQ FireCycle
        oldFireCycle = FireCycle
        FireCycle = ForestSize / (MeanFireSize * MeanFiresPerYear)
        DISPLAY RECORD
           DECISION (oldFireCycle NEQ 0) OR (FireCycle NEQ 0)
           ForestSize: ForestSize
           impliedForestSize: impliedForestSize
           ratio: impliedForestSize/ ForestSize
           oldFireCycle: oldFireCycle
           newFireCycle: FireCycle
        ENDFN
        oldFireCycle = FireCycle
     // Otherwise, the fire cycle was changed so adjust num fires instead
     ELSE
        oldFireCycle = FireCycle
        oldMFPY = MeanFiresPerYear
        MeanFiresPerYear = ForestSize / (MeanFireSize * FireCycle)
        DISPLAY RECORD
           ForestSize: ForestSize
           impliedForestSize: impliedForestSize
           ratio: impliedForestSize/ ForestSize
           oldMeanFiresPerYear: oldMFPY 
           newMeanFiresPerYear: MeanFiresPerYear
        ENDFN
     ENDFN
  ENDFN
ENDRT


// Pick number of fires
// with random ignition
NUMCLUSTERS
  NUMCLUSTERS = ROUND(NEGEXP(MeanFiresPerYear))
  // For each pick a size
  Extent = ROUND(NEGEXP(MeanFireSize))
ENDNC


TRANSITIONS
 // Make a transition only if there is still extent to be burned
 // AND if the stand didn't just burn during this event
 TRANSITIONS = (Extent >= 1) AND (TimeSinceFire > 0)
  // Set the time since fire to 0
  TimeSinceFire = 0
 // Decrement the number of cells remaining to burn for this opening
 Extent = Extent - 1
ENDTR


// Spread time not relevant
SPREADTIMESTEP = 0


/* Allow spread to the 4 cardinal neighbours: up, down, left and right  */
SPREADLOCATION
  REGION CENTRED(1,1)
    DECISION TimeSinceFire > 0
ENDSL
NUMSPREADRECIPIENTS
 /* Mid-Complex shapes. This is the number of neighbours to */
 /* spread to from a burning cell. Lower mean gives more complex shapes. */
 /* Higher standard deviation gives more variety of shapes. */
 NUMSPREADRECIPIENTS = CLAMP(NORMAL(0.5,1), 1,3)
ENDNR

Suggested Experiments

To explore this cellular automata model further, try the following: