opytimizer.optimizers.science.wca¶
Water Cycle Algorithm.
-
class
opytimizer.optimizers.science.wca.
WCA
(params: Optional[Dict[str, Any]] = None)¶ A WCA class, inherited from Optimizer.
This is the designed class to define WCA-related variables and methods.
References
H. Eskandar. Water cycle algorithm – A novel metaheuristic optimization method for solving constrained engineering optimization problems. Computers & Structures (2012).
-
__init__
(params: Optional[Dict[str, Any]] = None) → None¶ Initialization method.
Parameters: params – Contains key-value parameters to the meta-heuristics.
-
nsr
¶ Number of rivers summed with a single sea.
-
d_max
¶ Maximum evaporation condition.
-
flows
¶ Array of flows.
-
compile
(space: opytimizer.core.space.Space) → None¶ Compiles additional information that is used by this optimizer.
Parameters: space – A Space object containing meta-information.
-
_flow_intensity
(agents: List[opytimizer.core.agent.Agent]) → None¶ Calculates the intensity of each possible flow (eq. 6).
Parameters: agents – List of agents.
-
_raining_process
(agents: List[opytimizer.core.agent.Agent], best_agent: opytimizer.core.agent.Agent) → None¶ Performs the raining process (eq. 11-12).
Parameters: - agents – List of agents.
- best_agent – Global best agent.
-
_update_stream
(agents: List[opytimizer.core.agent.Agent], function: opytimizer.core.function.Function) → None¶ Updates every stream position (eq. 8).
Parameters: - agents – List of agents.
- function – A Function object that will be used as the objective function.
-
_update_river
(agents: List[opytimizer.core.agent.Agent], best_agent: opytimizer.core.agent.Agent, function: opytimizer.core.function.Function) → None¶ Updates every river position (eq. 9).
Parameters: - agents – List of agents.
- best_agent – Global best agent.
- function – A Function object that will be used as the objective function.
-
update
(space: opytimizer.core.space.Space, function: opytimizer.core.function.Function, n_iterations: int) → None¶ Wraps Water Cycle Algorithm 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.
- n_iterations – Maximum number of iterations.
-