Did It Work?
You had several choices to make for this algorithm. You started the bees and the first food source in a fixed place. You then had to decide how many bees had each role. The code in this book uses ten worker bees, five inactives, and three scouts by default. Your choice affects the number of updates before the bees swarm out of the bag.
You can reason about what happens for some setups. If you have:
-
A single bee which is inactive, nothing will ever happen.
-
A single worker bee, and no others, it gathers food from one spot and only tries nearby spots, so takes a long time to move up.
-
A single scout bee, it can manage to escape from the bag, though it doesn’t do any machine learning.
For greater numbers of bees, run an experiment ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access