class_docstr: A DiscreteSearchCallback class that handles mapping floating-point variables
  to discrete values.
docstr: Performs a callback prior to the `evaluate` method.
docstr_tok: ["Performs","a","callback","prior","to","the","`","evaluate","`","method","."]
code: def on_evaluate_before(self, *evaluate_args) -> None:
      """Performs a callback prior to the `evaluate` method."""
  
      space = evaluate_args[0]
      assert isinstance(
          space, Space
      ), "`evaluate_args[0]` is not derived from Space class."
  
      for agent in space.agents:
          for i in range(agent.n_variables):
              # Gathers the current closest allowed value and replaces agent's value
              min_value_idx = np.argmin(
                  abs(agent.position[i] - self.allowed_values[i])
              )
              agent.position[i] = self.allowed_values[i][min_value_idx]
  
imports: from typing import List, TypeVar, Union
  import numpy
  import opytimizer.utils.exception
  from opytimizer.core.space import Space
label_desc: Use image node_id 5 for calling the DiscreteSearchCallback obj's underlying member method code with example usage: obj.on_evaluate_before() without return types