Jump to content

Simple empirical fire model: Difference between revisions

From SELESwiki
 
(7 intermediate revisions by the same user not shown)
Line 15: Line 15:


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


===Model.sel===
===Model.sel===
  Seles Model
  Seles Model Information
  Time Units: Step kiloStep 1000 1000
  Time Units: Day Year 365.25
  Landscape Events:
  Landscape Events:
   Producer.lse DEBUG
   Succession.lse
   Consumer.lse DEBUG
   Fire.lse
   Update.lse DEBUG
Variable-Input View Maps:
  Spatial Variables:
   TimeSinceFire = initialTimeSinceFire
   LSState[3]
  Variable-Output View Maps:
   PrevLSState[3]
   TimeSinceFire
  Legends:
Global Constants:
   LSStateTypes = {0:Uncolonised,    1:Producer, 2:Consumer}
   MaxTSF = 200
  Output Model Bounds:
   TimeSinceFire: MaxTSF
  Global Variables:
  Global Variables:
   pInitialProducer = 0.01
   ForestSize = 250000
   pInitialConsumer = 0.01
   MeanFireSize = 100
   pSpreadProducer = 0.1
   MeanFiresPerYear = 10
   pSpreadConsumer = 0.2
   FireCycle = ForestSize /(MeanFireSize * MeanFiresPerYear)
  pDeathProducer = 0.01
   oldFireCycle = FireCycle OFF
   pDeathConsumer = 0.05
  Output Frequency: 365.250000
//  SpreadRateProducer = 1
//  SpreadRateConsumer = 1
  Output Frequency: 1


===consumer.lse===
===Fire.lse===
   // Process based definition for  consumber behaviour in producer/consumer  model
   SEVENT: SimpleFire
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
RETURNTIME = 0
  RETURNTIME = 365.25
  // Initialize in an empty cell
  // In case the user tries to change this...
  PROBINIT = IF LSState EQ Uncolonised THEN pInitialConsumer ELSE 0
  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
  TRANSITIONS
  // Decide if this cell survives
  // Make a transition only if there is still extent to be burned
  Dies = UNIFORM(0,1) < pDeathConsumer
  // AND if the stand didn't just burn during this event
   // If the consumer is dying
  TRANSITIONS = (Extent >= 1) AND (TimeSinceFire > 0)
   IF Dies
   // Set the time since fire to 0
      LSState = Uncolonised
   TimeSinceFire = 0
  ENDFN
  // Decrement the number of cells remaining to burn for this opening
  TRANSITIONS = !Dies
  Extent = Extent - 1
  LSState = Consumer
  ENDTR
  ENDTR
  SPREADTIMESTEP = 1 //SpreadRateConsumer
// Spread time not relevant
  SPREADTIMESTEP = 0
/* Allow spread to the 4 cardinal neighbours: up, down, left and right  */
  SPREADLOCATION
  SPREADLOCATION
   REGION CENTRED(0,1, WRAPPED)
   REGION CENTRED(1,1)
    DECISION TimeSinceFire > 0
  ENDSL
  ENDSL
  SPREADPROB
  NUMSPREADRECIPIENTS
  // Always spread to the same cell (self), and spread probabilistical to  neighbouring producer cells
  /* Mid-Complex shapes. This is the number of neighbours to */
   SPREADPROB = IF Location EQ (SOURCE  Location) THEN 1
  /* spread to from a burning cell. Lower mean gives more complex shapes. */
              ELSE IF PrevLSState EQ  Producer THEN pSpreadConsumer
  /* Higher standard deviation gives more variety of shapes. */
              ELSE 0
   NUMSPREADRECIPIENTS = CLAMP(NORMAL(0.5,1), 1,3)
ENDSP
  ENDNR
 
===Succession.lse===
===producer.lse===
  LSEVENT: SimpleAging
// Process based definiton of producer  behaviour in producer/consumer model
  LSEVENT: Producer
  DEFINITIONS
  DEFINITIONS
  LAYER: LSState, PrevLSState
  GLOBAL CONSTANT: MaxTSF
  GLOBAL CONSTANT: Uncolonised, Producer,  Consumer
  LAYER: TimeSinceFire
  GLOBAL VARIABLE: pInitialProducer,  pSpreadProducer, pDeathProducer //,  SpreadRateProducer
  ENDDEF
  ENDDEF
  // Just start once
  // Succession is modelled every year
  RETURNTIME = 0
  RETURNTIME = 365.25
  // Initialize in an empty cell
  // Aging simply increments TSF by one year!
PROBINIT = IF LSState EQ Uncolonised THEN  pInitialProducer ELSE 0
  TRANSITIONS
  TRANSITIONS
   // Decide if this cell survives
   TRANSITIONS = TRUE
   Dies = UNIFORM(0,1) < pDeathProducer
   TimeSinceFire = MIN(TimeSinceFire + 1, MaxTSF)
  // If the producer is dying
  IF Dies
      LSState = Uncolonised
  ENDFN
  TRANSITIONS = (!Dies)
  LSState = Producer
  ENDTR
  ENDTR
SPREADTIMESTEP = 1 //SpreadRateProducer
SPREADLOCATION
  notEaten = PrevLSState EQ Producer //  check that the producer wasn't eaten  during the last step
  REGION CENTRED(0, 1, WRAPPED)
      DECISION notEaten // don't spread if  eaten (i.e. stop process)
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===
// Event to update time step
LSEVENT: Update
DEFINITIONS
  LAYER: LSState, PrevLSState
ENDDEF
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:

Latest revision as of 15:53, 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

Succession.lse

LSEVENT: SimpleAging
DEFINITIONS
 GLOBAL CONSTANT: MaxTSF
 LAYER: TimeSinceFire
ENDDEF
// Succession is modelled every year
RETURNTIME = 365.25
// Aging simply increments TSF by one year!
TRANSITIONS
  TRANSITIONS = TRUE
  TimeSinceFire = MIN(TimeSinceFire + 1, MaxTSF)
ENDTR

Suggested Experiments

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