traitecoevo / plant

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

FF16 coupling and get_from_package #234

Closed rafaqz closed 4 years ago

rafaqz commented 4 years ago

Parameters are still coupled to FF16_hyperpar

https://github.com/rafaqz/plant/blob/templated_environment/inst/include/plant/parameters.h#L34

What does this do exactly, and any ideas on how to remove it/push it to R?

This is the last coupling to ff16 in the generic classes.

dfalster commented 4 years ago

Interesting, didn't know about that function.

the get_from_package function is defined here and FF16_hyperpar here

The reason for this is that the parameters object needs to have all the parameters used in the strategy in its constructor. Moreover, the parameters may be included in the hyperparameterisation function, which is all R based, but not in the cpp code.

One options may be to change the strategy & env objects to have an explicit parameters class each. Then the parameters constructor would only require the template type names (T,E).

Not sure yet if that would work, but it's something we discussed as potentially useful anyway.

rafaqz commented 4 years ago

All tests pass with hyperpar as NULL (except the simple comparison in test-parameters). Seems like there are missing tests for this.