opytimizer.optimizers.science.lsa¶
Lightning Search Algorithm.
-
class
opytimizer.optimizers.science.lsa.
LSA
(params: Optional[Dict[str, Any]] = None)¶ An LSA class, inherited from Optimizer.
This is the designed class to define LSA-related variables and methods.
References
H. Shareef, A. Ibrahim and A. Mutlag. Lightning search algorithm. Applied Soft Computing (2015).
-
__init__
(params: Optional[Dict[str, Any]] = None) → None¶ Initialization method.
Parameters: params – Contains key-value parameters to the meta-heuristics.
-
max_time
¶ Maximum channel time.
-
E
¶ Initial energy.
-
p_fork
¶ Probability of forking.
-
time
¶ Channel time.
-
direction
¶ Array of directions.
-
compile
(space: opytimizer.core.space.Space) → None¶ Compiles additional information that is used by this optimizer.
Parameters: space – A Space object containing meta-information.
-
_update_direction
(agent: opytimizer.core.agent.Agent, function: opytimizer.core.function.Function) → None¶ Updates the direction array by shaking agent’s direction.
Parameters: - agent – An agent instance.
- function – A Function object that will be used as the objective function.
-
_update_position
(agent: opytimizer.core.agent.Agent, best_agent: opytimizer.core.agent.Agent, function: opytimizer.core.function.Function, energy: float) → None¶ Updates agent’s position.
Parameters: - agent – An agent instance.
- best_agent – A best agent instance.
- function – A Function object that will be used as the objective function.
- energy – Current energy value.
-
update
(space: opytimizer.core.space.Space, function: opytimizer.core.function.Function, iteration: int, n_iterations: int) → None¶ Wraps Lightning Search 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.
- iteration – Current iteration.
- n_iterations – Maximum number of iterations.
-