The donkey is the resource-constrained agent that traverses the constellation graph. It is initialised from the top-level fields ofDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/Constellations/llms.txt
Use this file to discover all available pages before exploring further.
Constellations.json — burroenergiaInicial (starting energy), estadoSalud (health label), pasto (grass in kg), and startAge (age in years). As it moves between stars, each step deducts from its resources according to the edge distance. Letting any resource reach a critical threshold ends the simulation.
Resources
The donkey tracks four independent resources, each representing a different dimension of survival:energy_donkey (0–100 %)
The donkey’s kinetic fuel. Every traversal of an edge reduces energy proportionally to the edge distance. Once energy reaches zero the donkey can no longer move and is considered dead.
health_percent (0–100 %)
A measure of physical condition. It degrades with every travel step and can be partially restored by eating at a star or by landing on a hypergiant. Falling to zero is an immediate death condition.
grass_stored (kg)
The donkey’s food supply. Grass is consumed both during travel and when eating at a star. Running out of grass while energy is already below 10 % triggers starvation.
age (years)
Modified by researching at stars. Some stars add years (ageImpact > 0), others subtract them (ageImpact < 0). Age does not directly cause death but is tracked as a simulation outcome metric.
Health States
Health percentage is continuously mapped to one of five named states defined in theHealthType enum inside src/models/Donkey.py. The mapping is evaluated every time set_health_status() is called.
| State | Percent range | Meaning |
|---|---|---|
Excellent | > 75 to 100 | Full health; no restrictions |
Good | > 50 to 75 | Healthy; cannot eat (eating requires health < 50 %) |
Bad | > 25 to 50 | Degraded; eating permitted only when health is strictly below 50 % |
Dying | > 0 to 25 | Critical; eating is permitted and strongly advisable |
Dead | 0 | Terminal; all actions are blocked |
Travel Costs
Before moving along an edge the simulation callsget_travel_cost(distance) to project the cost of the trip. The method accepts either a plain number or a weight dictionary (the format stored in Vertex.adjacent).
travel() method applies the same ratios during the move and additionally caps all values at zero to prevent negative resources:
get_travel_cost() and travel() use different internal multipliers (1× vs 0.1× / 0.05× / 0.02×). The get_travel_cost() method uses the conservative 1 : 1 projection used by the longest-path DFS to determine whether a branch is worth exploring; travel() applies the lower real-world deductions during actual simulation movement.Eating at a Star
A donkey can eat at a star only when its health is below 50 % and above 0 % (thecan_eat() guard). The star’s timeToEat field is deducted from grass_stored, and amountOfEnergy is added to energy_donkey (always treated as a positive gain). Landing on a hypergiant provides a bonus +10 health on top of the normal energy recovery.
Researching at a Star
Researching costs energy (energyPerResearchTime × researchTime) and applies the star’s healthImpact and ageImpact directly to the donkey. Health impact can be positive (beneficial research) or negative (taxing research). Age impact follows the same sign convention.
researchTime: 1, energyPerResearchTime: 2, healthImpact: 10, and ageImpact: 3 — a costly but health-positive research stop that adds three years.
Death Conditions
is_dead() checks three independent conditions in order. The first condition that evaluates to True sets death_cause and returns immediately.
| # | Condition | death_cause |
|---|---|---|
| 1 | health_percent <= 0 | "Health depleted" |
| 2 | energy_donkey <= 0 | "Energy depleted" |
| 3 | grass_stored <= 0 and energy_donkey < 10 | "Starvation (no grass)" |