Vanaspati
Vanaspati (वनस्पति — Sanskrit for "lord of the forest, plant/tree") — botany and plant behavior engine for growth, photosynthesis, seasonal cycles, and ecosystems.
Part of the AGNOS ecosystem.
What It Does
Vanaspati defines the science of plants — growth models, photosynthesis, seasonal cycles, root systems, pollination, and ecosystem dynamics. It provides the math; consumers decide what to do with it (render forests, simulate ecosystems, model agriculture).
kiran → vegetation in game worlds (forests, grass, crops)
vanaspati → defines plant behavior (growth, photosynthesis, seasons) ← this crate
joshua → ecosystem simulation, agricultural modeling
badal → weather/climate data drives growth
jantu → animals interact with plants (habitat, food)
garjan → foliage rustling, branch creaking
Features
- Growth — logistic growth curves with stage progression (seed through senescence), factory presets (oak, bamboo, grass), water & nitrogen stress factors
- Photosynthesis — C3/C4/CAM pathways, light response curves, temperature factors, Beer-Lambert canopy light competition, water stress
- Water — soil water storage (5 soil types), precipitation/infiltration/runoff, drainage, transpiration, evaporation, daily water balance
- Nitrogen — soil N pools (available + organic), mineralization, plant uptake, leaching, nitrogen stress on growth
- Stomata — Ball-Berry conductance, VPD, transpiration, drought/VPD factors, boundary layer conductance
- Seasons — latitude-parameterized daylight hours (sunrise equation), hemisphere-aware season mapping, growth modifiers
- Phenology — growing degree days, chilling hours (Utah model), phenological events (bud break through dormancy)
- Root Systems — taproot, fibrous, adventitious — depth, spread, water uptake, root zone fraction, stabilization
- Biomass — organ pools (leaf/stem/root/reproductive), allocation strategies, allometric scaling
- Mortality — age (Weibull), drought, frost, competition (self-thinning), fire, disease, windthrow
- Dispersal — wind, animal, gravity, water, explosive — exponential decay kernel, seed profiles
- Pollination — wind, insect, bird, water, self — distance-based probability
- Decomposition — litter types, Q10 temperature/moisture factors, exponential decay, nitrogen release
- Herbivory — grazing/browsing/frugivory/root feeding, compensatory growth, herbivory mortality
- Succession — pioneer/climax dynamics, shade tolerance, establishment probability, competitive displacement
- Reproduction — vegetative methods (runners, rhizomes, root sprouts, layering), clonal spread, resource-limited ramet production
- Fire Ecology — fire adaptation strategies (resprouter, thick-barked, serotinous), bark protection, post-fire regeneration
- Mycorrhiza — ectomycorrhizal/arbuscular/ericoid types, nutrient enhancement, colonization, hyphal networks
- Allelopathy — allelochemical production, soil accumulation/decay, dose-response growth/germination inhibition
- Ecosystem — Lotka-Volterra competition, Shannon-Wiener diversity, net primary productivity
- Bridge — 20+ cross-crate functions connecting badal (weather), ushma (thermodynamics), pravash (fluid), jantu (creatures)
Quick Start
Add to your Cargo.toml:
[]
= "1.0"
use ;
// Grow an oak tree
let oak = oak;
let height = oak.height_at_day; // meters after 1 year
let daily = oak.daily_growth; // meters/day at 5m tall
// Photosynthesis: Pmax=20 µmol CO₂/m²/s, α=0.05, PAR=800 µmol/m²/s
let rate = photosynthesis_rate;
// Seasonal growth modifier
let modifier = Summer.growth_modifier; // 1.0
// Soil water balance
let mut soil = loam;
let fluxes = daily_water_balance;
Optional Features
[]
= { = "1.0", = ["logging"] }
| Feature | Description |
|---|---|
logging |
Structured logging via tracing |
soorat-compat |
Visualization types for soorat/kiran rendering |
Dependencies
| Crate | Purpose |
|---|---|
hisab |
Math primitives (interpolation, transforms, numerics) |
serde |
Serialization / deserialization |
thiserror |
Error handling |
tracing |
Structured logging |
Consumers
| Crate | Usage |
|---|---|
| kiran | Vegetation in game worlds (forests, grass, crops) |
| joshua | Ecosystem simulation, agricultural modeling |
| garjan | Foliage rustling, branch creaking |
| jantu | Habitat/food source for creature behavior |
Development
See CONTRIBUTING.md for the full workflow.
Roadmap
See docs/development/roadmap.md for completed work, planned cross-crate bridges, and future features.