role-model / roleR

R package implementing the RoLE model
https://role-model.github.io/roleR
GNU General Public License v3.0
1 stars 2 forks source link

comp_sigma won't take an iterFun #84

Closed diazrenata closed 1 year ago

diazrenata commented 1 year ago

@jidec , @ajrominger I was playing around with iterfuns and they work great for dispersal! I tried to change comp_sigma with an iter function and I got an error about comp_sigma not taking functions as arguments (it wants a strict numeric). Is this expected (i.e. we don't implement iter changes in competition via comp_sigma) or is this something to tweak?

params3 <-  roleParams(individuals_local = 100, individuals_meta = 1000, 
                       niter = 10000, niterTimestep = 100, neut_delta = 0, 
                       comp_sigma = function(iter){return(ifelse(iter < 5000, .05, .1))}) 

returns

Error in checkSlotAssignment(object, name, value) :
assignment of an object of class “function” is not valid for slot ‘comp_sigma’ in an object of class “roleParams”; is(value, "numeric") is not TRUE
jidec commented 1 year ago

glad it indeed works for dispersal! And yup we had decided that comp_sigma should not be allowed to time vary, though I am sure this can be up for more discussion if it is something you are interested in.

diazrenata commented 1 year ago

Awesome! Thanks for answering so fast. Sounds good to leave it how it is for now, and I appreciate the clarification!