Evolutionary Programming.

class opytimizer.optimizers.evolutionary.ep.EP(params: Optional[Dict[str, Any]] = None)

An EP class, inherited from Optimizer.

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


A. E. Eiben and J. E. Smith. Introduction to Evolutionary Computing. Natural Computing Series (2013).

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

Initialization method.

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

Size of bout during the tournament selection.


Clipping ratio to helps the algorithm’s convergence.


Array of strategies.

compile(space: opytimizer.core.space.Space) → None

Compiles additional information that is used by this optimizer.

Parameters:space – A Space object containing meta-information.
_mutate_parent(agent: opytimizer.core.agent.Agent, index: int, function: opytimizer.core.function.Function) → opytimizer.core.agent.Agent

Mutates a parent into a new child (eq. 5.1).

  • agent – An agent instance to be reproduced.
  • index – Index of current agent.
  • function – A Function object that will be used as the objective function.

A mutated child.

Return type:


_update_strategy(index: int, lower_bound: numpy.ndarray, upper_bound: numpy.ndarray) → numpy.ndarray

Updates the strategy and performs a clipping process to help its convergence (eq. 5.2).

  • index – Index of current agent.
  • lower_bound – An array holding the lower bounds.
  • upper_bound – An array holding the upper bounds.

The updated strategy.

Return type:


update(space: opytimizer.core.space.Space, function: opytimizer.core.function.Function) → None

Wraps Evolutionary Programming over all agents and variables.

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