lkerr / groundfish-MSE

Development of Robust Management Strategies for Northeast Groundfish Fisheries in a Changing Climate
MIT License
4 stars 2 forks source link

properly set seed #279

Open mle2718 opened 1 year ago

mle2718 commented 1 year ago

the argument of set.seed() is an integer (and quietly converted to an integer). The previous way of setting a seed

start<-Sys.time()-as.POSIXct("2018-01-01 00:00:00", "%Y-%m-%d %H:%M:%S")
start<-as.double(start)*100 

was not necessarily producing integers. It was producing days elapsed from Jan 1, 2018, multiplied by 100. This isn't good enough to ensure that different model runs start at a different value.

mle2718 commented 1 year ago

I'm also not 100% sure we should be setting the seed manually, since according to the help,

Initially, there is no seed; a new one is created from the current time and the process ID when one is required. 

This might be desirable behavior.