opytimizer.optimizers.swarm.js

Jellyfish Search-based algorithms.

class opytimizer.optimizers.swarm.js.JS(params: Optional[Dict[str, Any]] = None)

A JS class, inherited from Optimizer.

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

References

J.-S. Chou and D.-N. Truong. A novel metaheuristic optimizer inspired by behavior of jellyfish in ocean. Applied Mathematics and Computation (2020).

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

Initialization method.

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

Chaotic map coefficient.

beta

Distribution coeffiecient.

gamma

Motion coeffiecient.

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

Initializes a set of agents using a logistic chaotic map.

Parameters:agents – List of agents.
compile(space: opytimizer.core.space.Space) → None

Compiles additional information that is used by this optimizer.

Parameters:space – A Space object containing meta-information.
_ocean_current(agents: List[opytimizer.core.agent.Agent], best_agent: opytimizer.core.agent.Agent) → numpy.ndarray

Calculates the ocean current (eq. 9).

Parameters:
  • agents – List of agents.
  • best_agent – Best agent.
Returns:

A trend value for the ocean current.

Return type:

(np.ndarray)

_motion_a(lb: numpy.ndarray, ub: numpy.ndarray) → numpy.ndarray

Calculates type A motion (eq. 12).

Parameters:
  • lb – Array of lower bounds.
  • ub – Array of upper bounds.
Returns:

A type A motion array.

Return type:

(np.ndarray)

_motion_b(agent_i: opytimizer.core.agent.Agent, agent_j: opytimizer.core.agent.Agent) → numpy.ndarray

Calculates type B motion (eq. 15).

Parameters:
  • agent_i – Current agent to be updated.
  • agent_j – Selected agent.
Returns:

A type B motion array.

Return type:

(np.ndarray)

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

Wraps Jellyfish Search over all agents and variables.

Parameters:
  • space – Space containing agents and update-related information.
  • iteration – Current iteration.
  • n_iterations – Maximum number of iterations.
class opytimizer.optimizers.swarm.js.NBJS(params: Optional[Dict[str, Any]] = None)

An NBJS class, inherited from JS.

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

References

Publication pending.

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

Initialization method.

Parameters:params – Contains key-value parameters to the meta-heuristics.
_motion_a(lb: numpy.ndarray, ub: numpy.ndarray) → numpy.ndarray

Calculates type A motion.

Parameters:
  • lb – Array of lower bounds.
  • ub – Array of upper bounds.
Returns:

A type A motion array.

Return type:

(np.ndarray)