class_docstr: An ASO class, inherited from Optimizer.
  
  This is the designed class to define ASO-related
  variables and methods.
  
  References:
      W. Zhao, L. Wang and Z. Zhang.
      A novel atom search optimization for dispersion coefficient estimation in groundwater.
      Future Generation Computer Systems (2019).
docstr: Calculates the atoms' masses (eq. 17 and 18).
  
  Args:
      agents: List of agents.
  
  Returns:
      (List[float]): A list holding the atoms' masses.
docstr_tok: ["Calculates","the","atoms","'","masses","(","eq",".","17","and","18",")",".","Args",":","agents",":","List","of","agents",".","Returns",":","(","List","[","float","]",")",":","A","list","holding","the","atoms","'","masses","."]
code: def _calculate_mass(self, agents: List[Agent]) -> List[float]:
      """Calculates the atoms' masses (eq. 17 and 18).
  
      Args:
          agents: List of agents.
  
      Returns:
          (List[float]): A list holding the atoms' masses.
  
      """
  
      agents.sort(key=lambda x: x.fit)
  
      worst = agents[-1].fit
      best = agents[0].fit
  
      total_fit = np.sum(
          [
              np.exp(-(agent.fit - best) / (worst - best + c.EPSILON))
              for agent in agents
          ]
      )
  
      mass = [
          np.exp(-(agent.fit - best) / (worst - best + c.EPSILON))
          / total_fit
          for agent in agents
      ]
  
      return mass
  
imports: from typing import Any, Dict, List, Optional
  import numpy
  import opytimizer.math.random
  import opytimizer.utils.constant
  import opytimizer.utils.exception
  from opytimizer.core import Optimizer
  from opytimizer.core.agent import Agent
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 9 for calling the ASO obj's underlying member method code with example usage: obj._calculate_mass(agents) and returns: mass