Closed lentinj closed 3 months ago
This sounds good, and would allow you more flexibility, e.g. define length and/or based predation on otherfood. I think otherfood is always needed as you will need to balance the feeding equations with additional energy from other sources.
According to gadget2 userguide otherfood's length is only really there to paper over any problems which would occur without, which makes sense, otherfood is only about making sure there's a biomass of something else available.
It's similar in gadget3, there's a few broken edge-cases if the length dimension isn't there. But it's probably easier to do the same by defining with a single length group with g3_stock('otherfood', c(30, 50), open_ended = FALSE)
or just g3_stock('otherfood', 0)
(0..Infinity).
But either way, without a meaningful length grouping g3a_otherfood_normalcv
() / g3a_otherfood_normalparam
() are kinda pointless. A parametrised mean-weight & parameterized-by-year abundance is probably all the option you need.
Or would you define length groupings for otherfood, given the choice? It's only a bit of copy-paste to make them, but does make what is already a rambling mess of a man page even longer.
I'm thinking of a variation of initialconditions, say g3a_renewal_staticstock(), that works identically to initialconditions but will run on every step rather than just the first one, throwing away any stock from previous step and repopulating.
my initial guess was that otherfood would have been implemented with something like g3_timeareadata
but your suggestion is probably better as @bthe points out (ie, it would allow to define length...).
Will GoB need it?
certainly it will have otherfood.
I assume it would be possible to have more than one otherfood component if wished, correct? In principle, if I find a reasonable time series of stickleback abundance, we could have two otherfood components, one reflecting stickleback and another generic for the rest
your suggestion is probably better as @bthe points out (ie, it would allow to define length...).
I somehow managed to write all the above without noticing that. Sorry!
I assume it would be possible to have more than one otherfood component if wished, correct?
Yup, they're stocks like any other. You can call them what you like and add as many of them as you like. Just they only have one action associated with them as opposed to the normal heap of actions.
I think this is largely done now. Otherfoods get defined like any other stock:
...then for each, we add the otherfood action:
g3a_otherfood_normalcv
(), the stock has to have (an) age as well as length, otherwise the vonB renewal formulae fall over. I'm assuming this is fine though, and trying to special-case this is more trouble than it's worth.g3a_otherfood
() by default, with options set to something like the above? I'm guessing in general that's what you want.Also, the point I was supposed to make with the above. ifmissing = 0
is needed because our order of actions is (initialconditions) / (early_report) / (stop model run). So we run g3a_otherfood once after the model has finished.
This knot could probably do with unpicking, but having a value for other years is very likely for projections anyway.
The above makes g3a_otherfood()
a bit nicer to work with.
ifmissing = 0
(although some kind of ifmissing will be required for projections eventually).offset = quote(0 * other_wgt__midlen)
hack is no longer necessary, we add it internally if required.
@bthe / @willbutler42 / @vbartolino
For #29, gadget2 has OtherFood, we need something similar.
I'm thinking of a variation of initialconditions, say
g3a_renewal_staticstock()
, that works identically to initialconditions but will run on every step rather than just the first one, throwing away any stock from previous step and repopulating.Does this sound good? Will GoB need it?