opytimizer.optimizers.evolutionary.iwo

Invasive Weed Optimization.

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

An IWO class, inherited from Optimizer.

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

References

A. R. Mehrabian and C. Lucas. A novel numerical optimization algorithm inspired from weed colonization. Ecological informatics (2006).

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

Initialization method.

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

Minimum number of seeds.

max_seeds

Maximum number of seeds.

e

Exponent used to calculate the Spatial Dispersal.

final_sigma

Final standard deviation.

init_sigma

Initial standard deviation.

sigma

Standard deviation.

_spatial_dispersal(iteration: int, n_iterations: int) → None

Calculates the Spatial Dispersal coefficient (eq. 1).

Parameters:
  • iteration – Current iteration number.
  • n_iterations – Maximum number of iterations.
_produce_offspring(agent: opytimizer.core.agent.Agent, function: opytimizer.core.function.Function) → opytimizer.core.agent.Agent

Reproduces and flowers a seed into a new offpsring.

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

An evolved offspring.

Return type:

(Agent)

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

Wraps Invasive Weed Optimization 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.
  • iteration – Current iteration.
  • n_iterations – Maximum number of iterations.