Two bee or not two bee, that is the question

Covered by this post:

  • implementing bees in AI
  • complexities of using AI for a bee

All these little experiments are hopefully leading up to something smarter. This is my next stepping stone in that journey – meet the humble honey “bee”.

Life of a bee

There’s a lot more to being a bee than you might think unless bees are your “thing”.

Like humans, scientists have proven that bees sleep, their days presumably starting as the sun comes up thanks to light receptors (the 3 ocelli) providing a reference to know it’s time to forage.

After leaving the hive, their search for flowers containing nectar and pollen begins. Flowers brightly coloured in the UV range compete to attract the bees.

To avoid flowers that have already been harvested, the bees sense the electrical charge of flowers (more positive means less nectar). After drinking the nectar they store it in their “honey stomach”, and pollen in sacks on their legs.

Staying out until it gets to dusk or their honey stomach is full (whichever occurs first) can lead to a long day where they have been known to travel up to 5 miles, followed by managing to navigate back to the hive using the position of the sun and sensing the earth’s magnetic field.

When they return, they deposit the nectar and pollen and if not yet dusk, they go back out, returning by dusk and going to sleep.

The cycle repeats… And you think your job feels like groundhog day?

OK, but this blog is meant to be about AI – right? Let’s get stuck in.

Below is our bee playground (well, the left half of it to reduce the size of the image). We start with 24 bees in their beds, who wake up and leave in search of nectar.

Although in real life the flowers don’t look a different colour when they have no nectar, ours do artificially, but that’s for your benefit – the bees know without it. Flowers can provide nectar to multiple bees, but clearly not immediately – if they did that, then a bee would fill up on the first flower and fly home. Pollination requires them to visit multiple plants.

NectarNo Nectar

It wouldn’t be complete without a way to track the nectar collected by each bee, so I have fitted the bees with a “nectar gauge”. Don’t worry, it doesn’t hurt them. Our playground of flowers is a bit on the small side. Real bees visit up to 100 flowers per flight, and perform between 10 and 40 flights from the hive in a single day!

We also need a gauge to know how all the bees are doing collectively, so the hive tracks nectar/honey levels with a simple indicator. Yellow is the nectar returned, grey colour is how much the bees harvested and the red line indicates the “best” haul so far.

Although bees don’t usually die touching white things, we want to teach them to “bee” careful – so they get punished if they hit the white edges or touch the black circles. Punished with a swift death; please don’t do this for real.

When nightfall is near, the bees know to return in an orderly manner, no miss-bee-hivin’.

As they arrive at the hive, I have no idea whether bees are allocated their own sleeping quarters, or whether they operate a first come first served room assignment. We need to fill the hive from the bottom up (first-come-first-served). If we fill the top first, the bees cannot get to the lower sleeping quarters without disturbing their hive-mates, and after a long day flying around, they deserve better.

At this point, feel free to look at the source code on GitHub. I hope you appreciate the nice touches. If so, please leave a comment.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *