traitecoevo / plant

Trait-Driven Models of Ecology and Evolution :evergreen_tree:
https://traitecoevo.github.io/plant
53 stars 20 forks source link

[Access strategy functions] Change Strategy type to expose and access strategy functions #338

Open aornugent opened 2 years ago

aornugent commented 2 years ago

Recent changes have motivated a switch in the Strategy type that we expose in R.

Currently, RcppR6 generates a Strategy as a simple list object, which is lightweight, but does not expose any methods implemented in C++. Using a R6 object to expose these additional routines would allow better control of the ExtrinsicDrivers (implemented in #334) and other state transformations (as described in #309), simplifying some of our R code.

This change will introduce some additional complexity and require changes to how we initialise a Patch using a Parameters object.

The existing workflow involves:

An alternative might instead be to remove the strategies from Parameters and instead:

This change could require substantial modifications to existing workflows and documentation. Happy to spend the time documenting a solution before we commit to implementation. Please share your thoughts!

dfalster commented 2 years ago

Thanks @aornugent

You're right it requires careful consideration. I'm full booked this week, but can discuss next week, after Tuesday?