Presets
Playback
Forest
Forest and food
Panda body
Camera
Layers
Quality
Model check
The science
A forest as an energy graph
Each tree crown is a node. A directed edge i → j carries the metabolic energy the red panda (m = 4.5 kg) pays to get from crown i to crown j, whichever of three ways is cheapest and possible: a branch bridge when the crown edges nearly touch, a ballistic leap when the gap can be cleared at the animal's maximum take-off speed, or a ground crossing (climb down, walk, climb up) if you allow it. Because climbing up costs far more than climbing down, the graph is directed.
Leaps and climbs
For a gap R to a landing dh metres higher, a projectile launched at angle θ has y(R) = R tanθ - g R^2 / (2 v^2 cos^2θ) = dh, so v^2 = g R^2 / (2 cos^2θ (R tanθ - dh)). The simulator scans θ from 25 to 70 degrees and keeps the slowest take-off that lands on the descending branch. Metabolic cost is the take-off kinetic energy divided by a muscle efficiency of 0.25: E = ½ m v^2 / 0.25. A climb of dh costs m g dh / 0.25, a descent 10 % of that, branch walking m · CoT · d (slider) and ground walking 3 J/kg/m. Check 1 integrates each leap step by step and compares the landing point and energy balance.
Shortest paths and the foraging problem
All-pairs cheapest paths come from Floyd-Warshall; check 2 confirms Dijkstra from every tree gives the same answer. Bamboo patches add digestible energy (illustrative kJ, scaled by the richness slider) but the reserve is capped by the stomach and may never go below zero. Choosing which patches to visit and in what order is an orienteering problem; with at most 10 patches it is solved exactly by dynamic programming over (set of eaten patches, last patch), keeping the highest reserve for each state, because a higher reserve is never worse. Check 3 compares the optimum with brute-force enumeration of every ordered subset on six random forests, and check 4 audits the energy ledger of the route on screen.
What the graphs show
Foraging detours pay only when a patch is worth more than the extra moves; the richness sweep shows where the two routes diverge, and the take-off-speed sweep shows how a stronger leaper replaces expensive ground crossings with canopy leaps.
Honest simplifications
No drag, wind, branch springiness, wet-bark slipping or predators; crowns are points with a radius; one animal; fixed energy numbers that are plausible rather than measured for a real red panda (Ailurus fulgens). It illustrates route planning under energy constraints, not wildlife management.