Onlooker Bee#
(hivenas.core.abc.onlooker_bee)
Onlooker Bees’ class responsible for the exploitation phase of the Artificial Bee Colony optimization.
- class OnlookerBee[source]#
Bases:
ArtificialBeeOnlooker Bees, primarily responsible for the exploitation of the solution space. Onlookers search for neighboring food sources.
- employee#
the assigned Employee Bee; stored to access greedy-selection
- Type
- food_source#
the current food source (i.e neighbor)
- Type
- id_tracker#
the bee’s ID for logging and tracking purposes
- Type
int
- assign_employee(employee)[source]#
Assigns an EmployeeBee to the Onlooker for neighbor-search
- Parameters
employee (
EmployeeBee) – the assigned employee bee
- evaluate(obj_interface, itr)[source]#
Evaluates sampled position and increments employee’s trial counter
- Parameters
obj_interface (
ObjectiveInterface) – the objective interface used to sample/evaluate candidatesitr (int) – current ABC iteration (for logging and result-saving purposes)
- Returns
a Pandas Series containing the evaluation’s results (represents a row in the main results CSV file)
- Return type
pandas.Series
- get_center_fs()[source]#
Returns the parent’s center food_source
- Returns
associated employee bee’s center food source
- Return type
- search(obj_interface)[source]#
Exploit position (near a random
EmployeeBeechosen according to computed probability)- Parameters
obj_interface (
ObjectiveInterface) – the objective interface used to sample/evaluate candidates