This is a wrapper for addPixelGroup
, initiateNewCohort
and
updates to pixelGroupMap
via assignment to new pixelIndex
values in newCohortData
. By running these all together,
there is less chance that they will diverge. There are some checks
internally for consistency.
Calculate new values for B
, add age
, then rbindlist
this
with cohortData
.
addCohorts(newCohortData, cohortData, pixelGroupMap, time, speciesEcoregion) initiateNewCohort(newCohortData, cohortData, pixelGroupMap, time, speciesEcoregion)
newCohortData | must be a complete cohortData object with entirely new
|
---|---|
cohortData | a |
pixelGroupMap | Raster layer with pixel values equal to a pixel group number that
correspondsd exactly to |
time | Current time e.g., time(sim). This is used to extract the correct
parameters in |
speciesEcoregion | A |
A list of length 2, cohortData
and pixelGroupMap
, with
newCohortData
inserted.
initiateNewCohort
returns A data.table
with a new,
rbindlist
ed cohortData
Does the following:
add new cohort data into cohortdata
;
assign initial biomass and age for new cohort;
assign the new pixelgroup to the pixels that have new cohort;
update the pixelgroup map.