publish
This commit is contained in:
parent
01204dfa2f
commit
f5fc9b76ce
73 changed files with 32628 additions and 376 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import {annualSurvivalToDailyHazard,rateToProbability,clamp} from './units.js';
|
||||
import {annualSurvivalToDailyHazard,rateToProbability,clamp} from './units.js?v=45';
|
||||
|
||||
// Life-history fallbacks are simulator calibration values, not universal biological constants.
|
||||
export const ROLE_DEMOGRAPHY = Object.freeze({
|
||||
|
|
@ -10,8 +10,8 @@ export const ROLE_DEMOGRAPHY = Object.freeze({
|
|||
export function backgroundHazardPerDay(role){return annualSurvivalToDailyHazard((ROLE_DEMOGRAPHY[role]||ROLE_DEMOGRAPHY['primary-consumer']).annualSurvival)}
|
||||
export function mortalityOccurs(hazardPerDay,dtDays,random){return random()<rateToProbability(hazardPerDay,dtDays)}
|
||||
export function reproductionConfig(role){return ROLE_DEMOGRAPHY[role]||ROLE_DEMOGRAPHY['primary-consumer']}
|
||||
export function inBreedingSeason(day,role){
|
||||
const doy=((day%365)+365)%365;
|
||||
export function inBreedingSeason(day,role,phaseDays=0){
|
||||
const doy=(((day-phaseDays)%365)+365)%365;
|
||||
if(role==='tertiary-consumer')return doy>=60&&doy<=180;
|
||||
if(role==='secondary-consumer')return (doy>=60&&doy<=165)||(doy>=245&&doy<=300);
|
||||
if(role==='detritivore')return (doy>=35&&doy<=175)||(doy>=220&&doy<=315);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue