Sorry but I am new to Netlogo, here is my problem:
I have created polar bears, who have better chances to survive on ice than on dirt. I am wondering which effect the ice dirt ratio has on the lifespan of the polar bears. For that I need a list of the polar bears age before they die and create a histogramm with it.
I am greatful for any help.
I got told to use the comand lput, but to be honest I dont quite know how that comand works.
lput
is used to append a value to a list. It reports a new list with the value appended at the end of the list. So every time before one of your polar bears dies (die
), you want to add the age of that bear to a list and store this new list using set
.
What you need to do
set age-death-list []
set age-death-list lput age age-death-list
histogram age-death-list
Here you find examples and syntax on how to use lput and histogram.