class_docstr: An UMDA class, inherited from Optimizer.
  
  This is the designed class to define UMDA-related variables and methods.
  
  References:
      H. Mühlenbein. The equation for response to selection and its use for prediction.
      Evolutionary Computation (1997).
class_docstr_tok: ["An","UMDA","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","UMDA-related","variables","and","methods",".","References",":","H.","M\u00fchlenbein",".","The","equation","for","response","to","selection","and","its","use","for","prediction",".","Evolutionary","Computation","(","1997",")","."]
docstr: Calculates probabilities based on pre-selected agents' variables occurrence (eq. 47).
  
  Args:
      agents: List of pre-selected agents.
  
  Returns:
      (np.ndarray): Probability of variables occurence.
docstr_tok: ["Calculates","probabilities","based","on","pre-selected","agents","'","variables","occurrence","(","eq",".","47",")",".","Args",":","agents",":","List","of","pre-selected","agents",".","Returns",":","(","np.ndarray",")",":","Probability","of","variables","occurence","."]
code: def _calculate_probability(self, agents: List[Agent]) -> np.ndarray:
      """Calculates probabilities based on pre-selected agents' variables occurrence (eq. 47).
  
      Args:
          agents: List of pre-selected agents.
  
      Returns:
          (np.ndarray): Probability of variables occurence.
  
      """
  
      probs = np.zeros((agents[0].n_variables, agents[0].n_dimensions))
  
      for agent in agents:
          probs += agent.position
  
      probs /= len(agents)
      probs = np.clip(probs, self.lower_bound, self.upper_bound)
  
      return probs
  
imports: from typing import Any, Dict, List, Optional
  import numpy
  import opytimizer.math.random
  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 8 for calling the UMDA obj's underlying member method code with example usage: obj._calculate_probability(agents) and returns: probs