I have an array initialized with zeros in a size of 54. I want that in each passage of an entity, one of the cells randomly will grow in one.
What is the best way to do this?
I tried with a global attribute but i dont know what to write instead of "value". What is the array's name??
set_attribute(key="amounts",value=function(){**value**[sample(1:54,1,TRUE)]+1},global=T)
init<-trajectory("init amount")
set_attribute(key="amount",value=c(rep(0,54)),global=T)
add_generator("init", init, at(0),mon=2)