waternumbers / dynatop

Dynamic TOPMODEL
https://waternumbers.github.io/dynatop/
3 stars 6 forks source link

Returned states reference memory of R6 object #51

Open waternumbers opened 2 years ago

waternumbers commented 2 years ago

In v0.2.2 returned states (unless altered) reference the memory of the states in the R6 object. This means that

dt <- dynatop$new(mdl)$add_data(obs)$initialise()
s <- dt$get_states()
sa <- s+0
dt$sim()
f <- dt$get_states()
all(s==f) ## TRUE
all(sa==f) ## FALSE