opytimizer.optimizers.science.efo

Electromagnetic Field Optimization.

class opytimizer.optimizers.science.efo.EFO(params: Optional[Dict[str, Any]] = None)

An EFO class, inherited from Optimizer.

This is the designed class to define EFO-related variables and methods.

References

H. Abedinpourshotorban et al. Electromagnetic field optimization: A physics-inspired metaheuristic optimization algorithm. Swarm and Evolutionary Computation (2016).

__init__(params: Optional[Dict[str, Any]] = None) → None

Initialization method.

Parameters:params – Contains key-value parameters to the meta-heuristics.
positive_field

Positive field proportion.

negative_field

Negative field proportion.

ps_ratio

Probability of selecting eletromagnets.

r_ratio

Probability of selecting a random eletromagnet.

phi

Golden ratio.

RI

Eletromagnetic index.

_calculate_indexes(n_agents: int) → Tuple[int, int, int]

Calculates the indexes of positive, negative and neutral particles.

Parameters:n_agents – Number of agents in the space.
Returns:Positive, negative and neutral particles’ indexes.
Return type:(Tuple[int, int, int])
update(space: opytimizer.core.space.Space, function: opytimizer.core.function.Function) → None

Wraps Electromagnetic Field Optimization over all agents and variables (eq. 1-4).

Parameters:
  • space – Space containing agents and update-related information.
  • function – A Function object that will be used as the objective function.