opytimizer.optimizers.evolutionary.ep

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.

References

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.
bout_size

Size of bout during the tournament selection.

clip_ratio

Clipping ratio to helps the algorithm’s convergence.

strategy

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).

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

A mutated child.

Return type:

(Agent)

_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).

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

The updated strategy.

Return type:

(np.ndarray)

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

Wraps Evolutionary Programming over all agents and variables.

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