I already confirmed the information on the link. However I could not apply this. The following is a part of the sample model program. I wanted to accumulate the number of turtles, however I could not accumulate it with the sample program. I probably need your advice. Thank you.
globals [num-turtles cumulative-sum average-time number-dead ]
turtles-own [count-up]
to setup
clear-all
set num-turtles 5
reset-ticks
end
to go
if count turtles < num-turtles
[ ask patch 0 0
[ sprout 1
[ set count-up 0 ]
]
]
set cumulative-sum cumulative-sum + 1 ;I would like to calculate the integral value here, but this syntax is not a cumulative value.
ask (turtles-on patch 0 0)
[
set cumulative-sum count turtles-here
]
set average-time ifelse-value (number-dead = 0)
[ 0 ][(cumulative-sum) / (number-dead)]
if (count turtles > 0) [
ask min-one-of turtles [who] [
if count-up >= 6 [
set number-dead number-dead + 1
die
]
]
]
ask (turtles-on patch 0 0)
[ set count-up count-up + 1
]
tick
end