class_docstr: A MVPA class, inherited from Optimizer.
  
  This is the designed class to define MVPA-related
  variables and methods.
  
  References:
      H. Bouchekara. Most Valuable Player Algorithm: a novel optimization algorithm inspired from sport.
      Operational Research (2017).
class_docstr_tok: ["A","MVPA","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","MVPA-related","variables","and","methods",".","References",":","H.","Bouchekara",".","Most","Valuable","Player","Algorithm",":","a","novel","optimization","algorithm","inspired","from","sport",".","Operational","Research","(","2017",")","."]
docstr: Wraps Most Valuable Player Algorithm over all agents and variables.
  
  Args:
      space: Space containing agents and update-related information.
      function: A Function object that will be used as the objective function.
docstr_tok: ["Wraps","Most","Valuable","Player","Algorithm","over","all","agents","and","variables",".","Args",":","space",":","Space","containing","agents","and","update-related","information",".","function",":","A","Function","object","that","will","be","used","as","the","objective","function","."]
code: def update(self, space: Space, function: Function) -> None:
      """Wraps Most Valuable Player Algorithm over all agents and variables.
  
      Args:
          space: Space containing agents and update-related information.
          function: A Function object that will be used as the objective function.
  
      """
  
      for i in range(self.n_teams):
          team_i = self._get_agents_from_team(space.agents, i)
          franchise_i = copy.deepcopy(team_i[0])
          fitness_i = np.mean([agent.fit for agent in team_i])
  
          j = r.generate_integer_random_number(0, self.n_teams, i)
          team_j = self._get_agents_from_team(space.agents, j)
          franchise_j = copy.deepcopy(team_j[0])
          fitness_j = np.mean([agent.fit for agent in team_j])
  
          for agent in team_i:
              a = copy.deepcopy(agent)
  
              r1 = r.generate_uniform_random_number()
              r2 = r.generate_uniform_random_number()
              r3 = r.generate_uniform_random_number()
  
              # Updates temporary agent's position (eq. 9)
              a.position += r1 * (
                  franchise_i.position - a.position
              ) + 2 * r1 * (space.best_agent.position - a.position)
  
              # Calculates the probability of team `i` beating team `j` (eq. 16)
              Pr = 1 - fitness_i / (fitness_i + fitness_j + c.EPSILON)
  
              if r2 < Pr:
                  # Updates temporary agent's position (eq. 17)
                  a.position += r3 * (a.position - franchise_j.position)
              else:
                  # Updates temporary agent's position (eq. 18)
                  a.position += r3 * (franchise_j.position - a.position)
              a.clip_by_bound()
  
              a.fit = function(a.position)
              if a.fit < agent.fit:
                  agent.position = copy.deepcopy(a.position)
                  agent.fit = copy.deepcopy(a.fit)
  
imports: import copy
  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.function import Function
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 8 for calling the MVPA obj's underlying member method code with example usage: obj.update(space, function) without return types