sample_outcome_with_utility

negmas.preferences.sample_outcome_with_utility(ufun: BaseUtilityFunction, rng: tuple[float, float], outcome_space: OutcomeSpace | None = None, issues: Sequence[Issue] | None = None, outcomes: Sequence[Outcome] | None = None, n_trials: int = 100) Outcome | None[source]

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

Parameters:
  • ufun – The utility function

  • rng – The utility range

  • outcome_space – The outcome-space within which to sample

  • 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