sample_outcome_with_utility

negmas.preferences.sample_outcome_with_utility(ufun, rng, outcome_space=None, issues=None, outcomes=None, n_trials=100)[source]

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

Parameters:
  • ufun (BaseUtilityFunction) – The utility function

  • rng (tuple[float, float]) – The utility range

  • outcome_space (OutcomeSpace | None) – The outcome-space within which to sample

  • issues (Sequence[Issue] | None) – The issues the utility function is defined on

  • outcomes (Sequence[Outcome] | None) – The outcomes to sample from

  • n_trials (int) – The maximum number of trials

Return type:

Outcome | None

Returns:

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