Behavior Space and Fire Model

89 views
Skip to first unread message

Paul

unread,
Feb 22, 2021, 4:41:10 PM2/22/21
to netlogo-users
Greetings,

I am having a slight difficulty executing a code to extend the fire model in behavior space where I can get an output table with the percent- burned for each repetition, i.e. get the percent burned monitor on the interface tab as a data output. 

I believe I need to add a global -> percent-burned
Then create some type of procedure down below:
- to tally
  show count patches [percent-burned = ((burned-trees / initial-trees)
    * 100)]
  print percent-burned
end
I need help tweaking the above, and then confirming what I would put in the experiment box i.e., count "percent-burned" in the measure runs, etc. 

Thank you for your assistance.

Cheers

Aaron Andre Brandes

unread,
Feb 23, 2021, 1:01:08 PM2/23/21
to Paul, netlogo-users

Hi,

First, you should add a reporter procedure to your model code

 

to-report percent-burned

  report (burned-trees / initial-trees) * 100

end

 

Next create your experiment

In the box labeled Measure runs using these reporters, enter

percent-burned

 

An image of a sample experiment definition is attached.

 

Type OK to save your experiment, and then hit the Run button to run it.

In the experiment output popup menu, pick Table output, hit return and name the output file.

 

I have also attached a sample output.

 

Note: if you don’t care about how the output column is labeled, you could skip creating the procedure and just enter

(burned-trees / initial-trees) * 100

Into the the box labeled Measure runs using these reporters

 

Let the list know if you have more questions.

 

Aaron

-- 

Aaron Brandes, Software Developer

Center for Connected Learning and Computer-Based Modeling

--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/6632cedb-2edd-43a5-95ef-e70f89caba0cn%40googlegroups.com.

Fire-expt-definition.png
Fire expt2-percent-burned-table.csv

Paul

unread,
Feb 23, 2021, 3:28:54 PM2/23/21
to netlogo-users
Thank you very much - Spot on!

Dale Frakes

unread,
Feb 24, 2021, 8:13:08 PM2/24/21
to netlog...@googlegroups.com
You could create a reporter to return the result at any given time, then add the variable tally to your globals.

Reporter might look like:


to-report percent-burned
  report (burned-trees / initial-trees) * 100
end


Then add tally to your globals:

globals [
  initial-trees   ;; how many trees (green patches) we started with
  burned-trees    ;; how many have burned so far
  tally  ;; accumulate burn percentage each tick
]


Then in your setup block, put this:
to setup
  ;; all the other stuff
  set tally []  ;; initialize tally to empty list
  reset-ticks
end

Then in your go block:

to go
  ;; all the other stuff
  set tally lput percent-burned tally  ;; accumulate the burned percentage
  show tally                           ;; output if it you're interested
  tick
end

Cheers!

Dale
--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/6632cedb-2edd-43a5-95ef-e70f89caba0cn%40googlegroups.com.

-- 
Dale Frakes
Adjunct Instructor, PhD Candidate
PSU Systems Science
dfr...@pdx.edu - http://web.pdx.edu/~dfrakes/

Paul

unread,
Mar 2, 2021, 2:41:16 PM3/2/21
to netlogo-users
Sorry, you can disregard my previous post, realized there is a difference between Fire and Fire simple.
Cheers

Paul

unread,
Mar 2, 2021, 2:41:21 PM3/2/21
to netlogo-users
Hi

Did the Fire model get simplified over the last day or two?  Now at the bottom of the Code page it is Wilienksy 2006 instead of 1997. There is only one global now instead of two, and there are no breeds, no to-ignite or to fade-embers.  The outcome of course is the same, but if one like fiddling around with how the old code was, is there a way to have that be the default when opening it instead of having to open an old saved file?
Thanks for the helps.
Cheers,
Paul

On Wednesday, February 24, 2021 at 5:13:08 PM UTC-8 dfr...@pdx.edu wrote:
Reply all
Reply to author
Forward
0 new messages