second
This commit is contained in:
parent
5f7fcb96ed
commit
01204dfa2f
34 changed files with 1498 additions and 0 deletions
12
model.js
Normal file
12
model.js
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue