Bee

class beeoptimal.bee.Bee(position, function, bounds)[source]

Bases: object

Instantiates a bee object for the artificial bee colony algorithm.

position

The current position of the bee in the search space, provided as numpy array of shape (D,), (D,1) or (1,D).

Type:

numpy-array

function

The objective function to evaluate the position.

Type:

callable

bounds

Bounds for each dimension of the search space,provided as a numpy array of shape (D,2) or (2,D).

Type:

numpy-array

trial

Counter to track the number of trials or unsuccessful updates for the bee.

Type:

int

property fitness

Computes the fitness of the bee based on the value of the objective function

Returns:

The fitness value at the bee’s current position.

Return type:

float

property value

Computes the value of the objective function at the bee’s current position.

Returns:

The objective function value for the current position.

Return type:

float