Chapter 9 More complex individual models
9.1 Multiple states at birth
The previous chapters focused mainly on models that assume that all newborn individuals have the same, unique state-at-birth. In the Medfly model, presented in section 2.2 to discuss the implementation of a model for demographic analysis, individual age was the only i-state variable, which obviously equals \(0\) for all individuals at birth. In the PNAS model, presented in section 3.2 to discuss the implementation of a model for equilibrium analysis, all individuals were assumed to be born with the same length at birth \(\ell=\ell_b\). The package contains, however, also 4 files (Indet_growth_5bs.h, KlanjscekDEB2.h, Medfly_periodic.h and PNAS2002_5bs.h) that implement models, in which individuals have different states-at-birth. These models will not be discussed extensively. Instead, the following sections will only briefly present some details about their implementation and usage, which are specific to the multiple states-at-birth. These models are all implemented in C, as implementing a PSPM with multiple states at birth will be too slow for all practical purposes.
The implementation of a model with multiple states-at-birth differs in at least 3 aspects from a model with a unique state-at-birth:
The number of possible states at birth has to be defined larger than 1.
The values of the i-state variables at birth have to be defined separately for the different states-at-birth.
Not only the number of offspring produced has to be specified, but also the state-at-birth of the offspring has to be specified.
In addition, the state-at-birth of an individual may influence the threshold value separating consecutive stages, the development and discrete changes in the individual state variables, the fecundity, the mortality and the impact of the individual on its environment (the latter only in case of equilibrium analysis of non-linear models). If this is the case, the values assigned in the routines IntervalLimit(), Growth(), DiscreteChanges(), Fecundity(), Mortality(), and possibly Impact() (see sections 3.3.2.6-3.3.2.11 for an explanation about these functions) will be dependent on the state-at-birth as well.
This last aspect is, however, not absolutely necessary, whereas the aspects 1-3 mentioned above are.
9.1.1 Demographic analysis with multiple states-at-birth
9.1.1.1 Two different offspring body sizes
The file KlanjscekDEB2.h implements a model, in which the life history of the individuals is described by a dynamic energy budget (DEB) model. The model is a variant of the model implemented in the file KlanjscekDEB.h, which assumes that all individuals at birth have the same size at birth \(V_b\). In contrast, the model implemented in the file KlanjscekDEB2.h is based on an assumption that two types of offspring are produced: small offspring with a body size \(0.7\cdot V_b\) and large offspring with a body size \(1.3\cdot V_b\). Both models are discussed in detail in De Roos (2008), the model implemented in KlanjscekDEB.h on page 5-7 and the model with two types of offspring (implemented in KlanjscekDEB2.h) on page 13-14 of De Roos (2008). The implementations of these two models can be listed by executing the commands showpspm("KlanjscekDEB")
and showpspm("KlanjscekDEB2")
. The script KlanjscekDEB that is included with the package as a demo carries out the demographic analysis for both models and graphs the results as a function of food density in the environment, which can be compared with Figure 2 in De Roos (2008).
As shown in the code box below, which contains a snippet from the model implemented in KlanjscekDEB2.h, the number of possible states-at-birth should be defined larger than 1 in the routine SetBirthStates(), in this particular model BirthStates[0] is set equal to 2.
Code block 9.1.1.1.A
/*
*===========================================================================
* DEFINITION OF THE LIFE HISTORY MODELS FOLLOWS BELOW
*===========================================================================
* Specify the number of states at birth for the individuals in all structured
* populations in the problem in the vector BirthStates[].
*===========================================================================
*/
void SetBirthStates(int BirthStates[POPULATION_NR], double E[])
{
BirthStates[0] = 2;
return;
}
The values of the i-state variables in the different states-at-birth have to be defined separately. This means that in the routine StateAtBirth() the assignment of the values to the variables istate[][] has to be made conditional on the value of the index of the state-at-birth BirthStateNr. The model implemented in the file KlanjscekDEB2.h has 2 states-at-birth \(\left\{\boldsymbol{\phi}_1,\boldsymbol{\phi}_2\right\}\). In the code box below it is shown that the state-at-birth \(\boldsymbol{\phi}_1\) (with index BirthStateNr \(= 0\)) corresponds to the small-sized offspring with body size \(0.7\cdot V_b\), while the state-at-birth \(\boldsymbol{\phi}_2\) (BirthStateNr \(= 1\)) corresponds to the large-sized offspring with body size \(1.3\cdot V_b\).
Code block 9.1.1.1.B
/*
*===========================================================================
* Specify all the possible states at birth for all individuals in all
* structured populations in the problem. BirthStateNr represents the index of
* the state of birth to be specified. Each state at birth should be a single,
* constant value for each i-state variable.
*
* Notice that the first index of the variable 'istate[][]' refers to the
* number of the structured population, the second index refers to the
* number of the individual state variable. The interpretation of the latter
* is up to the user.
*===========================================================================
*/
void StateAtBirth(double *istate[POPULATION_NR], int BirthStateNr, double E[])
{
if (BirthStateNr == 0)
{
AGE = 0.0;
VOLUME = 0.7*VB;
Q = 0.0;
H = 0.0;
}
else
{
AGE = 0.0;
VOLUME = 1.3*VB;
Q = 0.0;
H = 0.0;
}
return;
}
Finally, the last part of the code that has to be changed in case of multiple states-at-birth is the assignment of fecundity to different states-at-birth. The model implemented in the file KlanjscekDEB2.h assumes that individuals with a different state-at-birth differ in their offspring production. More specifically, individuals that are born with a small size (\(V=0.7\cdot V_b\)) are assumed to invest 2/3 of the energy that they have available for reproduction on producing small offspring (i.e. with \(V=0.7\cdot V_b\)) and 1/3 of the reproductive energy producing large-sized offspring with \(V=1.3\cdot V_b\). Vice versa, individuals that are born with a large body size (\(V=1.3\cdot V_b\)) are assumed to invest 2/3 of the energy that they have available for reproduction on producing large offspring (i.e. with \(V=1.3\cdot V_b\)) and 1/3 of the reproductive energy producing small-sized offspring with \(V=0.7\cdot V_b\). Parents bias their energetic investment into reproduction therefore toward producing offspring with the same size at birth as they were born with themselves. These different energetic investments into the two types of offspring are subsequently converted into a number of offspring by dividing them by the energy costs to produce a single offspring. For small- and large-sized offspring these costs are proportional to \(0.7\cdot V_b\) and \(1.3\cdot V_b\), respectively. For mothers born with a small size-at-birth this implies that the biased energetic investment in producing offspring with small sizes-at-birth is even more pronounced when considered in terms of number of offspring produced, whereas for mothers born with a large size-at-birth the bias is dampened by the conversion to number of offspring produced.
The size-at-birth of the offspring produced is therefore on average smaller in the model implemented in KlanjscekDEB2.h, compared to the model with a single state-at-birth, which is implemented in KlanjscekDEB.h. As a consequence, the number of offspring produced is larger, which is the most likely reason for the finding that the population growth rate of the model with 2 states-at-birth is consistently larger than in case of a single state-at-birth (see the graphical output of the demo script KlanjscekDEB).
Code block 9.1.1.1.C
/*
*===========================================================================
* Specify the fecundity of individuals as a function of the i-state
* variables and the individual's state at birth for all populations in every
* life stage.
*
* The number of offspring produced has to be specified for every possible
* state at birth in the variable 'fecundity[][]'. The first index of this
* variable refers to the number of the structured population, the second
* index refers to the number of the birth state.
*
* Notice that the first index of the variable 'istate[][]' refers to the
* number of the structured population, the second index refers to the
* number of the individual state variable. The interpretation of the latter
* is up to the user.
*===========================================================================
*/
void Fecundity(int lifestage[POPULATION_NR], double *istate[POPULATION_NR],
double *birthstate[POPULATION_NR], int BirthStateNr, double E[],
double *fecundity[POPULATION_NR])
{
double Er;
if (lifestage[0] == 1) // Only for adults
{
Er = (1-KAPPA)*EM*FOOD*G*(NU*pow(VOLUME, 2.0/3.0) + M*VOLUME)/(FOOD + G);
fecundity[0][0] = fecundity[0][1] = max(Er - (1-KAPPA)*EM*M*G*VP,0);
if (BirthStateNr == 0)
{
fecundity[0][0] *= (2.0/3.0)*KAPPA_R/(EM*(KAPPA*G + FOOD)*0.7*VB);
fecundity[0][1] *= (1.0/3.0)*KAPPA_R/(EM*(KAPPA*G + FOOD)*1.3*VB);
}
else
{
fecundity[0][0] *= (1.0/3.0)*KAPPA_R/(EM*(KAPPA*G + FOOD)*0.7*VB);
fecundity[0][1] *= (2.0/3.0)*KAPPA_R/(EM*(KAPPA*G + FOOD)*1.3*VB);
}
}
else
{
fecundity[0][0] = 0;
fecundity[0][1] = 0;
}
return;
}
In case of multiple states at birth the structures in the output file containing the stable population states is more complex. Consider for example the computation with the file KlanjscekDEB2.h that is executed when running the demo script KlanjscekDEB:
Command box 9.1.1.1.A
> output2 <- PSPMdemo("KlanjscekDEB2", c(0, 1.0, -0.02, 0.4, 1.0), clean=TRUE, force=TRUE)
Building executable KlanjscekDEB2demo.so ...
<...compilation output lines suppressed in this box...>
1.00000000E+00, 6.95508116E-01
9.80000000E-01, 6.82539595E-01
9.60000000E-01, 6.69183490E-01
<...output lines suppressed in this box...>
4.40000000E-01, 9.73367353E-02
4.20000000E-01, 5.99646757E-02
4.00000000E-01, 2.03431517E-02
> cat(output2$curvedesc)
#
# Executing : PSPMdemo("KlanjscekDEB2", c(0, 1, -0.02, 0.4, 1), NULL, NULL)
#
# Parameter values :
#
# Food : 1 Kappa : 0.8 Kappa_R : 0.001
# Nu : 0.075 m : 0.583 g : 1.286
# Vb : 1E-09 Vp : 1.73E-06 [Em] : 0.7
# ha : 0.15
#
# Index and name of bifurcation parameter #1 : 0 (Food)
#
# 1:Food 2:PGR[0] 3:Tc[0] 4:S[0][0] 5:S[0][1] 6:S[0][2] ....
Obviously, this model contains more parameters and hence there are many more columns in the output representing sensitivities of the population growth rate with respect to model parameters. Loading the first structure from the output file KlanjscekDEB2-PGR-0000.csb containing the stable population states and displaying its contents reveals the additional elements due to the multiple states at births:
Command box 9.1.1.1.B
> csbread("KlanjscekDEB2-PGR-0000.csb", 1)
$BifPars
[1] 1
$Parameters
[1] 1.000e+00 8.000e-01 1.000e-03 7.500e-02 5.830e-01 1.286e+00 1.000e-09 1.730e-06 7.000e-01 1.500e-01
$PGR
[1] 0.6955081
$Pop00_StableBirthDist
Bstate00 Bstate01
[1,] 0.7097291 0.2902709
$Pop00_BirthStates
Istate00 Istate01 Istate02 Istate03
[1,] 0 7.0e-10 0 0
[2,] 0 1.3e-09 0 0
$Pop00_Bstate00
StableDist Istate00 Istate01 Istate02 Istate03 ReproVal
[1,] 7.097291e-01 0.0000000 7.000000e-10 0.000000e+00 0.00000000 1.069154
[2,] 6.570771e-01 0.1101390 8.928356e-09 7.625625e-09 0.01058176 1.154825
[3,] 6.074248e-01 0.2202781 3.423292e-08 3.154797e-08 0.02537620 1.249224
<...output lines suppressed in this box...>
[98,] 1.551992e-09 10.6834855 3.313724e-04 9.494863e-04 2.86850013 5.715531
[99,] 1.045388e-09 10.7936245 3.367025e-04 9.735928e-04 2.91605413 3.380026
[100,] 7.097291e-10 10.9001686 3.418510e-04 9.971985e-04 2.96246947 0.000000
$Pop00_Bstate01
StableDist Istate00 Istate01 Istate02 Istate03 ReproVal
[1,] 2.902709e-01 0.0000000 1.300000e-09 0.000000e+00 0.000000000 0.8309155
[2,] 2.687551e-01 0.1101019 1.177775e-08 9.742355e-09 0.009863215 0.8974364
[3,] 2.484770e-01 0.2202038 4.088023e-08 3.735042e-08 0.024398778 0.9706759
<...output lines suppressed in this box...>
[98,] 6.349473e-10 10.6798867 3.321082e-04 9.527934e-04 2.871120854 4.3466391
[99,] 4.276192e-10 10.7899886 3.374354e-04 9.769332e-04 2.918718535 2.5706185
[100,] 2.902709e-10 10.8964976 3.425811e-04 1.000571e-03 2.965176457 0.0000000
The first additional element of the list representing the equilibrium population state is Pop00_StableBirthDist, which specifies the stable distribution of offspring produced with the 2 possible states at birth that are defined in the model. Each of the rows of the element Pop00_BirthStates of the structure specifies a different state at birth with its columns specifying the value of the 4 individual state variables in that particular state. For each state at birth, a stable population distribution for individuals born in that particular state is stored in two-dimensional arrays, called Pop00_Bstate00 and Pop00_Bstate01 respectively. As before, these two-dimensional arrays contain as the first and last column the stable population density and the reproductive value, respectively, while the intervening columns contain the values of the individual state variables. Notice, however, that the first column containing the stable population density does not start at an initial value of 1.0, as for each of the possible states at birth the stable density is multiplied by the corresponding element of the stable population distribution at birth, contained in the two-dimensional array Pop00_Bstate00.
9.1.1.2 Periodic environments
The file Medfly_periodic.h implements a variant of the Medfly model that is discussed in section 2.2, in which juvenile medflies are periodically exposed to a very high mortality rate that decays exponentially within a short time period. Such a scenario could, for example, reflect a periodic treatment of the population with an insecticide that affects all juvenile individuals equally, irrespective of their age. This model is discussed in detail in De Roos (2008, see pp. 8-10) and will thus not be presented further here. The script Medfly_periodic that is included with the package as a demo can be used to obtain the results that are also shown in Figure 3 of De Roos (2008). Notice, however, that this computation takes a while to finish because the periodicity in the juvenile mortality makes it computationally very intensive.
The model implemented in the file Medfly_periodic.h illustrates that it is possible to carry out demographic analysis, i.e. calculation of the population growth rate as a function of a parameter and the sensitivity of the growth rate with respect to all model parameters, even in case of periodic environments. This does, however, not extend to equilibrium and evolutionary analysis, which are based on the assumption that the environment is in a constant, equilibrium state.
9.1.2 Equilibrium and evolutionary analysis with multiple states-at-birth
The two files PNAS2002_5bs.h and Indet_growth_5bs.h implement versions of the models implemented in the files PNAS2002.h and Indet_growth.h and discussed in sections 3.1-3.4 and 5.1-5.3, respectively, but with 5 states-at-birth instead of the unique state-at-birth accounted for in the original models. The analysis of these model versions with multiple states-at-birth is largely similar to the analysis of the original models and will hence not be discussed further. The scripts deRoosPersson5 and Indet_growth5 that are included with the package as demos carry out the same analysis steps as presented in detail in sections 3.4 and 5.3, respectively, but for the model versions with 5 states-at-birth. Instead, in the following I will only discuss for the model implemented in PNAS2002_5bs.h the details, in which this implementation differs from the original model implemented in PNAS2002.h.
The following code box defines two macros, BIRTHSTATES and BIRTHSPREAD, which determine the number of different states-at-birth and the variation in size-at-birth between the smallest and the largest offspring body size. The number of states-at-birth is defined equal to 5 in the routine SetBirthStates(), as shown below:
Code block 9.1.2.A
/*
*===========================================================================
* DEFINITION OF THE LIFE HISTORY MODELS FOLLOWS BELOW
*===========================================================================
* Specify the number of states at birth for the individuals in all structured
* populations in the problem in the vector BirthStates[].
*===========================================================================
*/
#define BIRTHSTATES 5
#define BIRTHSPREAD 2.0
void SetBirthStates(int BirthStates[POPULATION_NR], double E[])
{
BirthStates[0] = BIRTHSTATES;
return;
}
Subsequently, the values of the different states-at-birth is set in the routine StateAtBirth(), dependent on the index BirthStateNr of the state-at-birth. The 5 states-at-birth in the model form a set \(\left\{\boldsymbol{\phi}_1,\boldsymbol{\phi}_2,\boldsymbol{\phi}_3,\boldsymbol{\phi}_4,\boldsymbol{\phi}_5\right\}\). The code box below shows that the length-at-birth in these 5 different states equals \(\ell_b-\Delta/2\), \(\ell_b-\Delta/4\), \(\ell_b\), \(\ell_b+\Delta/4\) and \(\ell_b+\Delta/2\), respectively, where \(\Delta\) is the difference in size-at-birth between the smallest and the largest offspring as given by the macro BIRTHSPREAD (Remember that indices in C start at \(0\) and that the values adopted by BirthStateNr hence run from \(0\) to 4). Of course, for all states-at-birth the age of the individual is set to \(0\).
Code block 9.1.2.B
/*
*===========================================================================
* Specify all the possible states at birth for all individuals in all
* structured populations in the problem. BirthStateNr represents the index of
* the state of birth to be specified. Each state at birth should be a single,
* constant value for each i-state variable.
*
* Notice that the first index of the variable 'istate[][]' refers to the
* number of the structured population, the second index refers to the
* number of the individual state variable. The interpretation of the latter
* is up to the user.
*===========================================================================
*/
void StateAtBirth(double *istate[POPULATION_NR], int BirthStateNr, double E[])
{
AGE = 0.0;
LENGTH = LB + (((double)BirthStateNr)/((double)(BIRTHSTATES-1)) - 0.5)*BIRTHSPREAD;
return;
}
The final routine that differs between the models with a unique state-at-birth and 5 states-at-birth is the routine specifying the fecundity of an individual, as this routine should not only specify the number of offspring produced, but also the state-at-birth of the offspring produced. The code box below shows that the model implemented in the file PNAS2002_5bs.h assumes that the distribution of the produced offspring is independent of the size-at-birth of the mother, since the variables fecundity[0][0] to fecundity[0][4] are assigned the same values irrespective of the index BirthStateNr or the state-at-birth birthstate[][]. All mothers produce 50% of their offspring with a length-at-birth equal to \(\ell_b\), 20% of their offspring each with a length-at-birth equal to \(\ell_b-\Delta/4\) and \(\ell_b+\Delta/4\) and 10% each with the most extreme lengths-at-birth of \(\ell_b-\Delta/2\) and \(\ell_b+\Delta/2\).
The demo script deRoosPersson5 performs the same analysis steps for the PNAS2002 model with 5 states-at-birth, as carried out by the demo script deRoosPersson for the original model. Executing this script shows that there are at most quantitative differences, if at all, between the results of the two models. A similar finding is obtained when comparing the results of the demo script Indet_growth5 that performs the analysis of the model presented in section 5.2 but with 5 states-at-birth with the results of the original model, the analysis of which was discussed in section 5.3. In both cases the additional states-at-birth hence hardly affect model predictions.
Code block 9.1.2.C
/*
*===========================================================================
* Specify the fecundity of individuals as a function of the i-state
* variables and the individual's state at birth for all populations in every
* life stage.
*
* The number of offspring produced has to be specified for every possible
* state at birth in the variable 'fecundity[][]'. The first index of this
* variable refers to the number of the structured population, the second
* index refers to the number of the birth state.
*
* Notice that the first index of the variable 'istate[][]' refers to the
* number of the structured population, the second index refers to the
* number of the individual state variable. The interpretation of the latter
* is up to the user.
*===========================================================================
*/
void Fecundity(int lifestage[POPULATION_NR], double *istate[POPULATION_NR],
double *birthstate[POPULATION_NR], int BirthStateNr, double E[],
double *fecundity[POPULATION_NR])
{
double fec;
fecundity[0][0] = 0.0;
fecundity[0][1] = 0.0;
fecundity[0][2] = 0.0;
fecundity[0][3] = 0.0;
fecundity[0][4] = 0.0;
if (lifestage[0] == 2)
{
fec = RM*R/(R + RH)*LENGTH*LENGTH;
fecundity[0][0] = 0.1*fec;
fecundity[0][1] = 0.2*fec;
fecundity[0][2] = 0.5*fec;
fecundity[0][3] = 0.2*fec;
fecundity[0][4] = 0.1*fec;
}
return;
}
9.1.3 Other applications of multiple states-at-birth
The models with multiple states-at-birth discussed here only represent the basic type of application of this modeling feature. The option to account for multiple states-at-birth allows, however, for modeling a variety of scenarios. It goes too far to present this range of scenarios in detail and I will hence limit myself to pointing out a few examples.
As one example, multiple states-at-birth can be used to distinguish between the sexes in a population model. Two states-at-birth can then be defined, representing the male and female sex of an individual. An individual’s sex can influence its life history through for example development and mortality. If in addition the fecundity of the (female) individuals is modeled following a particular type of mating structure, it might be necessary in to define the total number of mature males and/or females in the population as environment variables.
As another example, multiple states-at-birth make it possible to account for population-genetic processes in a model. For example, 3 states-at-birth could be used to model the 2 homozygous and the single heterozygous genotypes in a one locus-two allele population model. Multiple alleles would be possible to account for as well at the expenses of defining more states-at-birth. In this manner, the interplay between population-genetic processes and complex individual life histories could be analyzed for its population and even community consequences.
9.2 Pulsed reproduction
All previous chapters listed as one of the basic assumptions for the class of structured population models that can be analyzed with this software package that reproduction is modeled with a function \(\beta(\boldsymbol{\chi}, \boldsymbol{\chi}_b, E)\), representing the rate of offspring production, dependent on the individual state, the individual’s state-at-birth and possibly on its environment. Reproduction is hence considered a continuous process. If reproduction would occur as a pulsed process in time, the density of individuals in a population would change instantaneously as would its impact on its environment. This precludes that the environment is constant in time, which is a crucial assumption for the equilibrium and evolutionary analysis of structured population models. Demographic analysis, however, is still possible even when reproduction occurs as a pulsed process in time.
To model reproduction as a pulsed process in time in case of demographic analysis of a structured population, the time interval between successive reproduction events has to be defined for a model implemented in C using the macro constant REPRODUCTION_INTERVAL, as for example shown in the command box below.
Code block 9.2.A
// The following definition will force the program to consider reproduction pulses
#define REPRODUCTION_INTERVAL 1.0
Reproduction will be assumed a pulsed event whenever REPRODUCTION_INTERVAL is defined. Notice that it is not possible to have irregular intervals between reproductive pulses, the interval is necessarily constant and equal to the value to which REPRODUCTION_INTERVAL is set.
The model file KlanjscekDEBpulsed.h, which can be listed using the command showpapm("KlanjscekDEBpulsed")
provides an example of a model that describes reproduction as a pulsed process (the model is also discussed in De Roos (2008)). The model implemented in this file is similar to the model implemented in the file KlanjscekDEB2.h, which is discussed in section 9.1.1, except for the fact that reproduction occurs as a pulsed event at regular time intervals of 1 time unit and all newborn individuals have the same state at birth.
To model the pulsed reproduction process an additional state variable characterizing an individual is introduced in the model, which represents the number of eggs that an adult individual has accumulated in its body. This content of the egg buffer is the 5th individual state variable in the model as shown in the following code box:
Code block 9.2.B
#define EGGS istate[0][4]
The routine Development now contains additional statements specifying the dynamics for this individual state variable, which hence describe how the egg buffer is filling up in between two reproduction events. Naturally, this only occurs when an individual has matured, as shown in the code box below:
Code block 9.2.C
void Development(int lifestage[POPULATION_NR], double *istate[POPULATION_NR],
double *birthstate[POPULATION_NR], int BirthStateNr, double E[],
double development[POPULATION_NR][I_STATE_DIM])
{
double dVda, dQda, dHda;
double Er;
// Assume growth always occurs
dVda = max((FOOD*NU*pow(VOLUME, 2.0/3.0) - M*G*VOLUME)/(FOOD + G), 0);
dQda = G*EM*(dVda + M*VOLUME);
dHda = HA*Q/VOLUME;
development[0][0] = 1.0;
development[0][1] = dVda; // dV/da
development[0][2] = dQda; // dQ/da
development[0][3] = dHda; // dH/da
if (lifestage[0] == 1) // Only for adults
{
Er = (1-KAPPA)*EM*FOOD*G*(NU*pow(VOLUME, 2.0/3.0) + M*VOLUME)/(FOOD + G);
development[0][4] = max(Er - (1-KAPPA)*EM*M*G*VP,0);
development[0][4] /= EM*(KAPPA*G + FOOD)*VB/KAPPA_R;
}
else
development[0][4] = 0;
return;
}
Finally, if reproduction is modeled as a pulsed process the routine Fecundity has to specify the number of offspring produced at a reproduction event. As opposed to the case with continuous reproduction the fecundity is not a rate, but rather a number of offspring. As shown below, for the model implemented in KlanjscekDEBpulsed.h the fecundity is defined equal to the number of accumulated eggs. At the same time the egg buffer is emptied, i.e. EGGS set equal to \(0\). Hence, in case of pulsed reproduction, the routine Fecundity should not only define how many offspring are produced (possibly with different states at birth), but also how the individual state of the parent is changed when it reproduces.
Code block 9.2.D
void Fecundity(int lifestage[POPULATION_NR], double *istate[POPULATION_NR],
double *birthstate[POPULATION_NR], int BirthStateNr, double E[],
double *fecundity[POPULATION_NR])
{
if (lifestage[0] == 1) // Only for adults
{
fecundity[0][0] = EGGS;
}
else
fecundity[0][0] = 0;
EGGS = 0.0; // Empty the egg buffer
return;
}
The demo script KlanjscekDEB that is included with the package illustrates the analysis of the model in KlanjscekDEBpulsed.h at the same time as it analyzes the related models implemented in KlanjscekDEB.h and KlanjscekDEB2.h.