opytimizer.optimizers.science.wwo

Water Wave Optimization.

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

A WWO class, inherited from Optimizer.

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

References

Y.-J. Zheng. Water wave optimization: A new nature-inspired metaheuristic. Computers & Operations Research (2015).

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

Initialization method.

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

Maximum wave height.

alpha

Wave length reduction coefficient.

beta

Breaking coefficient.

k_max

Maximum number of breakings.

height

Array of heights.

length

Array of lengths.

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

Compiles additional information that is used by this optimizer.

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

Propagates wave into a new position (eq. 6).

Parameters:
  • agent – Current wave.
  • function – A function object.
  • index – Index of wave length.
Returns:

Propagated wave.

Return type:

(Agent)

_refract_wave(agent: opytimizer.core.agent.Agent, best_agent: opytimizer.core.agent.Agent, function: opytimizer.core.function.Function, index: int) → Tuple[float, float]

Refract wave into a new position (eq. 8-9).

Parameters:
  • agent – Agent to be refracted.
  • best_agent – Global best agent.
  • function – A function object.
  • index – Index of wave length.
Returns:

New height and length values.

Return type:

(Tuple[float, float])

_break_wave(wave: opytimizer.core.agent.Agent, function: opytimizer.core.function.Function, j: int) → opytimizer.core.agent.Agent

Breaks current wave into a new one (eq. 10).

Parameters:
  • wave – Wave to be broken.
  • function – A function object.
  • j – Index of dimension to be broken.
Returns:

Broken wave.

Return type:

(Agent)

_update_wave_length(agents: List[opytimizer.core.agent.Agent]) → None

Updates the wave length of current population.

Parameters:agents – List of agents.
update(space: opytimizer.core.space.Space, function: opytimizer.core.function.Function) → None

Wraps Water Wave Optimization over all agents and variables.

Parameters:
  • space – Space containing agents and update-related information.
  • function – A function object.