Each forager scores every flower it can sense by blending three things a real honeybee weighs: how attractive the colour is to bee vision (blue/violet > yellow/white > red, since bees see poorly into red), how much nectar the bloom offers, and how far it is from the hive. A forager picks the highest-scoring flower within her current range, then tends to stay "flower-constant" — revisiting the same colour on her next trip — exactly as real foragers do, since relearning a new flower's handling technique costs time.
score(flower) = quality · (1 + pref·(2·visionWeight − 1))
/ (1 + (distance / range)²)
- Foraging range — the maximum distance a forager will fly for a source; colonies default to forage within roughly 1 km of the hive and only push further when nearby forage runs thin, at real energetic cost.
- Flower diversity — how many flower colours/species are in bloom at once; more diversity gives colour-selective foragers more high-value options and improves the colony's overall pollen nutrition.
- Colour preference — how strongly bee vision biases the choice toward blue/violet blooms over yellow, white or red; set it to 0 to watch foragers choose almost on nectar quality and distance alone.
- Nectar collected — running total gathered by the whole colony; watch it plateau if range is too short or diversity too low to sustain enough profitable trips.
Real-world relevance: this quality-versus-distance trade-off is optimal foraging theory in miniature — foragers that maximise net energy gain per unit time (reward minus flight cost, divided by round-trip time) out-compete less selective nest-mates, which is why colonies sited near diverse, nearby forage measurably out-produce isolated ones.