data3 = {
const N = initialPopSize
const data = ["without infertility", "with infertility"].map(label => ({
gen: 0,
size: numGenerations,
type: label
}))
for (let i = 1; i < numGenerations; ++i) {
const endSizeWithoutInfertile = N * expectedNumChilds ** i
const popSizeFactor = (1 - fractionInfertile) ** i
const exponent = (expectedNumChilds + infertileCompensation * fractionInfertile) ** i
const endSizeWithInfertile = N * popSizeFactor * exponent
data.push({
gen: i,
size: endSizeWithoutInfertile,
type: "without infertility"
})
data.push({
gen: i,
size: endSizeWithInfertile,
type: "with infertility"
})
}
return data
}