This commit is contained in:
33333-33333 2026-09-29 19:10:03 +09:00
commit 01204dfa2f
34 changed files with 1498 additions and 0 deletions

12
model.js Normal file
View file

@ -0,0 +1,12 @@
import {maximumSpeedMultiplier} from './ecology/movement.js';
import {basalMetabolismKJPerDay} from './ecology/metabolism.js';
export const sizeSpeedBoost=maximumSpeedMultiplier;
export const staminaLimit=(mass,gene)=>gene*Math.max(.2,mass/3);
export const recoveryRate=(mass,gene)=>gene*Math.pow(Math.max(.05,mass/3),.75);
// Returns kJ/day when speed is m/day.
export const locomotionCost=(mass,speed)=>.018*Math.pow(Math.max(mass,.001),.684)*Math.max(0,speed);
export const sprintCost=(mass,speed)=>.034*Math.pow(Math.max(mass,.001),.684)*Math.max(0,speed);
export const thermalFitness=(temperature,preferred,tolerance)=>Math.exp(-0.5*(((temperature-preferred)/Math.max(1,tolerance))**2));
export const metabolismKJPerDay=basalMetabolismKJPerDay;
export const decayRate=temperature=>.018*Math.pow(1.88,(temperature-20)/10);