ncsu-landscape-dynamics / rpops

PoPS (Pest or Pathogen Spread) R Package
https://ncsu-landscape-dynamics.github.io/rpops/
GNU General Public License v3.0
10 stars 5 forks source link

The C++ pops_model function has too many parameters #90

Closed wenzeslaus closed 3 years ago

wenzeslaus commented 3 years ago

Adding more arguments to the C++ pops_model function causes too many arguments in foreign function call. Currently the function has 62 parameters. Adding 4 (e.g., for the overpopulation movements in #83) causes the error as the limit of 65 is hit. This is according to the documentation (the foreign function here is our pops_model):

arguments to be passed to the foreign function. Up to 65.

The best fix seems to be embrace the concept of config more. For #83, I'm working on a solution along these lines which will be a good prototype for the overall fix. Although it fixes this problem, I'm not sure yet if it works 100%.

ChrisJones687 commented 3 years ago

I have a couple of ideas that we can discuss around this today! The list should work. What about grouping together all of the booleans related to the deterministic to satisfy the R to C++ interface.

nkruskamp commented 3 years ago

Where appropriate, would it make sense to remove the boolean arguments in favor of assuming true or false based on whether a file is passed in (e.g. temp and temperature_coefficient_file)?