outcome_with_utility

negmas.utilities.outcome_with_utility(ufun: negmas.utilities.UtilityFunction, rng: Tuple[float, float], issues: Optional[List[negmas.outcomes.Issue]] = None, outcomes: Optional[List[Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]]] = None, n_trials: int = 100)Optional[Union[negmas.outcomes.OutcomeType, Tuple[Union[int, float, str, list]], Dict[Union[int, str], Union[int, float, str, list]]]][source]

Gets one outcome within the given utility range or None on failure

Parameters
  • ufun – The utility function

  • rng – The utility range

  • issues – The issues the utility function is defined on

  • outcomes – The outcomes to sample from

  • n_trials – The maximum number of trials

Returns

  • Either issues, or outcomes should be given but not both