gadget-framework / rgadget

Rgadget is a set of useful utilities for gadget
6 stars 12 forks source link

Gadgetstock suitability #90

Closed lentinj closed 4 years ago

lentinj commented 4 years ago

After some footling about with it's unit test, add suitability to sub_component. Example of it working in the final commit too.

Note that this isn't a sub-sub-component, an implicit component is still top-level, and basically identical to (in this case) [doeseat]\ndoeseat 1. So using sub_component is fine. The R structure looks like:-

List of 12
 $                  :List of 9
  ..$ stockname          : chr "simple_stock"
  ..$ livesonareas       : NULL
  ..$ minage             : NULL
  ..$ maxage             : NULL
  ..$ minlength          : NULL
  ..$ maxlength          : NULL
  ..$ dl                 : NULL
  ..$ refweightfile      : NULL
  ..$ growthandeatlengths: NULL
 $ doeseat          :List of 5
  ..$ doeseat         : num 1
  ..$ suitability     :List of 2
  .. ..$ prey     :List of 3
  .. .. ..$ type     : chr "function"
  .. .. ..$ suit_func: chr "constant"
  .. .. ..$ alpha    : num 1
  .. ..$ otherfood:List of 3
  .. .. ..$ type     : chr "function"
  .. .. ..$ suit_func: chr "constant"
  .. .. ..$ alpha    : num 1e+05