normalize

negmas.utilities.normalize(ufun: negmas.utilities.UtilityFunction, outcomes: Collection[Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]], rng: Tuple[float, float] = (0.0, 1.0), epsilon: float = 1e-06, infeasible_cutoff: Optional[float] = None, max_only: bool = False)negmas.utilities.UtilityFunction[source]

Normalizes a utility function to the range [0, 1]

Parameters
  • ufun – The utility function to normalize

  • outcomes – A collection of outcomes to normalize for

  • rng – range to normalize to. Default is [0, 1]

  • epsilon – A small number specifying the resolution

  • infeasible_cutoff – A value under which any utility is considered infeasible and is not used in normalization

  • max_only – If true, normalization is done by dividing by the max otherwise the range will be used.

Returns

A utility function that is guaranteed to be normalized for the set of given outcomes

Return type

UtilityFunction