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: ArtificialBee

Onlooker 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

EmployeeBee

food_source#

the current food source (i.e neighbor)

Type

FoodSource

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 candidates

  • itr (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

FoodSource

search(obj_interface)[source]#

Exploit position (near a random EmployeeBee chosen according to computed probability)

Parameters

obj_interface (ObjectiveInterface) – the objective interface used to sample/evaluate candidates